コード例 #1
0
 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;
     }
 }
コード例 #2
0
        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()));
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 public int SaveSpecialDaysSchedules(SpecialDaysSchedule specialDaysSchedule)
 {
     return(calDA.SaveSpecialDaysSchedulesDA(specialDaysSchedule));
 }