Beispiel #1
0
        /// <summary>
        /// 处理档案登记请求
        /// </summary>
        /// <returns>返回档案登记视图</returns>
        public ActionResult StaffRegist()
        {
            IOrgBLL orgBLL = new OrgBLL();

            IOccupationBLL occupationBLL = new OccupationBLL();

            //装载1级机构
            List <FirstOrg>        fList        = orgBLL.GetAllFirstOrg();
            List <Models.FirstOrg> firstOrgList = new List <Models.FirstOrg>();

            foreach (var fo in fList)
            {
                Models.FirstOrg tempFo = new Models.FirstOrg {
                    Id = fo.Id, OrgName = fo.OrgName, OrgLevel = fo.OrgLevel
                };
                firstOrgList.Add(tempFo);
            }
            ViewData["firstOrgList"] = firstOrgList;

            //装载职位类型
            List <OccupationClass>        ocList       = occupationBLL.GetAllOccupationClass();
            List <Models.OccupationClass> occClassList = new List <Models.OccupationClass>();

            foreach (var oc in ocList)
            {
                Models.OccupationClass tempClass = new Models.OccupationClass {
                    Id = oc.Id, Name = oc.Name
                };
                occClassList.Add(tempClass);
            }
            ViewData["occClassList"] = occClassList;

            //装载职称
            List <TechnicalTitle>        ttList     = occupationBLL.GetAllTechnicalTitle();
            List <Models.TechnicalTitle> tTitleList = new List <Models.TechnicalTitle>();

            foreach (var tt in ttList)
            {
                Models.TechnicalTitle tempTitle = new Models.TechnicalTitle {
                    Id = tt.Id, Name = tt.Name
                };
                tTitleList.Add(tempTitle);
            }
            ViewData["tTitleList"] = tTitleList;


            return(View());
        }
        public ActionResult EditTechnicalTitle(string id)
        {
            IOccupationBLL bLL = new OccupationBLL();

            TechnicalTitle technicalTitle = bLL.GetTechnicalTitleById(Convert.ToInt32(id));

            Models.TechnicalTitle technicalTitleView = new Models.TechnicalTitle
            {
                Id   = technicalTitle.Id,
                Name = technicalTitle.Name
            };

            ViewData["technicalTitleView"] = technicalTitleView;

            return(View());
        }
        /// <summary>
        /// 处理职称管理请求
        /// </summary>
        /// <returns>返回视图,包含所有职称信息</returns>
        public ActionResult TitleSettings()
        {
            IOccupationBLL bLL = new OccupationBLL();

            //装载所有职称信息
            List <Models.TechnicalTitle> titleList = new List <Models.TechnicalTitle>();

            foreach (var tt in bLL.GetAllTechnicalTitle())
            {
                Models.TechnicalTitle tempTitle = new Models.TechnicalTitle {
                    Id = tt.Id, Name = tt.Name
                };
                titleList.Add(tempTitle);
            }

            ViewData["titleList"] = titleList;

            return(View());
        }
Beispiel #4
0
        /// <summary>
        /// 控制器内部方法
        /// </summary>
        /// <param name="id">通过id装载视图模型Staff</param>
        private void GetStaffById(string id)
        {
            IStaffBLL staffBLL = new StaffBLL();

            IOrgBLL orgBLL = new OrgBLL();

            IOccupationBLL occupationBLL = new OccupationBLL();

            ISalaryBLL salaryBLL = new SalaryBLL();

            Staff staff = staffBLL.GetStaffById(Convert.ToInt32(id));

            Models.Staff staffView = new Models.Staff();

            Type type = typeof(Models.Staff);

            Type modelType = typeof(Staff);

            var props = type.GetProperties();

            foreach (var p in props)
            {
                if (modelType.GetProperty(p.Name) != null)
                {
                    p.SetValue(staffView, modelType.GetProperty(p.Name).GetValue(staff));
                }
            }

            ThirdOrg        thirdOrg        = orgBLL.GetThirdOrgById(staff.ThirdOrgId);
            SecondOrg       secondOrg       = orgBLL.GetSecondOrgById(thirdOrg.ParentOrgId);
            FirstOrg        firstOrg        = orgBLL.GetFirstOrgById(secondOrg.ParentOrgId);
            OccupationName  occupationName  = occupationBLL.GetOccupationNameById(staff.OccId);
            OccupationClass occupationClass = occupationBLL.GetOccupationClassById(occupationName.ClassId);
            SalaryStandard  salaryStandard  = salaryBLL.GetSalaryStandardById(staff.StandardId);
            TechnicalTitle  technicalTitle  = occupationBLL.GetTechnicalTitleById(staff.TechnicalTitleId);

            staffView.FirstOrg = new Models.FirstOrg {
                Id = firstOrg.Id, OrgLevel = firstOrg.OrgLevel, OrgName = firstOrg.OrgName
            };
            staffView.SecondeOrg = new Models.SecondeOrg {
                Id = secondOrg.Id, OrgName = secondOrg.OrgName, OrgLevel = secondOrg.OrgLevel, ParentOrg = staffView.FirstOrg
            };
            staffView.ThirdOrg = new Models.ThirdOrg {
                Id = thirdOrg.Id, ParentOrg = staffView.SecondeOrg, OrgLevel = thirdOrg.OrgLevel, OrgName = thirdOrg.OrgName
            };
            staffView.OccupationClass = new Models.OccupationClass {
                Id = occupationClass.Id, Name = occupationClass.Name
            };
            staffView.OccupationName = new Models.OccupationName {
                Id = occupationName.Id, Name = occupationName.Name, OccupationClass = staffView.OccupationClass
            };
            staffView.SalaryStandard = new Models.SalaryStandard {
                Id = salaryStandard.Id, StandardName = salaryStandard.StandardName, Total = salaryStandard.Total
            };
            staffView.TechnicalTitle = new Models.TechnicalTitle {
                Id = technicalTitle.Id, Name = technicalTitle.Name
            };

            ViewData["staffView"] = staffView;

            //装载所有职称
            List <Models.TechnicalTitle> list = new List <Models.TechnicalTitle>();

            List <TechnicalTitle> tempList = occupationBLL.GetAllTechnicalTitle();

            foreach (var tt in tempList)
            {
                Models.TechnicalTitle tempTechnicalTitle = new Models.TechnicalTitle
                {
                    Id   = tt.Id,
                    Name = tt.Name
                };
                list.Add(tempTechnicalTitle);
            }

            ViewData["tTitleList"] = list;

            //装载该职位的所有薪酬标准
            List <SalaryStandard> standardList = salaryBLL.GetAllStandardByOccId(staff.OccId);

            List <Models.SalaryStandard> standardListView = new List <Models.SalaryStandard>();

            foreach (var s in standardList)
            {
                Models.SalaryStandard tempStandard = new Models.SalaryStandard
                {
                    Id           = s.Id,
                    StandardName = s.StandardName,
                    Total        = s.Total
                };
                standardListView.Add(tempStandard);
            }

            ViewData["standardListView"] = standardListView;
        }