Пример #1
0
 /// <summary>
 /// Hủy Order
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnCancel_Click(object sender, EventArgs e)
 {
     try
     {
         if (oBL.CheckSendKitchenOrder(OrderID))
         {
             MessageBoxCommon.ShowExclamation("Order đã gửi bếp không thể hủy");
             return;
         }
         int    result            = 1;
         string cancelDescription = "";
         {
             if (MessageBoxCommon.ShowYesNoQuestion_Cancel(EnumCancelAction.Booking, out cancelDescription) == DialogResult.Yes)
             {
                 DictionaryDataSet.OrderRow drObjectChange = (DictionaryDataSet.OrderRow)ShareDictionary.DsDictionary.Order.FindByOrderID(OrderID);
                 if (drObjectChange != null)
                 {
                     drObjectChange.CancelReason     = cancelDescription;
                     drObjectChange.CancelEmployeeID = Session.UserLogin.EmployeeID;
                     drObjectChange.OrderStatus      = (int)EnumOrderStatus.Cancel;
                     result = oBL.InsertUpdateObject(QuizBit.Contract.CommonFunction.GetItem <Order>(drObjectChange));
                     if (result > 0)
                     {
                         OrderStatus = EnumOrderStatus.Cancel;
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBoxCommon.ShowException(ex);
     }
 }
Пример #2
0
 /// <summary>
 /// Hủy đặt bàn
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnCancelBooking_Click(object sender, EventArgs e)
 {
     try
     {
         int    result            = 1;
         string cancelDescription = "";
         if (MessageBoxCommon.ShowYesNoQuestion_Cancel(EnumCancelAction.Booking, out cancelDescription) == DialogResult.Yes)
         {
             DictionaryDataSet.BookingRow drObjectChange = (DictionaryDataSet.BookingRow)CurrentRow;
             if (drObjectChange != null)
             {
                 drObjectChange.CancelDescription = cancelDescription;
                 drObjectChange.BookingStatus     = (int)EnumBookingStatus.Cancel;
                 result = objBLDetail.InsertUpdateObject(QuizBit.Contract.CommonFunction.GetItem <Booking>(drObjectChange));
                 if (result > 0)
                 {
                     BookingStatus = EnumBookingStatus.Cancel;
                     DialogResult  = DialogResult.OK;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBoxCommon.ShowException(ex);
     }
 }
Пример #3
0
 /// <summary>
 /// Hủy Order
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnCancelOrder_Click(object sender, EventArgs e)
 {
     try
     {
         if (IsSendKitchen)
         {
             MessageBoxCommon.ShowExclamation("Order đã có món gửi bếp nên không thể hủy Order.");
             return;
         }
         int    result            = 1;
         string cancelDescription = "";
         if (MessageBoxCommon.ShowYesNoQuestion_Cancel(EnumCancelAction.Booking, out cancelDescription) == DialogResult.Yes)
         {
             DictionaryDataSet.OrderRow drObjectChange = (DictionaryDataSet.OrderRow)CurrentRow;
             if (drObjectChange != null)
             {
                 drObjectChange.CancelReason     = cancelDescription;
                 drObjectChange.OrderStatus      = (int)EnumOrderStatus.Cancel;
                 drObjectChange.CancelEmployeeID = Session.UserLogin.EmployeeID;
                 result = objBLDetail.InsertUpdateObject(QuizBit.Contract.CommonFunction.GetItem <Order>(drObjectChange));
                 if (result > 0)
                 {
                     OrderStatus  = EnumOrderStatus.Cancel;
                     DialogResult = DialogResult.OK;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBoxCommon.ShowException(ex);
     }
 }