示例#1
0
        public ActionResult BHSingleSetupForm()
        {
            BHSingleSetupModel bHSingleSetupModel = new BHSingleSetupModel {
                BranchName      = SelectListItemHelper.GetBranches(),
                AppraisalPeriod = SelectListItemHelper.GetAppraisalPeriod(String.Empty),
                HODeptName      = SelectListItemHelper.GetDepts(String.Empty)
            };

            BHSingleSetupModel bhSingleSetupModel = TempData["bHSingleSetupModel"] as BHSingleSetupModel;

            ViewBag.BranchSelectList         = bHSingleSetupModel.BranchName;
            ViewBag.ApraisalPeriodSelectList = bHSingleSetupModel.AppraisalPeriod;

            if (bhSingleSetupModel == null)
            {
                //return View( bHSingleSetupModel );
            }
            else
            {
                String ErrorMessage = TempData["ErrorMessage"] as String;
                if (ErrorMessage != null)
                {
                    ViewBag.ErrorMessage = ErrorMessage;
                }
                //return View( bhSingleSetupModel );
            }

            return(View(bHSingleSetupModel));
        }
示例#2
0
        public ActionResult SetupAppraisalApprovers()
        {
            AppraisalApproverModel appraisalApproverModel = new AppraisalApproverModel();
            string deptcode     = BRACODE;
            string origdeptcode = "";

            ViewBag.hasdata = "false";

            if (TempData["appraisalApproverModel"] as AppraisalApproverModel != null)
            {
                appraisalApproverModel = TempData["appraisalApproverModel"] as AppraisalApproverModel;
                deptcode     = String.IsNullOrEmpty(appraisalApproverModel.DeptCode) ? deptcode : appraisalApproverModel.DeptCode;
                origdeptcode = appraisalApproverModel.DeptCode;
                int j;
                if (!Int32.TryParse(deptcode, out j))
                {
                    deptcode = HOBCODE;
                }
                else
                {
                    deptcode = (deptcode.Equals(ABJCODE)) ? ABJCODE : BRACODE;
                }
                ViewBag.hasdata = "true";
            }

            appraisalApproverModel.DeptName = SelectListItemHelper.GetDepts();
            appraisalApproverModel.UnitName = SelectListItemHelper.GetUnits(deptcode);

            /*int k;
             * if ( Int32.TryParse(deptcode, out k) ){
             *  deptcode = ( deptcode.Equals(ABJCODE) ) ? ABJCODE : BRACODE;
             * }else {
             *  deptcode = HOBCODE;
             * }*/
            origdeptcode = String.IsNullOrEmpty(origdeptcode)?deptcode:origdeptcode;
            appraisalApproverModel.Role = SelectListItemHelper.GetRoles(deptcode);

            if (!String.IsNullOrEmpty(TempData["ErrorMessage"] as string))
            {
                ViewBag.ErrorMessage = TempData["ErrorMessage"] as string;
            }
            return(View(appraisalApproverModel));
        }