Пример #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 ViewStructure()
        {
            Session["UserName"] = @User.Identity.Name;
            //Session["UserName"] = "******";
            this._UserName = Session["UserName"] as string ?? "";

            if (_UserName == null || _UserName.Equals(String.Empty))
            {
                ViewBag.ErrorMessage = "You must be logged in to continue.";
                return(RedirectToAction("AwaitingMyApproval", "AwaitingApproval"));
            }

            ViewStructure viewStructure = new ViewStructure {
                BranchName = SelectListItemHelper.GetBranches()
            };

            if (TempData["viewStructure"] != null)
            {
                viewStructure            = TempData["viewStructure"] as ViewStructure;
                viewStructure.BranchName = SelectListItemHelper.GetBranches();
            }

            ViewBag.ErrorMessage = TempData["ErrorMessage"] as String ?? String.Empty;

            return(View(viewStructure));
        }
Пример #3
0
        public ActionResult BHBulkSetupForm(int?ActionState)
        {
            SuperBulkSetupModel superBulkSetupModel;

            if (ActionState != null && ActionState == 0)
            {
                BHSingleSetupModel bhs = new BHSingleSetupModel {
                    BranchName      = SelectListItemHelper.GetBranches(),
                    AppraisalPeriod = SelectListItemHelper.GetAppraisalPeriod(String.Empty)
                };
                BHBulkSetupFormModel   bhb = new BHBulkSetupFormModel();
                List <SetupExcelModel> sem = new List <SetupExcelModel>();

                superBulkSetupModel = new SuperBulkSetupModel();
                superBulkSetupModel.BHBulkSetupFormModel = bhb;
                superBulkSetupModel.SetupExcelModel      = sem;
                superBulkSetupModel.BHSingleSetupModel   = bhs;

                return(View(superBulkSetupModel));
            }

            string             periodSelectedValue = (TempData["periodSelectedValue"] != null) ? TempData["periodSelectedValue"].ToString() : String.Empty;
            BHSingleSetupModel bHSingleSetupModel  = new BHSingleSetupModel {
                BranchName      = SelectListItemHelper.GetBranches(),
                AppraisalPeriod = SelectListItemHelper.GetAppraisalPeriod(periodSelectedValue)
            };

            if (TempData["superBulkSetupModel"] != null)
            {
                superBulkSetupModel = TempData["superBulkSetupModel"] as SuperBulkSetupModel;
            }
            else
            {
                if (ViewBag.HasGrid != null)
                {
                    superBulkSetupModel = TempData["superBulkSetupModel"] as SuperBulkSetupModel;
                }
                else
                {
                    BHBulkSetupFormModel   bHBulkSetupFormModel = new BHBulkSetupFormModel();
                    List <SetupExcelModel> setupExcelModel      = new List <SetupExcelModel>();

                    superBulkSetupModel = new SuperBulkSetupModel();
                    superBulkSetupModel.BHBulkSetupFormModel = bHBulkSetupFormModel;
                    superBulkSetupModel.SetupExcelModel      = setupExcelModel;

                    String ErrorMessage = TempData["ErrorMessage"] as String;
                    if (ErrorMessage != null)
                    {
                        ViewBag.ErrorMessage = ErrorMessage;
                    }
                }
            }

            superBulkSetupModel.BHSingleSetupModel = bHSingleSetupModel;
            return(View(superBulkSetupModel));
        }