public ActionResult ShiftDetEdit(ShiftAll shiftAll, ShiftDetail shiftDetail)
        {
            shiftDetail.Shift = shiftAll.Code;
            if (ModelState.IsValid)
            {
                if (shiftAll.EndDate != null & shiftAll.StartDate != null)
                {
                    if (System.DateTime.Compare((System.DateTime)shiftAll.EndDate, (System.DateTime)shiftAll.StartDate) < 1)
                    {
                        SaveErrorMessage(Resources.MD.WorkingCalendar.Errors_StartDateGreaterThanEndDate);
                        return PartialView(shiftAll);
                    }
                }
                this.genericMgr.UpdateWithTrim(shiftDetail);
                SaveSuccessMessage(Resources.MD.WorkingCalendar.ShiftDetail_Updated);
            }

            return PartialView(shiftAll);
        }
 public ActionResult ShiftDetNew(string id)
 {
     if (string.IsNullOrEmpty(id))
     {
         return HttpNotFound();
     }
     else
     {
         ShiftMaster shiftMaster = this.genericMgr.FindById<ShiftMaster>(id);
         ShiftAll shiftAll = new ShiftAll();
         shiftAll.Code = shiftMaster.Code;
         shiftAll.Name = shiftMaster.Name;
         return PartialView(shiftAll);
     }
 }
 public ActionResult ShiftDetEdit(int? id)
 {
     if (!id.HasValue)
     {
         return HttpNotFound();
     }
     else
     {
         ShiftDetail shiftDetail = this.genericMgr.FindById<ShiftDetail>(id);
         ShiftAll shiftAll = new ShiftAll();
         shiftAll.Code = shiftDetail.Shift;
         shiftAll.ShiftTime = shiftDetail.ShiftTime;
         shiftAll.StartDate = shiftDetail.StartDate;
         shiftAll.EndDate = shiftDetail.EndDate;
         shiftAll.Id = shiftDetail.Id;
         ShiftMaster shiftMaster = this.genericMgr.FindById<ShiftMaster>(shiftDetail.Shift);
         shiftAll.Name = shiftMaster.Name;
         return PartialView(shiftAll);
     }
 }
        public ActionResult ShiftMstrNew(ShiftAll shiftAll, ShiftMaster shiftMaster, ShiftDetail shiftDetail)
        {
            if (ModelState.IsValid)
            {
                if (this.genericMgr.FindAll<long>(shiftMstrDuiplicateVerifyStatement, new object[] { shiftMaster.Code })[0] > 0)
                {
                    SaveErrorMessage(Resources.SYS.ErrorMessage.Errors_Existing_Code, shiftMaster.Code.ToString());
                }
                else
                {
                    if (shiftAll.EndDate != null & shiftAll.StartDate != null)
                    {
                        if (System.DateTime.Compare((System.DateTime)shiftAll.EndDate, (System.DateTime)shiftAll.StartDate) < 1)
                        {
                            SaveErrorMessage(Resources.MD.WorkingCalendar.Errors_StartDateGreaterThanEndDate);
                            return PartialView(shiftAll);
                        }
                    }

                    shiftDetail.Shift = shiftAll.Code;
                    WorkingCalendarMgr.CreateShiftMasterAndShiftDetail(shiftMaster, shiftDetail);
                    SaveSuccessMessage(Resources.MD.WorkingCalendar.ShiftMaster_Added);
                    return RedirectToAction("ShiftMstrEdit/" + shiftAll.Code);
                }
            }

            return PartialView(shiftAll);
        }