Beispiel #1
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (tempCurrentDate.Date.CompareTo(DateTime.Today.Date) != 0) tempCurrentDate = new DateTime(tempCurrentDate.Year, tempCurrentDate.Month, tempCurrentDate.Day, 8, 0, 0);
                else if (tempCurrentDate.Date.CompareTo(DateTime.Today.Date) == 0) tempCurrentDate = DateTime.Now;

                CBookingInfoForm tempTransferTableForm = new CBookingInfoForm("Add", null);
                tempTransferTableForm.Show();
                CFormManager.Forms.Push(this);
                this.Hide();

                Updated = true;
            }
            catch (Exception ex)
            {
            }
        }
Beispiel #2
0
 private void UpdateButton_Click(object sender, EventArgs e)
 {
     try
     {
         for (int bkRecordCounter = 0; bkRecordCounter < viewBookingDataGridView.Rows.Count; bkRecordCounter++)
         {
             if (viewBookingDataGridView.Rows[bkRecordCounter].Selected == true && viewBookingDataGridView.Rows[bkRecordCounter].Cells["BookingIDColumn"].Value != null)
             {
                 COrderManager tempOrderManager = new COrderManager();
                 Int64 tempBookingID = Int64.Parse(viewBookingDataGridView.Rows[bkRecordCounter].Cells["BookingIDColumn"].Value.ToString());
                 CResult tempResult = tempOrderManager.GetBookingInfoByID(tempBookingID);
                 if (tempResult.IsSuccess)
                 {
                     CBookingInfoForm tempTransferTableForm = new CBookingInfoForm("Update", (CBooking)tempResult.Data);
                     tempTransferTableForm.Show();
                     CFormManager.Forms.Push(this);
                     this.Hide();
                     Updated = true;
                 }
                 break;
             }
         }
     }
     catch (Exception ex)
     {
     }
 }