public List <DuAnOutput> TimDuAnTheoScope(string scope)
        {
            if (scope == null || scope.Trim() == "")
            {
                return(null);
            }
            List <C01_DesignProject> items = db.C01_DesignProject.Where(s => s.ProjectScope == scope).ToList();

            if (items == null || items.Count == 0)
            {
                return(null);
            }
            List <DuAnOutput> lstproject = new List <DuAnOutput>();

            foreach (C01_DesignProject item in items)
            {
                DuAnOutput da = new DuAnOutput();
                da.MaDuAn         = item.ProjectID;
                da.TenDuAn        = item.ProjectName;
                da.BIMmember      = item.BIM_staff;
                da.BIMMEP         = item.BIM_MEP_staff;
                da.ProjectState   = item.ProjectState;
                da.ARCmodel       = item.Modeling_ARC_main;
                da.STRmodel       = item.Modeling_STR;
                da.MEPmodel       = item.Modeling_MEP;
                da.propjectStatus = item.ProjectStatus;
                da.projectPhase   = item.ProjectPhase;
                da.projectScope   = item.ProjectScope;
                lstproject.Add(da);
            }
            ;
            items.Clear();
            return(lstproject);
        }
        public DuAnOutput TimDuAnTheoId(string id)
        {
            if (id == null || id.Trim() == "")
            {
                return(null);
            }
            C01_DesignProject item = db.C01_DesignProject.Find(id);

            if (item == null)
            {
                return(null);
            }
            DuAnOutput project = new DuAnOutput()
            {
                MaDuAn         = item.ProjectID,
                TenDuAn        = item.ProjectName,
                BIMmember      = item.BIM_staff,
                BIMMEP         = item.BIM_MEP_staff,
                ProjectState   = item.ProjectState,
                ARCmodel       = item.Modeling_ARC_main,
                STRmodel       = item.Modeling_STR,
                MEPmodel       = item.Modeling_MEP,
                propjectStatus = item.ProjectStatus,
                projectPhase   = item.ProjectPhase,
                projectScope   = item.ProjectScope
            };

            return(project);
        }
        public List <DuAnOutput> TimDuAnTheoMemIDStatus(int memberID, string projectState)
        {
            if (memberID < 0)
            {
                return(null);
            }
            C02_BIMstaff user = db.C02_BIMstaff.FirstOrDefault(s => s.BIMstaffID == memberID);

            if (user == null)
            {
                return(null);
            }
            List <C01_DesignProject> listProject = db.C01_DesignProject.Where(s => s.BIM_staff == user.Sortname).ToList();

            if (listProject == null || listProject.Count == 0)
            {
                return(null);
            }
            List <C01_DesignProject> items = listProject.Where(s => s.ProjectState == projectState).ToList();

            if (items == null || items.Count == 0)
            {
                return(null);
            }
            List <DuAnOutput> lstproject = new List <DuAnOutput>();

            foreach (C01_DesignProject item in items)
            {
                DuAnOutput da = new DuAnOutput();
                da.MaDuAn         = item.ProjectID;
                da.TenDuAn        = item.ProjectName;
                da.BIMmember      = item.BIM_staff;
                da.BIMMEP         = item.BIM_MEP_staff;
                da.ProjectState   = item.ProjectState;
                da.ARCmodel       = item.Modeling_ARC_main;
                da.STRmodel       = item.Modeling_STR;
                da.MEPmodel       = item.Modeling_MEP;
                da.propjectStatus = item.ProjectStatus;
                da.projectPhase   = item.ProjectPhase;
                da.projectScope   = item.ProjectScope;
                lstproject.Add(da);
            }
            ;
            items.Clear();
            return(lstproject);
        }