Exemplo n.º 1
0
        internal static int UpdateReserve()
        {
            n = 0;
            try
            {
                daReserve = new TblReserveTableAdapter();
                dtReserve = new DsLiveOutlook.TblReserveDataTable();
                daReserve.FillByID(dtReserve, ReserveInfo.Day, ReserveInfo.Month, ReserveInfo.Year);

                drwReserve = dtReserve[0];

                drwReserve.BeginEdit();

                drwReserve.Day             = ReserveInfo.NewDay;
                drwReserve.Month           = ReserveInfo.NewMonth;
                drwReserve.Year            = ReserveInfo.NewYear;
                drwReserve.MaxAppointments = ReserveInfo.MaxAppointments;

                drwReserve.EndEdit();

                n = daReserve.Update(dtReserve);

                return(n);
            }
            catch (Exception ex)
            {
                Interactive.LInfoError(ex.Message, "Record was not saved !");
                return(n);
            }
        }
Exemplo n.º 2
0
 internal static DataTable GetAllReservesByID()
 {
     try
     {
         ReserveInfo.Recs = false;
         dt        = new DataTable();
         daReserve = new TblReserveTableAdapter();
         dtReserve = new DsLiveOutlook.TblReserveDataTable();
         daReserve.FillByID(dtReserve, ReserveInfo.Day, ReserveInfo.Month, ReserveInfo.Year);
         dt = dtReserve;
         if (dt.Rows.Count > 0)
         {
             ReserveInfo.Recs = true;
         }
     }
     catch (Exception ex)
     {
         Interactive.LInfoError("Could not load Reserve Information\n" + ex.Message, "Database connection failure");
     }
     return(dt);
 }