コード例 #1
0
        /// <summary>
        /// 处理在编辑或添加薪酬标准时发出的添加适用职位请求
        /// </summary>
        /// <param name="formCollection">提交上来的表单容器</param>
        /// <returns>返回添加职位选项后的视图</returns>
        public ActionResult StandardAddOccName(FormCollection formCollection)
        {
            ViewData["formCollection"] = formCollection;

            ISalaryItemBLL salaryItemBLL = new SalaryItemBLL();

            IOccupationBLL occupationBLL = new OccupationBLL();

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

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

            //装载所有职位
            List <OccupationName>        occNameList     = occupationBLL.GetAllOccupationName();
            List <Models.OccupationName> occNameListView = new List <Models.OccupationName>();

            foreach (var on in occNameList)
            {
                Models.OccupationName tempName = new Models.OccupationName {
                    Id = on.Id, Name = on.Name
                };
                OccupationClass tempClass = occupationBLL.GetOccupationClassById(on.ClassId);
                tempName.OccupationClass = new Models.OccupationClass {
                    Id = tempClass.Id, Name = tempClass.Name
                };
                occNameListView.Add(tempName);
            }
            ViewData["occNameListView"] = occNameListView;

            //装载所有薪酬项目
            List <SalaryItem>        itemList     = salaryItemBLL.GetAllSalaryItem();
            List <Models.SalaryItem> itemListView = new List <Models.SalaryItem>();

            foreach (var item in itemList)
            {
                Models.SalaryItem tempItem = new Models.SalaryItem {
                    Id = item.Id, Name = item.Name
                };
                itemListView.Add(tempItem);
            }
            ViewData["itemListView"] = itemListView;

            return(View());
        }
コード例 #2
0
        /// <summary>
        /// 处理职位管理请求
        /// </summary>
        /// <returns>返回视图,包含所有职位信息</returns>
        public ActionResult OccupationSettings()
        {
            IOccupationBLL bLL = new OccupationBLL();

            //装载所有职位类型
            List <Models.OccupationClass> occupationClassList = new List <Models.OccupationClass>();

            foreach (var oc in bLL.GetAllOccupationClass())
            {
                Models.OccupationClass occupationClass = new Models.OccupationClass
                {
                    Id   = oc.Id,
                    Name = oc.Name
                };
                occupationClassList.Add(occupationClass);
            }

            ViewData["occupationClassList"] = occupationClassList;


            //装载所有职位名称
            List <Models.OccupationName> occupationNameList = new List <Models.OccupationName>();

            foreach (var on in bLL.GetAllOccupationName())
            {
                Models.OccupationName occupationName = new Models.OccupationName
                {
                    Id   = on.Id,
                    Name = on.Name
                };
                OccupationClass tempClass = bLL.GetOccupationClassById(on.ClassId);
                occupationName.OccupationClass = new Models.OccupationClass
                {
                    Id   = tempClass.Id,
                    Name = tempClass.Name
                };
                occupationNameList.Add(occupationName);
            }

            ViewData["occupationNameList"] = occupationNameList;

            return(View());
        }