using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;





namespace Maser.Feanor.Model
{
    public class Project
    {
        public Project() { }


        public Project(Int32 PK, Int32 chamber, DateTime start, DateTime? stop, Int32? ProjectID, String ProjectDescription, Int32? SubProject, String SubProjectDescription, Int32? Step, String StepDescription, String CustomerDescription, Int32 TotalTime)
        {
            _PK = PK;
            _chamber = chamber;
            _start = start;
            _Stop = stop;
            _ProjectID = ProjectID;
            _ProjectDescription = ProjectDescription;
            _SubProject = SubProject;
            _SubProjectDescription = SubProjectDescription;
            _Step = Step;
            _StepDescription = StepDescription;
            _Customer = CustomerDescription;
            _TotalTime = TotalTime;
        }


        public Int32 PK
        {
            set { _PK = value; }
            get { return _PK; }
        }
        private Int32 _PK;

        public Int32 Chamber
        {
            set { _chamber = value; }
            get { return _chamber; }
        }
        private Int32 _chamber;


        public DateTime Start
        {
            set { _start = value; }
            get { return _start; }
        }
        private DateTime _start;


        public DateTime? Stop
        {
            set { _Stop = value; }
            get { return _Stop; }
        }
        private DateTime? _Stop;


        public Int32? ProjectID
        {
            set { _ProjectID = value; }
            get { return _ProjectID; }
        }
        private Int32? _ProjectID;

        public String ProjectDescription
        {
            set { _ProjectDescription = value; }
            get { return _ProjectDescription; }
        }
        private String _ProjectDescription;

        public Int32? SubProject
        {
            set { _SubProject = value; }
            get { return _SubProject; }
        }
        private Int32? _SubProject;

        public String SubProjectDescription
        {
            set { _SubProjectDescription = value; }
            get { return _SubProjectDescription; }
        }
        private String _SubProjectDescription;

        public Int32? Step
        {
            set { _Step = value; }
            get { return _Step; }
        }
        private Int32? _Step;

        public String StepDescription
        {
            set { _StepDescription = value; }
            get { return _StepDescription; }
        }
        private String _StepDescription;

        public String Customer
        {
            set { _Customer = value; }
            get { return _Customer; }
        }
        private String _Customer;

        public Int32 TotalTime
        {
            set { _TotalTime = value; }
            get { return _TotalTime; }
        }
        private Int32 _TotalTime;

        public override string ToString()
        {
            return string.Format("Project: Project_PK={0}, Chamber={1}, Start={2}, Project={4}, SubProject={5}, Step={6}, Customer={7}",
                _PK, _chamber, _start, _Stop, _ProjectID, _SubProject, _Step, _Customer);
        }

        public string PathToFolderOnServer
        {
            get
            {
                //   Z:\projects\2008\P080104\sub1
                Int32 Year = (Int32)Math.Floor((double)_ProjectID / 10000) + 2000;
                return String.Format("Z:\\projects\\{0}\\P{1:000000}\\sub{2}", Year, _ProjectID, _SubProject);
            }
        }
    }
}
