public ActionResult _Update(int id, StandardWorkingCalendar standardWorkingCalendar, StandardWorkingCalendarSearchModel searchModel, GridCommand command)
        {
            try
            {
                ModelState.Remove("Region");
                ModelState.Remove("DayOfWeek");
                var newWorkingCalendar = base.genericMgr.FindById<StandardWorkingCalendar>(id);
                newWorkingCalendar.Shift = standardWorkingCalendar.Shift;
                newWorkingCalendar.Type = standardWorkingCalendar.Type;
                newWorkingCalendar.Category = WorkingCalendarCategory.Region;
                base.genericMgr.Update(newWorkingCalendar);
                //SaveSuccessMessage(Resources.PRD.StandardWorkingCalendar.StandardWorkingCalendar_Updated);
            }
            catch (BusinessException ex)
            {
                SaveBusinessExceptionMessage(ex);
            }
            catch (Exception ex)
            {
                SaveErrorMessage(ex);
            }

            SearchStatementModel searchStatementModel = this.PrepareSearchStatement(command, searchModel);
            return PartialView(GetAjaxPageData<StandardWorkingCalendar>(searchStatementModel, command));
        }
        public ActionResult Edit(StandardWorkingCalendar standardWorkingCalendar)
        {
            if (ModelState.IsValid)
            {
                var items = base.genericMgr.FindAll<StandardWorkingCalendar>(duiplicateVerifyStatement, new object[] { standardWorkingCalendar.Region, standardWorkingCalendar.DayOfWeek });
                var sameItem = items.FirstOrDefault(c => c.Id != standardWorkingCalendar.Id);
                if (sameItem != null)
                {
                    this.FillCodeDetailDescription(standardWorkingCalendar);
                    SaveErrorMessage(Resources.PRD.StandardWorkingCalendar.Errors_Existing_DayOfWeekInTheRegion, standardWorkingCalendar.Region, standardWorkingCalendar.DayOfWeekDescription);
                }
                else
                {
                    standardWorkingCalendar.RegionName = base.genericMgr.FindById<Party>(standardWorkingCalendar.Region).Name;
                    base.genericMgr.Update(standardWorkingCalendar);
                    SaveSuccessMessage(Resources.PRD.StandardWorkingCalendar.StandardWorkingCalendar_Updated);
                    return RedirectToAction("List/");
                }
            }

            return View(standardWorkingCalendar);
        }
        public ActionResult New(StandardWorkingCalendar standardWorkingCalendar)
        {
            if (ModelState.IsValid)
            {
                if (base.genericMgr.FindAll<long>(duiplicateVerifyCountStatement, new object[] { standardWorkingCalendar.Region, standardWorkingCalendar.DayOfWeek })[0] > 0)
                {
                    this.FillCodeDetailDescription(standardWorkingCalendar);
                    SaveErrorMessage(Resources.PRD.StandardWorkingCalendar.Errors_Existing_DayOfWeekInTheRegion, standardWorkingCalendar.Region, standardWorkingCalendar.DayOfWeekDescription);
                }
                else
                {
                    standardWorkingCalendar.RegionName = base.genericMgr.FindById<Party>(standardWorkingCalendar.Region).Name;
                    standardWorkingCalendar.Category = WorkingCalendarCategory.Region;
                    base.genericMgr.Create(standardWorkingCalendar);
                    SaveSuccessMessage(Resources.PRD.StandardWorkingCalendar.StandardWorkingCalendar_Added);
                    return RedirectToAction("List/");
                }
            }

            return View(standardWorkingCalendar);
        }