private void btnEditCustomer_Click(object sender, EventArgs e) { //For modifying the customer information COrderManager tempOrderManager = new COrderManager(); CResult objCresult = new CResult(); objCresult = tempOrderManager.OrderInfoByOrderID(m_orderID); CDelivery objDeliveryTime = new CDelivery(); //Collecting the delivery information of the order objDeliveryTime.DeliveryOrderID = m_orderID; CResult objDeliveryInfo = tempOrderManager.GetDeliveryInfo(objDeliveryTime); objDeliveryTime = (CDelivery)objDeliveryInfo.Data; COrderInfo tempOrderInfo = (COrderInfo)objCresult.Data; CTakeAwayForm objTakeawayFrm = new CTakeAwayForm(m_orderID, objDeliveryTime, tempOrderInfo.Status, true); objTakeawayFrm.Show(); CFormManager.Forms.Push(m_previousForm); this.Hide(); }
private void functionalButton1_Click(object sender, EventArgs e) { try { COrderManager tempOrderManager = new COrderManager(); CResult oResult = tempOrderManager.OrderInfoByOrderID(orderID); COrderInfo tempOrderInfo = new COrderInfo(); if (oResult.IsSuccess && oResult.Data != null) { tempOrderInfo = (COrderInfo)oResult.Data; } List<COrderShow> tempOrderShowList = new List<COrderShow>(); oResult = tempOrderManager.OrderListShowByStatus("Paid"); if (oResult.IsSuccess && oResult.Data != null) { tempOrderShowList = (List<COrderShow>)oResult.Data; } if (tempOrderInfo.OrderType.Equals("Table")) { tempOrderManager.DeleteTableInfo(tempOrderInfo.TableNumber, "Table"); CTakeAwayForm tempTakeAway = new CTakeAwayForm(orderID); tempTakeAway.Show(); CFormManager.Forms.Push(this); this.Hide(); } else if (tempOrderInfo.OrderType.Equals("TakeAway")) { CCalculatorForm tableNumberForm = new CCalculatorForm("Table Information", "Table Number"); tableNumberForm.ShowDialog(); if (CCalculatorForm.inputResult.Equals("Cancel")) return; if (CCalculatorForm.inputResult.Equals("") || Int32.Parse(CCalculatorForm.inputResult) == 0) { CMessageBox tempMessageBox = new CMessageBox("Error", "Input invalid!"); tempMessageBox.ShowDialog(); return; } string tableNumber = ""; tableNumber = CCalculatorForm.inputResult; bool found = false; for (int counter = 0; counter < tempOrderShowList.Count; counter++) { if (int.Parse(tableNumber) == tempOrderShowList[counter].TableNumber && tempOrderShowList[counter].OrderType.Equals("Table")) found = true; } if (found) { CMessageBox tempMessageBox = new CMessageBox("Error", "Table already opened. Please select another table number."); tempMessageBox.ShowDialog(); return; } CCalculatorForm tableGuestForm = new CCalculatorForm("Table Information", "Guest Quantity"); tableGuestForm.ShowDialog(); if (CCalculatorForm.inputResult.Equals("Cancel")) return; if (CCalculatorForm.inputResult.Equals("") || Int32.Parse(CCalculatorForm.inputResult) == 0) { CMessageBox tempMessageBox = new CMessageBox("Error", "Input invalid!"); tempMessageBox.ShowDialog(); return; } string tableGuest = ""; tableGuest = CCalculatorForm.inputResult; tempOrderManager.DeleteTableInfo(tempOrderInfo.TableNumber, "TakeAway"); tempOrderInfo.OrderType = "Table"; tempOrderInfo.Status = "Seated"; tempOrderInfo.TableNumber = int.Parse(tableNumber); //tempOrderInfo.TableName = "Table " + tableNumber; tempOrderInfo.GuestCount = int.Parse(tableGuest); CTableInfo tempTableInfo = new CTableInfo(); tempTableInfo.TableNumber = tempOrderInfo.TableNumber; tempTableInfo.TableType = "Table"; tempOrderManager.InsertTableInfo(tempTableInfo); ////g_ConvertButton.Text = "Convert to Take Away"; tempOrderManager.UpdateOrderInfo(tempOrderInfo); } } catch (Exception exp) { MessageBox.Show(exp.Message, RMSGlobal.MessageBoxTitle, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void TWButton_Click(object sender, EventArgs e) { /* CustomerListForm.m_phoneNumber = String.Empty; TakeAway.CTakeAwayTypeForm objTakeAwayType = new CTakeAwayTypeForm(this); objTakeAwayType.Show();*/ CTakeAwayForm tempTakeAwayForm = new CTakeAwayForm(2); //2 for collection type orders tempTakeAwayForm.Show(); CFormManager.Forms.Push(this); this.Hide(); }