public override void CreateShift(Shift entity) { base.CreateShift(entity); ShiftDetail shiftDetail = new ShiftDetail(); shiftDetail.Shift = entity; shiftDetail.ShiftTime = entity.ShiftTime; if (entity.StartDate != null && entity.StartDate.Trim() != string.Empty) { shiftDetail.StartDate = DateTime.Parse(entity.StartDate); } if (entity.EndDate != null && entity.EndDate.Trim() != string.Empty) { shiftDetail.EndDate = DateTime.Parse(entity.EndDate); } shiftDetailMgr.CreateShiftDetail(shiftDetail); }
public virtual void DeleteShift(Shift entity) { Delete(entity); }
public virtual void UpdateShift(Shift entity) { Update(entity); }
public virtual void CreateShift(Shift entity) { Create(entity); }
public virtual void DeleteShift(Shift entity) { entityDao.DeleteShift(entity); }
public virtual void UpdateShift(Shift entity) { entityDao.UpdateShift(entity); }
public virtual void CreateShift(Shift entity) { entityDao.CreateShift(entity); }
public IList<Shift> GetShiftByDate(DateTime date, string region, string workcenter) { List<WorkCalendar> workCalendars = this.GetWorkCalendar(date, region, workcenter); IList<Shift> shiftList = new List<Shift>(); if (workCalendars != null && workCalendars.Count > 0) { foreach (WorkCalendar workCalendar in workCalendars) { if (workCalendar.ShiftCode != null && workCalendar.ShiftCode.Trim() != string.Empty) { bool isExist = false; if (shiftList != null && shiftList.Count > 0) { foreach (Shift sf in shiftList) { if (sf.Code.Trim().ToUpper() == workCalendar.ShiftCode.Trim().ToUpper()) { isExist = true; break; } } } if (!isExist) { Shift shift = new Shift(); shift = ShiftMgrE.LoadShift(workCalendar.ShiftCode, date); shiftList.Add(shift); } } } } return shiftList; }
public DateTime GetShiftStartTime(DateTime date, Shift shift) { string[] shiftTime = shift.ShiftTime.Split('-'); if (shiftTime.Length == 0) return date.Date; else return this.AssembleActualTime(date, shiftTime[0]); }
public DateTime GetShiftEndTime(DateTime date, Shift shift) { string[] shiftTime = shift.ShiftTime.Split('-'); if (shiftTime.Length == 0) { return date.Date.AddDays(1); } else { DateTime shiftStart = this.GetShiftStartTime(date, shift); DateTime shiftEnd = this.AssembleActualTime(date, shiftTime[shiftTime.Length - 1]); if (DateTime.Compare(shiftStart, shiftEnd) < 0) { return shiftEnd; } else { //┐ум╣═ь░Я return shiftEnd.AddDays(1); } } }
public void UpdateShift(Shift shift) { ShiftMgr.UpdateShift(shift); }
public void DeleteShift(Shift shift) { ShiftMgr.DeleteShift(shift); }
public void CreateShift(Shift shift) { ShiftMgr.CreateShift(shift); }
public DateTime GetShiftStartTime(DateTime date, Shift shift) { string[] shiftTime = shift.ShiftTime.Split('-'); if (shift.DaysAdd == BusinessConstants.CODE_MASTER_DAYS_ADD_TYPE_START_ADD) { date = date.AddDays(1); } if (shiftTime.Length == 0) return date.Date; else return this.AssembleActualTime(date, shiftTime[0]); }
public DateTime GetShiftEndTime(DateTime date, Shift shift) { string[] shiftTime = shift.ShiftTime.Split('-'); if (shiftTime.Length == 0) { return date.Date.AddDays(1); } else { if (shift.DaysAdd == BusinessConstants.CODE_MASTER_DAYS_ADD_TYPE_START_ADD || shift.DaysAdd == BusinessConstants.CODE_MASTER_DAYS_ADD_TYPE_END_ADD) { date = date.AddDays(1); } return this.AssembleActualTime(date, shiftTime[shiftTime.Length - 1]); } }