Exemplo n.º 1
0
        /// <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();
            }
        }
Exemplo n.º 2
0
 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
         });
     }
 }
Exemplo n.º 3
0
 public void SetStatus(HolidayStatus status)
 {
     if (status == HolidayStatus.Approved)
     {
         this.status = "Approved";
     }
     else
     {
         this.status = "Declined";
     }
 }