/// <summary> /// Update Holiday /// </summary> /// <param name="user">User</param> /// <param name="id"></param> /// <param name="status"></param> /// <param name="holiday">Holiday</param> public void UpdateHoliday(string user, int id, HolidayStatus status, IEnumerable <string> holiday) { using (var uofw = new FlowTasksUnitOfWork()) { var hday = uofw.Holidays.Find(h => h.HolidayId == id).FirstOrDefault(); if (hday == null) { return; } hday.Status = status.ToString(); if (holiday != null) { var holidayList = holiday as IList <string> ?? holiday.ToList(); hday.Year = GetYearFromDate(holidayList.FirstOrDefault()); if (holidayList.Any()) { hday.Dates = String.Join(",", holidayList); } } uofw.Commit(); } }
public static void SetHoliday(TaskStateData taskStatus, HolidayStatus res) { using (var proxy = new FlowTasksService()) { proxy.UpdateHoliday(new UpdateHolidayRequest { HolidayId = int.Parse(taskStatus.Parameters["HolidayId"]), Status = res }); } }
public void SetStatus(HolidayStatus status) { if (status == HolidayStatus.Approved) { this.status = "Approved"; } else { this.status = "Declined"; } }