public Task <int> SaveSpecialDaySchedule(SpecialDaysSchedule specialDaysSchedule) { try { specialDaysSchedule.Capacity = Convert.ToInt32(_context.Configurations.FirstOrDefault(r => r.Name == "CapacityDate").Value); _context.SpecialDaysSchedules.AddOrUpdate(specialDaysSchedule); return(_context.SaveChangesAsync()); } catch (Exception exception) { throw exception; } }
public int SaveSpecialDaysSchedulesDA(SpecialDaysSchedule specialDaysSchedule) { DataSet ds = new DataSet(); string query = "exec spI_SpecialDaysSchedules spI_SpecialDays @DelegationId=" + specialDaysSchedule.DelegationId + ", @Date='" + specialDaysSchedule.Date + "', @Time='" + specialDaysSchedule.Time + "', @Capacity =" + specialDaysSchedule.Capacity; ds = con.ObtenerConsulta(query); return(Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[0].ToString())); }
public List <SpecialDaysSchedule> GetSpecialDaysSchedulesDA(int DelegationId) { DataSet ds = new DataSet(); List <SpecialDaysSchedule> listA = new List <SpecialDaysSchedule>(); string query = "exec spS_SpecialDaySchedulesByDelegation @DelegationId=" + DelegationId; ds = con.ObtenerConsulta(query); foreach (DataRow DR in ds.Tables[0].Rows) { SpecialDaysSchedule sd = new SpecialDaysSchedule(); sd.DelegationId = Convert.ToInt32(DR["DelegationId"].ToString()); sd.Date = Convert.ToDateTime(DR["Date"].ToString()); sd.Capacity = Convert.ToInt32(DR["Capacity"].ToString()); sd.SpecialDayScheduleId = Convert.ToInt32(DR["SpecialDayScheduleId"].ToString()); sd.Time = TimeSpan.Parse(DR["Time"].ToString()); listA.Add(sd); } return(listA); }
public int SaveSpecialDaysSchedules(SpecialDaysSchedule specialDaysSchedule) { return(calDA.SaveSpecialDaysSchedulesDA(specialDaysSchedule)); }