예제 #1
0
        public ActionResult PlanModule(string Id_encrypted, string pid_encrypted)
        {
            PlanModuleVM    planModuleVM    = new PlanModuleVM();
            PlanModuleModel planModuleModel = new PlanModuleModel();

            if (Id_encrypted != null)
            {
                planModuleModel = planBusiness.GetPlanModulePermission(Convert.ToInt32(Id_encrypted));
                AutoMapper.Mapper.Map(planModuleModel, planModuleVM);
            }

            planModuleVM.PlanId     = Convert.ToInt32(pid_encrypted).Encrypt();
            planModuleVM.ModuleList = planBusiness.GetAllModules();

            return(View(planModuleVM));
        }
예제 #2
0
        public ActionResult PlanModule(PlanModuleVM planModuleVM)
        {
            if (planBusiness.IsDuplicateModuleInPlan(planModuleVM.PlanId.Decrypt(), planModuleVM.ModuleId, planModuleVM.PlanModuleId.Decrypt()))
            {
                ViewBag.ErrorMessage    = "Module already exist in the plan";
                planModuleVM.ModuleList = planBusiness.GetAllModules();
                return(View(planModuleVM));
            }
            PlanModuleModel planModuleModel = new PlanModuleModel();



            AutoMapper.Mapper.Map(planModuleVM, planModuleModel);
            bool resultsuccess = planBusiness.AddUpdatePlanModulePermission(planModuleModel, (int)SessionManagement.LoggedInUser.UserId);

            return(RedirectToAction("PlanDetail/" + planModuleVM.PlanId, "Admin"));
        }