private void PercentButton_Click(object sender, EventArgs e) { CCalculatorForm tempPriceCalculator = new CCalculatorForm("Set Charge", "Enter charge in percentage"); tempPriceCalculator.ShowDialog(); if (CCalculatorForm.inputResult.Equals("Cancel")) return; Double.TryParse(CCalculatorForm.inputResult, out m_serviceChargeAmount); m_serviceChargeType = "Percent"; }
private void PercentButton_Click(object sender, EventArgs e) { CCalculatorForm tempPriceCalculator = new CCalculatorForm("Set Discount", "Enter discount in percentage"); tempPriceCalculator.ShowDialog(); if (CCalculatorForm.inputResult.Equals("Cancel")) return; Double.TryParse(CCalculatorForm.inputResult, out discountAmount); discountType = "Percent"; this.Close(); }
private void Category3Button_Click(object sender, EventArgs e) { //get item qty CCategoryButton tempCategory3Button = (CCategoryButton)sender; RMSGlobal.m_sellinginvalue = tempCategory3Button.SellingQuantityorWeight; //Used to identify the product whether sold in quantity or weight int tempCategory3ID = tempCategory3Button.CategoryID; if (m_bItemDescriptionClicked) { string tempItemDescription = Program.initDataSet.Tables["Category3"].Select("cat3_id = " + tempCategory3ID)[0]["description"].ToString(); if (!tempItemDescription.Equals("")) { CMessageBox tempMessageBox = new CMessageBox("Item Description", tempItemDescription); tempMessageBox.ShowDialog(); } else { CMessageBox tempMessageBox = new CMessageBox("Item Description", "No information available."); tempMessageBox.ShowDialog(); } m_bItemDescriptionClicked = false; return; } int tempFoodType = int.Parse(Program.initDataSet.Tables["Category3"].Select("cat3_id = " + tempCategory3ID)[0].GetParentRow(Program.initDataSet.Relations["category2_to_category3"])["cat2_type"].ToString()); DataGridView tempDataGridView = new DataGridView(); if (tempFoodType == 0) { tempDataGridView = g_BeverageDataGridView; } else { tempDataGridView = g_FoodDataGridView; } DataRow[] tempDataRowArray = Program.initDataSet.Tables["Category4"].Select("cat3_id = " + tempCategory3ID.ToString()); category4ButtonList.Clear(); COrderInfoDAO aOrderInfoDao = new COrderInfoDAO(); COrderInfo aCOrderInfo = aOrderInfoDao.GetOrderInfoByOrderID(orderID); if (tempDataRowArray.Length != 0) { foreach (DataRow tempDataRow in tempDataRowArray) { if (Int32.Parse(tempDataRow["status"].ToString()) == 0) { continue; } CCategoryButton tempCategoryButton = new CCategoryButton(); tempCategoryButton.CategoryID = int.Parse(tempDataRow["cat4_id"].ToString()); tempCategoryButton.CategoryOrder = int.Parse(tempDataRow["cat4_order"].ToString()); tempCategoryButton.CategoryLevel = 4; tempCategoryButton.Text = tempDataRow["cat4_name"].ToString(); tempCategoryButton.BackColor = tempCategory3Button.BackColor; category4ButtonList.Add(tempCategoryButton); } keyboardForm.Hide(); CCategory4Form tempCategory4Form = new CCategory4Form(tempCategory3ID, category4ButtonList, tempCategory3Button.Text); tempCategory4Form.ShowDialog(); CCategoryButton tempCategory4Button = CCategory4Form.m_cbResult; m_iSavedOrderedQty = CCategory4Form.ItemQTY; if (tempCategory4Button == null) { return; } else //insert into table and datagridview { DataRow[] temp2DataRowArray = Program.initDataSet.Tables["Category4"].Select("cat4_id = " + tempCategory4Button.CategoryID.ToString()); if (temp2DataRowArray.Length != 0) { //category4 + categpry3 string ItemName = temp2DataRowArray[0]["cat4_name"].ToString() + " " + tempCategory3Button.Text; string tableTypePrice = string.Empty; if (m_iType == m_cCommonConstants.TableType) { tableTypePrice = temp2DataRowArray[0]["table_price"].ToString(); } else if (m_iType == m_cCommonConstants.TakeAwayType) { tableTypePrice = temp2DataRowArray[0]["tw_price"].ToString(); } int tempSearchResult = FindExistingItem(tempDataGridView, ItemName); // vat_included double vatRate = 0; bool vat_included = false; double vatAmountRate = 0; try { vatRate = Convert.ToDouble(temp2DataRowArray[0]["vat_Rate"].ToString()); vat_included = Convert.ToBoolean(temp2DataRowArray[0]["vat_included"].ToString()); if (vat_included) { vatAmountRate = (Double.Parse(tableTypePrice) * vatRate) / 100; // tableTypePrice = (Double.Parse(tableTypePrice) - vatAmountRate).ToString(); tableTypePrice = Convert.ToDouble(tableTypePrice).ToString(); } else { vatAmountRate = 0.00; } } catch (Exception ex) { } COrderManager tempOrderManager = new COrderManager(); COrderDetails tempOrderDetails = new COrderDetails(); if (tempSearchResult != -1) { int tempRowIndex = tempSearchResult; int qty = int.Parse(tempDataGridView.Rows[tempRowIndex].Cells[1].Value.ToString()) + m_iSavedOrderedQty; tempDataGridView.Rows[tempRowIndex].Cells[1].Value = qty; tempDataGridView.Rows[tempRowIndex].Cells[3].Value = ((double)(Double.Parse(tableTypePrice) * qty)).ToString("F02"); //update Order_details table tempOrderDetails.OrderID = orderID; tempOrderDetails.OrderDetailsID = Int64.Parse(tempDataGridView.Rows[tempRowIndex].Cells[7].Value.ToString()); tempOrderDetails.ProductID = tempCategory4Button.CategoryID; tempOrderDetails.CategoryLevel = tempCategory4Button.CategoryLevel; tempOrderDetails.OrderQuantity = qty; tempOrderDetails.UnitPrice = Convert.ToDouble(tableTypePrice); tempOrderDetails.OrderAmount = tempOrderDetails.OrderQuantity * Double.Parse(tableTypePrice); tempOrderDetails.OrderFoodType = tempFoodType == 1 ? ("Food") : ("Nonfood"); tempOrderDetails.OnlineItemSequenceNumber = Int64.Parse(tempDataGridView.Rows[tempRowIndex].Cells[6].Value.ToString()); tempOrderDetails.PrintedQuantity = int.Parse(tempDataGridView.Rows[tempRowIndex].Cells[8].Value.ToString()); if (aCOrderInfo.VatComplementory) vatRate =vatAmountRate= 0; if (vat_included) { // tempOrderDetails.VatTotal = tempOrderDetails.OrderAmount * vatAmountRate; tempOrderDetails.VatTotal = qty * vatAmountRate; tempDataGridView.Rows[tempRowIndex].Cells[2].Value = qty * vatAmountRate; } else { tempOrderDetails.VatTotal = tempOrderDetails.OrderAmount * (vatRate / 100); } if (m_orderUserName.Replace(" ", "").ToUpper() != "Web User".Replace(" ", "").ToUpper()) { tempOrderManager.UpdateOrderDetails(tempOrderDetails); } else { tempOrderManager.UpdateOnlineOrderDetails(tempOrderDetails);//for online orders } } else { //Insert into Order_details table tempOrderDetails.OrderID = orderID; tempOrderDetails.ProductID = tempCategory4Button.CategoryID; tempOrderDetails.CategoryLevel = tempCategory4Button.CategoryLevel; tempOrderDetails.OrderQuantity = m_iSavedOrderedQty; tempOrderDetails.OrderAmount = tempOrderDetails.OrderQuantity * Double.Parse(tableTypePrice); tempOrderDetails.OrderFoodType = tempFoodType == 1 ? ("Food") : ("Nonfood"); tempOrderDetails.ItemOrderTime = DateTime.Now.Ticks; tempOrderDetails.UnitPrice = Convert.ToDouble(tableTypePrice); // tempOrderDetails.Product_Name = temp2DataRowArray[0]["cat3_name"].ToString(); if (aCOrderInfo.VatComplementory) vatRate = 0; if (vat_included) { tempOrderDetails.VatTotal = 0; tempOrderDetails.VatTotal = tempOrderDetails.OrderAmount * (vatRate / 100); // tempOrderDetails.VatTotal = tempOrderDetails.OrderAmount * vatAmountRate; } else { tempOrderDetails.VatTotal = tempOrderDetails.OrderAmount * (vatRate / 100); } tempOrderDetails.Amount_with_vat = tempOrderDetails.OrderAmount + tempOrderDetails.VatTotal; string category1ID = this.GetCategory1ID(tempOrderDetails.ProductID, tempOrderDetails.CategoryLevel); //Int32 cat1Order = this.GetCategory1OrderNumber(Convert.ToInt32(category1ID)); // Change by Mithu if (m_orderUserName.Replace(" ", "").ToUpper() != "Web User".Replace(" ", "").ToUpper()) { tempOrderDetails = (COrderDetails)tempOrderManager.InsertOrderDetails(tempOrderDetails).Data; string[] tempDataGridViewRow = new string[] { ItemName, m_iSavedOrderedQty.ToString(), ((double)tempOrderDetails.VatTotal).ToString("F02"), ((double)(Double.Parse(tableTypePrice)*m_iSavedOrderedQty)).ToString("F02"), tempCategory4Button.CategoryID.ToString(), "4", temp2DataRowArray[0]["cat4_rank"].ToString(), tempOrderDetails.OrderDetailsID.ToString(), "0", tempOrderDetails.UnitPrice.ToString("F2") }; tempDataGridView.Rows.Add(tempDataGridViewRow); } else //For online orders { tempOrderDetails.ItemName = ItemName; tempOrderDetails = (COrderDetails)tempOrderManager.InsertOnlineOrderDetails(tempOrderDetails).Data; string[] tempDataGridViewRow = new string[] { ItemName, m_iSavedOrderedQty.ToString(), ((double)tempOrderDetails.VatTotal).ToString("F02"), ((double)(Double.Parse(tableTypePrice)*m_iSavedOrderedQty)).ToString("F02"), tempCategory4Button.CategoryID.ToString(), "4", tempOrderDetails.OnlineItemSequenceNumber.ToString(), tempOrderDetails.OrderDetailsID.ToString(),"0", tempOrderDetails.UnitPrice.ToString("F2") }; tempDataGridView.Rows.Add(tempDataGridViewRow); } } if (m_orderUserName.Replace(" ", "").ToUpper() != "Web User".Replace(" ", "").ToUpper()) //If local orders are considered { this.ConvertRank(); } tempDataGridView.Sort(tempDataGridView.Columns[5], ListSortDirection.Ascending); tempDataGridView.Update(); TotalAmountCalculation(); } } } else //There is no category4 { keyboardForm.Hide(); try { CCalculatorForm tempCalculatorForm = new CCalculatorForm("Order Quantity", "Item Quantity"); tempCalculatorForm.ShowDialog(); if (CCalculatorForm.inputResult.Equals("Cancel")) return; string str = CCalculatorForm.inputResult; str = (str == "") ? "1" : str; if (Int32.Parse(str) == 0) { CMessageBox tempMessageBox = new CMessageBox("Error", "Input invalid!"); tempMessageBox.ShowDialog(); return; } int tempOrderedQty = Int32.Parse(str); m_iSavedOrderedQty = tempOrderedQty; } catch (Exception exp) { MessageBox.Show(exp.Message, RMSGlobal.MessageBoxTitle, MessageBoxButtons.OK, MessageBoxIcon.Error); } DataGridViewRow tempDataGridViewRow = new DataGridViewRow(); tempDataGridViewRow.CreateCells(tempDataGridView); DataRow[] temp2DataRowArray = Program.initDataSet.Tables["Category3"].Select("cat3_id = " + tempCategory3Button.CategoryID.ToString()); if (temp2DataRowArray.Length != 0) { string tableTypePrice = string.Empty; if (m_iType == m_cCommonConstants.TableType) { tableTypePrice = temp2DataRowArray[0]["table_price"].ToString(); } else if (m_iType == m_cCommonConstants.TakeAwayType) { tableTypePrice = temp2DataRowArray[0]["tw_price"].ToString(); } // vat_included double vatRate = 0; bool vat_included = false; double vatAmountRate = 0; try { vatRate = Convert.ToDouble(temp2DataRowArray[0]["vat_Rate"].ToString()); vat_included = Convert.ToBoolean(temp2DataRowArray[0]["vat_included"].ToString()); if (vat_included) { vatAmountRate = (Double.Parse(tableTypePrice) * vatRate) / 100; // tableTypePrice = (Double.Parse(tableTypePrice) - vatAmountRate).ToString(); tableTypePrice = Convert.ToDouble(tableTypePrice).ToString(); } else { vatAmountRate = 0.00; } } catch (Exception ex) { } COrderManager tempOrderManager = new COrderManager(); COrderDetails tempOrderDetails = new COrderDetails(); int tempResult = FindExistingItem(tempDataGridView, temp2DataRowArray[0]["cat3_name"].ToString()); if (tempResult != -1) { //update Order_details table int tempRowIndex = tempResult; int qty = int.Parse(tempDataGridView.Rows[tempRowIndex].Cells[1].Value.ToString()) + m_iSavedOrderedQty; tempDataGridView.Rows[tempRowIndex].Cells[1].Value = qty; tempDataGridView.Rows[tempRowIndex].Cells[3].Value = ((double)(Double.Parse(tableTypePrice) * qty)).ToString("F02"); tempOrderDetails.OrderDetailsID = Int64.Parse(tempDataGridView.Rows[tempRowIndex].Cells[7].Value.ToString()); tempOrderDetails.OrderID = orderID; tempOrderDetails.ProductID = tempCategory3Button.CategoryID; tempOrderDetails.CategoryLevel = tempCategory3Button.CategoryLevel; tempOrderDetails.UnitPrice = Convert.ToDouble(tableTypePrice); tempOrderDetails.OrderQuantity = qty; tempOrderDetails.OrderAmount = tempOrderDetails.OrderQuantity * Double.Parse(tableTypePrice); tempOrderDetails.OrderFoodType = tempFoodType == 1 ? ("Food") : ("Nonfood"); tempOrderDetails.OnlineItemSequenceNumber = Convert.ToInt64("0" + tempDataGridView.Rows[tempRowIndex].Cells[6].Value.ToString()); tempOrderDetails.PrintedQuantity = int.Parse(tempDataGridView.Rows[tempRowIndex].Cells[8].Value.ToString()); if (aCOrderInfo.VatComplementory) vatAmountRate = 0; if (vat_included) { tempOrderDetails.VatTotal = qty * vatAmountRate; tempDataGridView.Rows[tempRowIndex].Cells[2].Value = tempOrderDetails.VatTotal; } else { tempOrderDetails.VatTotal = 0.00; } if (m_orderUserName.Replace(" ", "").ToUpper() != "Web User".Replace(" ", "").ToUpper()) { tempOrderManager.UpdateOrderDetails(tempOrderDetails); } else { tempOrderManager.UpdateOnlineOrderDetails(tempOrderDetails); } } else { //Insert into Order_details table tempOrderDetails.OrderID = orderID; tempOrderDetails.ProductID = tempCategory3Button.CategoryID; tempOrderDetails.CategoryLevel = tempCategory3Button.CategoryLevel; tempOrderDetails.UnitPrice = Convert.ToDouble(tableTypePrice); tempOrderDetails.OrderQuantity = m_iSavedOrderedQty; tempOrderDetails.OrderAmount = tempOrderDetails.OrderQuantity * Double.Parse(tableTypePrice); tempOrderDetails.OrderFoodType = tempFoodType == 1 ? ("Food") : ("Nonfood"); tempOrderDetails.ItemOrderTime = DateTime.Now.Ticks; tempOrderDetails.Product_Name = temp2DataRowArray[0]["cat3_name"].ToString(); tempOrderDetails.UOM = temp2DataRowArray[0]["uom"].ToString(); tempOrderDetails.Product_Type = temp2DataRowArray[0]["productType"].ToString(); if (aCOrderInfo.VatComplementory) vatRate = vatAmountRate = 0; try { if (vat_included) { tempOrderDetails.VatTotal = 0; tempOrderDetails.VatTotal = tempOrderDetails.OrderAmount * (vatRate / 100); // tempOrderDetails.VatTotal = tempOrderDetails.OrderAmount * vatAmountRate; } else { tempOrderDetails.VatTotal = tempOrderDetails.OrderAmount * (vatRate / 100); } } catch { } try { tempOrderDetails.Amount_with_vat = tempOrderDetails.OrderAmount + tempOrderDetails.VatTotal; } catch { } string category1ID = this.GetCategory1ID(tempOrderDetails.ProductID, tempOrderDetails.CategoryLevel); Int32 cat1Order = this.GetCategory1OrderNumber(Convert.ToInt32(category1ID)); if (m_orderUserName.Replace(" ", "").ToUpper() != "Web User".Replace(" ", "").ToUpper()) { tempOrderDetails = (COrderDetails)tempOrderManager.InsertOrderDetails(tempOrderDetails).Data; string[] temp2DataGridViewRow = new string[] { temp2DataRowArray[0]["cat3_name"].ToString(), m_iSavedOrderedQty.ToString(), tempOrderDetails.VatTotal.ToString("F2"), ((double)(Double.Parse(tableTypePrice)*m_iSavedOrderedQty)).ToString("F02"), tempCategory3Button.CategoryID.ToString(), "3", temp2DataRowArray[0]["cat3_rank"].ToString(), tempOrderDetails.OrderDetailsID.ToString(),"0", tempOrderDetails.UnitPrice.ToString("F2") }; tempDataGridView.Rows.Add(temp2DataGridViewRow); } else { tempOrderDetails.ItemName = temp2DataRowArray[0]["cat3_name"].ToString(); tempOrderDetails = (COrderDetails)tempOrderManager.InsertOnlineOrderDetails(tempOrderDetails).Data; string[] temp2DataGridViewRow = new string[] {temp2DataRowArray[0]["cat3_name"].ToString(), m_iSavedOrderedQty.ToString(), tempOrderDetails.VatTotal.ToString(), ((double)(Double.Parse(tableTypePrice)*m_iSavedOrderedQty)).ToString("F02"), tempCategory3Button.CategoryID.ToString(), "3", tempOrderDetails.OnlineItemSequenceNumber.ToString(),//For online order sequence number is category rank. tempOrderDetails.OrderDetailsID.ToString(),"0", //0 For first time. tempOrderDetails.UnitPrice.ToString("F2") }; tempDataGridView.Rows.Add(temp2DataGridViewRow); } } if (m_orderUserName.Replace(" ", "").ToUpper() != "Web User".Replace(" ", "").ToUpper()) { this.ConvertRank(); } tempDataGridView.Sort(tempDataGridView.Columns[5], ListSortDirection.Ascending); try { tempDataGridView.Update(); } catch { } TotalAmountCalculation(); } } g_FoodDataGridView.ClearSelection(); g_BeverageDataGridView.ClearSelection(); m_iSavedOrderedQty = 1; keyboardForm.Hide(); this.SetPrintedItemBackColor(); }
//private void btnPLU_Click(object sender, EventArgs e) //{ // int priceTakeType; // Int32 productPLU = 0; // int returnVal = 0; // Int32 productQuantity = 0; // COrderManager objOrderManager = new COrderManager(); // if (m_iType == m_cCommonConstants.TableType) // { // priceTakeType = 1; // } // else if (m_iType == m_cCommonConstants.TakeAwayType) // { // priceTakeType = 2; // } // else // { // priceTakeType = 3; // } // CCalculatorForm tableNumberForm = new CCalculatorForm("Product PLU Information", "PLU of the Product"); // 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; // } // productPLU = Convert.ToInt32("0" + CCalculatorForm.inputResult); // CResult objProductName = objOrderManager.GetProductByProductPLU(productPLU); // if (Convert.ToString(objProductName.Data) == "NO") // { // CMessageBox tempMessageBox = new CMessageBox("Error", "Invalid PLU.Please enter valid PLU"); // tempMessageBox.ShowDialog(); // return; // } // ProductQuantityForm quantityForm = new ProductQuantityForm(Convert.ToString(objProductName.Data)); // quantityForm.ShowDialog(); // if (ProductQuantityForm.m_productQuantity.Equals("Cancel")) // { // return; // } // if (ProductQuantityForm.m_productQuantity.Equals("") || Int32.Parse(ProductQuantityForm.m_productQuantity) == 0) // { // CMessageBox tempMessageBox = new CMessageBox("Error", "Input invalid!"); // tempMessageBox.ShowDialog(); // return; // } // productQuantity = Convert.ToInt32("0" + ProductQuantityForm.m_productQuantity); // CResult oResult = objOrderManager.GetPluDataByProductPLU(productPLU, priceTakeType, orderID, productQuantity); // if (oResult.IsSuccess && oResult.Data != null) // { // returnVal = int.Parse(oResult.Data.ToString()); // //for vat includr option // String queryStr = SqlQueries.GetQuery(Query.LastPLUOrderDetails); // CDalConfig oTempDal = ConfigManager.GetConfig<CDalConfig>(); // String tempConnStr = oTempDal.ConnectionString; // // Create a new data adapter based on the specified query. // SqlDataAdapter dataAdapter = new SqlDataAdapter(queryStr, tempConnStr); // // Populate a new data table and bind it to the BindingSource. // DataTable table = new DataTable(); // //table.Locale = System.Globalization.CultureInfo.InvariantCulture; // dataAdapter.Fill(table); // int CategoryID = Convert.ToInt32(table.Rows[0]["product_id"].ToString()); // Double amount = Convert.ToDouble(table.Rows[0]["amount"].ToString()); // int catLavel=Convert.ToInt32(table.Rows[0]["cat_level"].ToString()); // //vat in cat Three // double vatRate = 0; // bool vat_included = false; // double vatAmountRate = 0; // if(catLavel==3) // { // DataRow[] temp2DataRowArray = Program.initDataSet.Tables["Category3"].Select("cat3_id = " + CategoryID.ToString()); // vatRate = 0; // vat_included = false; // vatAmountRate = 0; // try // { // vatRate = Convert.ToDouble(temp2DataRowArray[0]["vat_Rate"].ToString()); // vat_included = Convert.ToBoolean(temp2DataRowArray[0]["vat_included"].ToString()); // if (vat_included) // { // vatAmountRate = (amount * vatRate) / 100; // // tableTypePrice = (Double.Parse(tableTypePrice) - vatAmountRate).ToString(); // // tableTypePrice = Convert.ToDouble(tableTypePrice).ToString(); // } // else // { // vatAmountRate = 0.00; // } // } // catch (Exception ex) { } // } // if(catLavel==4) // { // DataRow[] temp3DataRowArray = Program.initDataSet.Tables["Category4"].Select("cat4_id = " + CategoryID); // vatRate = 0; // vat_included = false; // vatAmountRate = 0; // try // { // vatRate = Convert.ToDouble(temp3DataRowArray[0]["vat_Rate"].ToString()); // vat_included = Convert.ToBoolean(temp3DataRowArray[0]["vat_included"].ToString()); // if (vat_included) // { // vatAmountRate = (amount * vatRate) / 100; // // tableTypePrice = (Double.Parse(tableTypePrice) - vatAmountRate).ToString(); // // tableTypePrice = Convert.ToDouble(tableTypePrice).ToString(); // } // else // { // vatAmountRate = 0.00; // } // } // catch (Exception ex) { } // } // //string tableTypePrice = string.Empty; // //if (m_iType == m_cCommonConstants.TableType) // //{ // // tableTypePrice = temp2DataRowArray[0]["table_price"].ToString(); // //} // //else if (m_iType == m_cCommonConstants.TakeAwayType) // //{ // // tableTypePrice = temp2DataRowArray[0]["tw_price"].ToString(); // //} // COrderManager tempOrderManager = new COrderManager(); // COrderDetails tempOrderDetails = new COrderDetails(); // if (returnVal == 1) // { // //update Order_details table // //int tempRowIndex = tempResult; // //int qty = int.Parse(tempDataGridView.Rows[tempRowIndex].Cells[1].Value.ToString()) + m_iSavedOrderedQty; // //tempDataGridView.Rows[tempRowIndex].Cells[1].Value = qty; // //tempDataGridView.Rows[tempRowIndex].Cells[2].Value = ((double)(Double.Parse(tableTypePrice) * qty)).ToString("F02"); // tempOrderDetails.OrderDetailsID = Convert.ToInt32(table.Rows[0]["order_detail_id"].ToString()); // tempOrderDetails.OrderID =Convert.ToInt32(table.Rows[0]["order_id"].ToString()); // tempOrderDetails.ProductID =Convert.ToInt32( table.Rows[0]["product_id"].ToString()); // tempOrderDetails.CategoryLevel = Convert.ToInt32(table.Rows[0]["cat_level"].ToString()); // tempOrderDetails.UnitPrice = 0.00; // tempOrderDetails.OrderQuantity = Convert.ToInt32(table.Rows[0]["quantity"].ToString()); // tempOrderDetails.OrderAmount = Convert.ToDouble(table.Rows[0]["amount"].ToString()); // tempOrderDetails.OrderFoodType = table.Rows[0]["food_type"].ToString(); // // tempOrderDetails.OnlineItemSequenceNumber = Convert.ToInt64("0" + tempDataGridView.Rows[tempRowIndex].Cells[5].Value.ToString()); // // tempOrderDetails.PrintedQuantity = int.Parse(tempDataGridView.Rows[tempRowIndex].Cells[7].Value.ToString()); // if (vat_included) // { // tempOrderDetails.VatTotal = vatAmountRate; // } // else // { // tempOrderDetails.VatTotal = 0.00; // } // //if (m_orderUserName.Replace(" ", "").ToUpper() != "Web User".Replace(" ", "").ToUpper()) // //{ // // tempOrderManager.UpdateOrderDetails(tempOrderDetails); // //} // //else // //{ // // tempOrderManager.UpdateOnlineOrderDetails(tempOrderDetails); // //} // try // { // tempOrderManager.UpdateOrderDetails(tempOrderDetails); // } // catch { } // } // //tempOrderDetails.VatTotal = vatAmountRate; // //tempOrderDetails.OrderDetailsID =Convert.ToInt32(table.Rows[0]["order_detail_id"].ToString()); // //try // //{ // //tempOrderManager.UpdateOrderDetails(tempOrderDetails); // //} // //catch { } // } // if (returnVal == 0) // { // MessageBox.Show("Please enter valid plu product", RMSGlobal.MessageBoxTitle, // MessageBoxButtons.OK, MessageBoxIcon.Information); // } // else // { // COrderDetailsDAO orderDetailsDao = new COrderDetailsDAO(); // orderDetailsDao.UpdateOrderDetailsPricebyPLUProductTablePrice(productPLU, orderID, priceTakeType); // } // this.LoadOrderDetails(); // btnPLU_Click(sender, e); //} private void btnPLU_Click(object sender, EventArgs e) { int priceTakeType; Int32 productPLU = 0; int returnVal = 0; Int32 productQuantity = 0; COrderManager objOrderManager = new COrderManager(); if (m_iType == m_cCommonConstants.TableType) { priceTakeType = 1; } else if (m_iType == m_cCommonConstants.TakeAwayType) { priceTakeType = 2; } else { priceTakeType = 3; } CCalculatorForm tableNumberForm = new CCalculatorForm("Product PLU Information", "PLU of the Product"); 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; } productPLU = Convert.ToInt32("0" + CCalculatorForm.inputResult); // Add for find updating order_detail int id = productPLU; long order = orderID; COrderDetailsDAO aDao = new COrderDetailsDAO(); List<COrderDetails> aList = aDao.OrderDetailsGetAll(); // CResult objProductName = objOrderManager.GetProductByProductPLU(productPLU, priceTakeType); CResult objProductName = objOrderManager.GetProductByProductPLU(productPLU); var check = (from orderdetail in aList where (orderdetail.OrderID == orderID && orderdetail.ProductID == objProductName.Productid) select orderdetail); if (Convert.ToString(objProductName.Data) == "NO") { CMessageBox tempMessageBox = new CMessageBox("Error", "Invalid PLU.Please enter valid PLU"); tempMessageBox.ShowDialog(); return; } ProductQuantityForm quantityForm = new ProductQuantityForm(Convert.ToString(objProductName.Data)); quantityForm.ShowDialog(); if (ProductQuantityForm.m_productQuantity.Equals("Cancel")) { return; } if (ProductQuantityForm.m_productQuantity.Equals("") || Int32.Parse(ProductQuantityForm.m_productQuantity) == 0) { CMessageBox tempMessageBox = new CMessageBox("Error", "Input invalid!"); tempMessageBox.ShowDialog(); return; } productQuantity = Convert.ToInt32("0" + ProductQuantityForm.m_productQuantity); // Add for updating order_detail when orderwith same product if (check.Count() == 1) { COrderDetails aOrderDetails = new COrderDetails(); aOrderDetails = check.Single(); //double vat = aOrderDetails.Amount_with_vat - aOrderDetails.OrderAmount; //vat = (vat * 100) / aOrderDetails.OrderAmount; productQuantity += aOrderDetails.OrderQuantity; aOrderDetails.OrderQuantity = productQuantity; aOrderDetails.OrderAmount = aOrderDetails.UnitPrice * productQuantity; aOrderDetails.PrintedQuantity = aOrderDetails.PrintedQuantity; aOrderDetails.VatTotal = (objProductName.VateRate * aOrderDetails.OrderAmount) / 100.0; aOrderDetails.Amount_with_vat = aOrderDetails.OrderAmount + aOrderDetails.VatTotal; COrderDetailsDAO aCOrderDetailsDao = new COrderDetailsDAO(); aCOrderDetailsDao.OrderDetailsUpdate(aOrderDetails); //COrderDetailsDAO orderDetailsDao = new COrderDetailsDAO(); //orderDetailsDao.UpdateOrderDetailsPricebyPLUProductTablePrice(productPLU, orderID, priceTakeType); } if (check.Count() == 0) { CResult oResult = objOrderManager.GetPluDataByProductPLU(productPLU, priceTakeType, orderID, productQuantity); if (oResult.IsSuccess && oResult.Data != null) { returnVal = int.Parse(oResult.Data.ToString()); //for vat includr option String queryStr = SqlQueries.GetQuery(Query.LastPLUOrderDetails); CDalConfig oTempDal = ConfigManager.GetConfig<CDalConfig>(); String tempConnStr = oTempDal.ConnectionString; // Create a new data adapter based on the specified query. SqlDataAdapter dataAdapter = new SqlDataAdapter(queryStr, tempConnStr); // Populate a new data table and bind it to the BindingSource. DataTable table = new DataTable(); //table.Locale = System.Globalization.CultureInfo.InvariantCulture; dataAdapter.Fill(table); int CategoryID = Convert.ToInt32(table.Rows[0]["product_id"].ToString()); Double amount = Convert.ToDouble(table.Rows[0]["amount"].ToString()); int catLavel = Convert.ToInt32(table.Rows[0]["cat_level"].ToString()); //vat in cat Three double vatRate = 0; bool vat_included = false; double vatAmountRate = 0; if (catLavel == 3) { DataRow[] temp2DataRowArray = Program.initDataSet.Tables["Category3"].Select("cat3_id = " + CategoryID.ToString()); vatRate = 0; vat_included = false; vatAmountRate = 0; try { vatRate = Convert.ToDouble(temp2DataRowArray[0]["vat_Rate"].ToString()); vat_included = Convert.ToBoolean(temp2DataRowArray[0]["vat_included"].ToString()); if (vat_included) { vatAmountRate = (amount * vatRate) / 100; // tableTypePrice = (Double.Parse(tableTypePrice) - vatAmountRate).ToString(); // tableTypePrice = Convert.ToDouble(tableTypePrice).ToString(); } else { vatAmountRate = 0.00; } } catch (Exception ex) { } } if (catLavel == 4) { DataRow[] temp3DataRowArray = Program.initDataSet.Tables["Category4"].Select("cat4_id = " + CategoryID); vatRate = 0; vat_included = false; vatAmountRate = 0; try { vatRate = Convert.ToDouble(temp3DataRowArray[0]["vat_Rate"].ToString()); vat_included = Convert.ToBoolean(temp3DataRowArray[0]["vat_included"].ToString()); if (vat_included) { vatAmountRate = (amount * vatRate) / 100; // tableTypePrice = (Double.Parse(tableTypePrice) - vatAmountRate).ToString(); // tableTypePrice = Convert.ToDouble(tableTypePrice).ToString(); } else { vatAmountRate = 0.00; } } catch (Exception ex) { } } //string tableTypePrice = string.Empty; //if (m_iType == m_cCommonConstants.TableType) //{ // tableTypePrice = temp2DataRowArray[0]["table_price"].ToString(); //} //else if (m_iType == m_cCommonConstants.TakeAwayType) //{ // tableTypePrice = temp2DataRowArray[0]["tw_price"].ToString(); //} COrderManager tempOrderManager = new COrderManager(); COrderDetails tempOrderDetails = new COrderDetails(); if (returnVal == 1) { //update Order_details table //int tempRowIndex = tempResult; //int qty = int.Parse(tempDataGridView.Rows[tempRowIndex].Cells[1].Value.ToString()) + m_iSavedOrderedQty; //tempDataGridView.Rows[tempRowIndex].Cells[1].Value = qty; //tempDataGridView.Rows[tempRowIndex].Cells[2].Value = ((double)(Double.Parse(tableTypePrice) * qty)).ToString("F02"); tempOrderDetails.OrderDetailsID = Convert.ToInt32(table.Rows[0]["order_detail_id"].ToString()); tempOrderDetails.OrderID = Convert.ToInt32(table.Rows[0]["order_id"].ToString()); tempOrderDetails.ProductID = Convert.ToInt32(table.Rows[0]["product_id"].ToString()); tempOrderDetails.CategoryLevel = Convert.ToInt32(table.Rows[0]["cat_level"].ToString()); tempOrderDetails.UnitPrice = 0.00; tempOrderDetails.OrderQuantity = Convert.ToInt32(table.Rows[0]["quantity"].ToString()); tempOrderDetails.OrderAmount = Convert.ToDouble(table.Rows[0]["amount"].ToString()); tempOrderDetails.OrderFoodType = table.Rows[0]["food_type"].ToString(); // tempOrderDetails.OnlineItemSequenceNumber = Convert.ToInt64("0" + tempDataGridView.Rows[tempRowIndex].Cells[5].Value.ToString()); // tempOrderDetails.PrintedQuantity = int.Parse(tempDataGridView.Rows[tempRowIndex].Cells[7].Value.ToString()); if (vat_included) { tempOrderDetails.VatTotal = vatAmountRate; } else { tempOrderDetails.VatTotal = 0.00; } //if (m_orderUserName.Replace(" ", "").ToUpper() != "Web User".Replace(" ", "").ToUpper()) //{ // tempOrderManager.UpdateOrderDetails(tempOrderDetails); //} //else //{ // tempOrderManager.UpdateOnlineOrderDetails(tempOrderDetails); //} try { tempOrderDetails.Amount_with_vat = tempOrderDetails.OrderAmount + tempOrderDetails.VatTotal; tempOrderManager.UpdateOrderDetails(tempOrderDetails); } catch { } } //tempOrderDetails.VatTotal = vatAmountRate; //tempOrderDetails.OrderDetailsID =Convert.ToInt32(table.Rows[0]["order_detail_id"].ToString()); //try //{ //tempOrderManager.UpdateOrderDetails(tempOrderDetails); //} //catch { } } if (returnVal == 0) { MessageBox.Show("Please enter valid plu product", RMSGlobal.MessageBoxTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); } else { COrderDetailsDAO orderDetailsDao = new COrderDetailsDAO(); orderDetailsDao.UpdateOrderDetailsPricebyPLUProductTablePrice(productPLU, orderID, priceTakeType); } } this.LoadOrderDetails(); btnPLU_Click(sender, e); }
private void g_QuantityButton_Click(object sender, EventArgs e) { try { CCalculatorForm tempCalculatorForm = new CCalculatorForm("Order Quantity", "Item Quantity"); tempCalculatorForm.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; } int tempOrderedQty = Int32.Parse(CCalculatorForm.inputResult); m_iSavedOrderedQty = tempOrderedQty; } catch (Exception exp) { MessageBox.Show(exp.Message, RMSGlobal.MessageBoxTitle, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnEditOrder_Click(object sender, EventArgs e) { if (m_customerID < 1) //If table type order is considered. { COrderManager tempOrderManager = new COrderManager(); CKeyBoardForm tempKeyBoardForm = new CKeyBoardForm("Change Table Name", "Please Enter the Name of the Table"); tempKeyBoardForm.ShowDialog(); if (CKeyBoardForm.Content.Equals("Cancel")) //If cancelled then exit. { return; } CCalculatorForm tempCalculatorForm = new CCalculatorForm("Guest Quantity Information", "Guest Quantity"); tempCalculatorForm.ShowDialog(); COrderInfo tempOrderInfo = (COrderInfo)tempOrderManager.OrderInfoByOrderID(orderID).Data; if (!CKeyBoardForm.Content.Equals("") && !CKeyBoardForm.Content.Equals("Cancel")) { tempOrderInfo.TableName = CKeyBoardForm.Content; } if (!CCalculatorForm.inputResult.Equals("") && !CCalculatorForm.inputResult.Equals("Cancel") && !(Int32.Parse(CCalculatorForm.inputResult) == 0)) tempOrderInfo.GuestCount = Convert.ToInt32(CCalculatorForm.inputResult); tempOrderManager.UpdateOrderInfo(tempOrderInfo); } }
private void g_MiscButton_Click(object sender, EventArgs e) { try { CKeyBoardForm tempKeyBoardForm = new CKeyBoardForm("Misc Item", "Enter Item Name or Description", true); tempKeyBoardForm.ShowDialog(); if (CKeyBoardForm.Content.Equals("Cancel")) return; if (CKeyBoardForm.Content.Equals("")) { CMessageBox tempMessageBox = new CMessageBox("Error!", "Item Name cannot be Empty"); tempMessageBox.ShowDialog(); return; } CPriceCalculatorForm tempCalculatorForm = new CPriceCalculatorForm("Misc Item", "Enter Price"); tempCalculatorForm.ShowDialog(); if (CPriceCalculatorForm.inputResult.Equals("Cancel")) return; if (CPriceCalculatorForm.inputResult.Equals("0.000")) { CMessageBox tempMessageBox = new CMessageBox("Error!", "Price cannot be zero."); tempMessageBox.ShowDialog(); return; } double price = Double.Parse(CPriceCalculatorForm.inputResult); //change by mithu CPriceCalculatorForm tempCalculatorForm1 = new CPriceCalculatorForm("Misc Item", "Enter vat"); tempCalculatorForm1.ShowDialog(); if (CPriceCalculatorForm.inputResult.Equals("Cancel")) return; if (CPriceCalculatorForm.inputResult.Equals("0.000")) { CMessageBox tempMessageBox = new CMessageBox("Error!", "Vat cannot be zero."); tempMessageBox.ShowDialog(); return; } double addmisvat=Double.Parse(CPriceCalculatorForm.inputResult); try { CCalculatorForm tempQtyCalculatorForm = new CCalculatorForm("Order Quantity", "Item Quantity"); tempQtyCalculatorForm.ShowDialog(); if (CCalculatorForm.inputResult.Equals("Cancel")) return; string str = CCalculatorForm.inputResult; str = (str == "") ? "1" : str; if (Int32.Parse(str) == 0) { CMessageBox tempMessageBox = new CMessageBox("Error", "Input invalid!"); tempMessageBox.ShowDialog(); return; } int tempOrderedQty = Int32.Parse(str); m_iSavedOrderedQty = tempOrderedQty; } catch (Exception exp) { MessageBox.Show(exp.Message, RMSGlobal.MessageBoxTitle, MessageBoxButtons.OK, MessageBoxIcon.Error); } COrderManager tempOrderManager = new COrderManager(); COrderDetails tempOrderDetails = new COrderDetails(); DataGridView tempDataGridView = null; if (CKeyBoardForm.m_foodType == true) //If miscelleneous item is food { tempDataGridView = g_FoodDataGridView; } else { tempDataGridView = g_BeverageDataGridView; } int tempResult = FindExistingItem(tempDataGridView, CKeyBoardForm.Content); if (tempResult != -1) { //update Order_details table int tempRowIndex = tempResult; tempDataGridView.Rows[tempRowIndex].Cells[1].Value = int.Parse(tempDataGridView.Rows[tempRowIndex].Cells[1].Value.ToString()) + m_iSavedOrderedQty; tempOrderDetails.OrderDetailsID = Int64.Parse(tempDataGridView.Rows[tempRowIndex].Cells[7].Value.ToString()); tempOrderDetails.OrderID = orderID; tempOrderDetails.ProductID = 0; tempOrderDetails.CategoryLevel = 0; tempOrderDetails.OrderRemarks = CKeyBoardForm.Content; tempOrderDetails.Product_Name = CKeyBoardForm.Content; tempOrderDetails.OrderQuantity = Int32.Parse(tempDataGridView.Rows[tempRowIndex].Cells[1].Value.ToString()); tempOrderDetails.OrderAmount = tempOrderDetails.OrderQuantity*price; tempOrderDetails.VatTotal = (addmisvat*tempOrderDetails.OrderAmount)/100.0; tempOrderDetails.Amount_with_vat = tempOrderDetails.OrderAmount + tempOrderDetails.VatTotal; tempOrderDetails.OrderFoodType = "Food"; tempOrderDetails.ItemOrderTime = DateTime.Now.Ticks; tempDataGridView.Rows[tempRowIndex].Cells[2].Value = tempOrderDetails.VatTotal.ToString("F02"); tempDataGridView.Rows[tempRowIndex].Cells[3].Value = tempOrderDetails.OrderAmount.ToString("F02"); tempOrderManager.UpdateOrderDetails(tempOrderDetails); } else { //Insert into Order_details table tempOrderDetails.OrderID = orderID; tempOrderDetails.ProductID = 0; tempOrderDetails.CategoryLevel = 0; tempOrderDetails.OrderRemarks = CKeyBoardForm.Content; tempOrderDetails.Product_Name = CKeyBoardForm.Content; tempOrderDetails.OrderQuantity = m_iSavedOrderedQty; tempOrderDetails.ItemOrderTime = DateTime.Now.Ticks; tempOrderDetails.OrderAmount = tempOrderDetails.OrderQuantity*price; tempOrderDetails.VatTotal = (addmisvat * tempOrderDetails.OrderAmount) / 100.0; tempOrderDetails.Amount_with_vat = tempOrderDetails.OrderAmount + tempOrderDetails.VatTotal; if (CKeyBoardForm.m_foodType == true) { tempOrderDetails.OrderFoodType = "Food"; } else { tempOrderDetails.OrderFoodType = "Nonfood"; } if (m_orderUserName.Replace(" ", "").ToUpper() != "Web User".Replace(" ", "").ToUpper()) { tempOrderDetails = (COrderDetails)tempOrderManager.InsertOrderDetails(tempOrderDetails).Data; string[] tempDataGridViewRow = new string[] { CKeyBoardForm.Content, m_iSavedOrderedQty.ToString(), tempOrderDetails.VatTotal.ToString("F02"), tempOrderDetails.OrderAmount.ToString("F02"), "0", "0", Int64.MaxValue-1+"", tempOrderDetails.OrderDetailsID.ToString(),"0" //0 for printed item quantity }; tempDataGridView.Rows.Add(tempDataGridViewRow); } else { tempOrderDetails.ItemName = CKeyBoardForm.Content; tempOrderDetails = (COrderDetails)tempOrderManager.InsertOnlineOrderDetails(tempOrderDetails).Data; string[] tempDataGridViewRow = new string[] { CKeyBoardForm.Content, m_iSavedOrderedQty.ToString(), tempOrderDetails.VatTotal.ToString("F02"), tempOrderDetails.OrderAmount.ToString("F02"), "0", "0", tempOrderDetails.OnlineItemSequenceNumber.ToString(), tempOrderDetails.OrderDetailsID.ToString(),"0" //0 for printed item quantity }; tempDataGridView.Rows.Add(tempDataGridViewRow); } } if (m_orderUserName.Replace(" ", "").ToUpper() != "Web User".Replace(" ", "").ToUpper()) //Rank is applicable only for local order only { this.ConvertRank(); } tempDataGridView.Sort(tempDataGridView.Columns[5], ListSortDirection.Ascending); tempDataGridView.Update(); TotalAmountCalculation(); m_iSavedOrderedQty = 1; g_FoodDataGridView.ClearSelection(); g_BeverageDataGridView.ClearSelection(); } catch (Exception exp) { Console.Write(exp.Message); } }
private void TableIcon_MouseClick(object sender, EventArgs e) { try { COrderManager tempOrderManager = new COrderManager(); LobbyItemButton tempTableIcon = (LobbyItemButton)sender; CCommonConstants tempCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); if (tempTableIcon.Type.Equals("Table") || tempTableIcon.Type.Equals("Tabs")) { if (m_bTableInfoClicked) { CTableInfoMessageBox tempTableInfoMessageBox = new CTableInfoMessageBox(tempTableIcon.OrderID); tempTableInfoMessageBox.Show(); m_bTableInfoClicked = false; return; } else if (m_bNameTableClicked) { CKeyBoardForm tempKeyBoardForm = new CKeyBoardForm("Table Naming", "Please Enter the Name of the Table"); tempKeyBoardForm.ShowDialog(); if (CKeyBoardForm.Content.Equals("Cancel") || CKeyBoardForm.Content.Equals("")) return; COrderInfo tempOrderInfo = (COrderInfo)tempOrderManager.OrderInfoByOrderID(tempTableIcon.OrderID).Data; tempOrderInfo.TableName = CKeyBoardForm.Content; tempOrderManager.UpdateOrderInfo(tempOrderInfo); tempTableIcon.TableName = CKeyBoardForm.Content; m_bNameTableClicked = false; TablePanel.Controls.Clear(); this.Init(); return; } else if (m_bChangeDetailsClicked) { CKeyBoardForm tempKeyBoardForm = new CKeyBoardForm("Change Details", "Please Enter the Name of the Table"); tempKeyBoardForm.ShowDialog(); if (CKeyBoardForm.Content.Equals("Cancel")) //If cancelled then exit. { return; } CCalculatorForm tempCalculatorForm = new CCalculatorForm("Change Details", "Guest Quantity"); tempCalculatorForm.ShowDialog(); COrderInfo tempOrderInfo = (COrderInfo)tempOrderManager.OrderInfoByOrderID(tempTableIcon.OrderID).Data; if (!CKeyBoardForm.Content.Equals("") && !CKeyBoardForm.Content.Equals("Cancel")) { tempOrderInfo.TableName = CKeyBoardForm.Content; } if(!CCalculatorForm.inputResult.Equals("") && !CCalculatorForm.inputResult.Equals("Cancel") && !(Int32.Parse(CCalculatorForm.inputResult)==0)) tempOrderInfo.GuestCount = Convert.ToInt32(CCalculatorForm.inputResult); tempOrderManager.UpdateOrderInfo(tempOrderInfo); m_bChangeDetailsClicked = false; TablePanel.Controls.Clear(); Init(); return; } } CTableInfo tempTableInfo = new CTableInfo(); tempTableInfo = (CTableInfo)tempOrderManager.GetTableInfoByTableNumber(tempTableIcon.TableNumber, tempTableIcon.Type).Data; if (tempTableInfo!=null && tempTableInfo.Status == 1) { CMessageBox tempMessageBox = new CMessageBox("Table Information", "Someone else is using this table at this moment."); tempMessageBox.ShowDialog(); return; } tempTableInfo.TableNumber = tempTableIcon.TableNumber; tempTableInfo.TableType = tempTableIcon.Type; tempTableInfo.Status = 1; tempOrderManager.UpdateTableInfo(tempTableInfo); if (tempTableIcon.Type.Equals("Table")) { CTableOrderForm tempTableOrderForm = new CTableOrderForm(tempTableIcon.OrderID, tempCommonConstants.TableType, tempTableIcon.TableNumber); tempTableOrderForm.m_TerminalName = TerminalIDLabel.Text; tempTableOrderForm.m_orderUserName = tempTableIcon.User; tempTableOrderForm.Show(); } else if (tempTableIcon.Type.Equals("Tabs")) { CBarServiceForm tempBarServiceForm = new CBarServiceForm(tempTableIcon.OrderID, tempCommonConstants.TabsType, tempTableIcon.TableNumber); tempBarServiceForm.Show(); } else if (tempTableIcon.Type.Equals("TakeAway")) { CTableOrderForm tempTableOrderForm = new CTableOrderForm(tempTableIcon.OrderID, tempCommonConstants.TakeAwayType, tempTableIcon.TableNumber); //tempTableOrderForm.m_TerminalName = TerminalIDLabel.Text; tempTableOrderForm.m_orderUserName = tempTableIcon.User; tempTableOrderForm.Show(); } CFormManager.Forms.Push(this); this.Hide(); } catch (Exception ee) { MessageBox.Show(ee.ToString()); } }
private void TableNoTextBox_Click(object sender, EventArgs e) { ReferenceTextBox.Clear(); ReferenceCheckBox.Checked = false; PriceTextBox.Clear(); PriceCheckBox.Checked = false; TableNoTextBox.Clear(); checkBox2.Checked = false; CCalculatorForm tempCalculatorForm = new CCalculatorForm("Table No for Search", "Enter a Table No"); tempCalculatorForm.BackColor = Color.LightGray; tempCalculatorForm.InputNameLabel.ForeColor = Color.Black; tempCalculatorForm.InputTextBox.BackColor = Color.LightGray; tempCalculatorForm.InputTextBox.ForeColor = Color.Black; tempCalculatorForm.ShowDialog(); if (CCalculatorForm.inputResult.Equals("Cancel")) { TableNoTextBox.Text = ""; } else { TableNoTextBox.Text = CCalculatorForm.inputResult; } }
private void g_QuantityButton_Click(object sender, EventArgs e) { CCalculatorForm tempCalculatorForm = new CCalculatorForm("Order Quantity", "Item Quantity"); tempCalculatorForm.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; } int tempOrderedQty = Int32.Parse(CCalculatorForm.inputResult); m_iSavedOrderedQty = tempOrderedQty; }
private void g_PrintTokenButton_Click(object sender, EventArgs e) { try { CPrintMethods tempPrintMethods = new CPrintMethods(); CKeyBoardForm tempKeyboardForm = new CKeyBoardForm("Bar Token Information", "Enter Customer Name"); tempKeyboardForm.ShowDialog(); if (CKeyBoardForm.Content.Equals("Cancel")) return; CCalculatorForm tempCalculatorForm = new CCalculatorForm("Bar Token Information", "Enter Number of Guest"); tempCalculatorForm.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; } } catch (Exception eee) { } }
private void g_OpenTabsButton_Click(object sender, EventArgs e) { try { COrderManager tempOrderManager = new COrderManager(); List<COrderShow> tempOrderShowList = (List<COrderShow>)tempOrderManager.OrderListShowByStatus("Paid").Data; CKeyBoardForm tempKeyboardForm = new CKeyBoardForm("Tabs Information", "Enter Customer Name"); tempKeyboardForm.ShowDialog(); if (CKeyBoardForm.Content.Equals("Cancel") || CKeyBoardForm.Content.Equals("")) return; string tabsName = CKeyBoardForm.Content; CCalculatorForm tableGuestForm = new CCalculatorForm("Tabs 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; NewOrder(); CResult oResult=tempOrderManager.OrderInfoByOrderID(orderID); COrderInfo tempOrderInfo = new COrderInfo(); if (oResult.IsSuccess && oResult.Data != null) { tempOrderInfo = (COrderInfo)oResult.Data; } tempOrderInfo.GuestCount = int.Parse(tableGuest); tempOrderInfo.TableName = tabsName; tempOrderManager.UpdateOrderInfo(tempOrderInfo); } catch (Exception eee) { } }
private void g_ConvertButton_Click(object sender, EventArgs e) { try { COrderManager tempOrderManager = new COrderManager(); CResult oResult = tempOrderManager.OrderListShowByStatus("Paid"); List<COrderShow> tempOrderShowList= new List<COrderShow>(); if (oResult.IsSuccess && oResult.Data != null) { tempOrderShowList = (List<COrderShow>)oResult.Data; } CCalculatorForm tableNumberForm = new CCalculatorForm("Table Information", "Table Number"); tableNumberForm.ShowDialog(); string tableNumber = ""; 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; } tableNumber = CCalculatorForm.inputResult; //check whether table already exists bool found = false; for (int orderCounter = 0; orderCounter < tempOrderShowList.Count; orderCounter++) { if (int.Parse(tableNumber) == tempOrderShowList[orderCounter].TableNumber && tempOrderShowList[orderCounter].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; //update order info table COrderInfo tempOrderInfo = new COrderInfo(); oResult = tempOrderManager.OrderInfoByOrderID(orderID); if (oResult.IsSuccess && oResult.Data != null) { tempOrderInfo = (COrderInfo)oResult.Data; } //delete previous tab number from table info if(tempOrderInfo.TableNumber!=0) tempOrderManager.DeleteTableInfo(tempOrderInfo.TableNumber, "Tabs"); //update order info tempOrderInfo.GuestCount = int.Parse(tableGuest); tempOrderInfo.Status = "Seated"; tempOrderInfo.OrderType = "Table"; tempOrderInfo.TableNumber = int.Parse(tableNumber); tempOrderInfo.TableName = ""; tempOrderManager.UpdateOrderInfo(tempOrderInfo); //insert new table number in table info CTableInfo tempTableInfo = new CTableInfo(); tempTableInfo.TableNumber = tempOrderInfo.TableNumber; tempTableInfo.TableType = "Table"; tempOrderManager.InsertTableInfo(tempTableInfo); CMainForm tempMainForm = (CMainForm)CFormManager.Forms.Pop(); tempMainForm.Show(); this.Close(); } catch (Exception eee) { //MessageBox.Show(eee.ToString()); } }
private void g_UseDepositButton_Click(object sender, EventArgs e) { CCalculatorForm tempCalculatorForm = new CCalculatorForm("Use Deposit", "Enter Deposit Serial Number"); tempCalculatorForm.ShowDialog(); if (CCalculatorForm.inputResult.Equals("Cancel") || CCalculatorForm.inputResult.Equals("")) { return; } Int64 tempDepositSerial = Int64.Parse(CCalculatorForm.inputResult); CDepositManager tempDepositManager = new CDepositManager(); CDeposit tempDeposit = new CDeposit(); CResult oResult = tempDepositManager.DepositGetByDepositID(tempDepositSerial); if (oResult.IsSuccess && oResult.Data != null) { tempDeposit = (CDeposit)oResult.Data; if (tempDeposit.DepositID != 0) { CUseDepositForm tempUseDepositForm = new CUseDepositForm(tempDeposit); DialogResult dResult = tempUseDepositForm.ShowDialog(); if (dResult.Equals(DialogResult.Cancel)) return; else if (dResult.Equals(DialogResult.OK)) { if (CUseDepositForm.usedAmount > m_dBalance) { tempDeposit.DepositBalance = tempDeposit.DepositBalance - m_dBalance; } else { tempDeposit.DepositBalance = tempDeposit.DepositBalance - CUseDepositForm.usedAmount; } m_oDeposit = tempDeposit; if (CUseDepositForm.usedAmount > m_dBalance) { m_dTotalAmount = m_dTotalAmount - m_dBalance; } else { m_dTotalAmount = m_dTotalAmount - CUseDepositForm.usedAmount; } g_BillTotalLabel.Text = "£" + m_dTotalAmount.ToString("F02"); g_DepositUsedLabel.Text = "£" + CUseDepositForm.usedAmount.ToString("F02"); CurrentPaymentMethod = "Deposit"; UpdateCalculation(0); g_UseDepositButton.Enabled = false; } } else { CMessageBox tempMessageBox = new CMessageBox("Error", "Deposit Information not found!"); tempMessageBox.ShowDialog(); } } }
private void DepositSerialTextBox_Click(object sender, EventArgs e) { CCalculatorForm tempCalculatorForm = new CCalculatorForm("Deposit Number","Enter deposit number"); tempCalculatorForm.BackColor = Color.LightGray; tempCalculatorForm.InputNameLabel.ForeColor = Color.Black; tempCalculatorForm.InputTextBox.BackColor = Color.LightGray; tempCalculatorForm.InputTextBox.ForeColor = Color.Black; tempCalculatorForm.ShowDialog(); if (CCalculatorForm.inputResult.Equals("Cancel")) { return; } DepositSerialTextBox.Text = CCalculatorForm.inputResult; }
private void btnPLU_Click(object sender, EventArgs e) { COrderManager objOrderManager = new COrderManager(); this.NewOrder(); //////Start //PLUPopup objPLUPopup = new PLUPopup(); int priceTakeType; Int32 productPLU = 0; int returnVal = 0; Int32 productQuantity = 0; priceTakeType = -99; //objPLUPopup.ShowDialog(this); //if (PLUPopup.m_productCode == "Cancel") //{ // return; //} //productPLU = Convert.ToInt32("0" + PLUPopup.m_productCode); CCalculatorForm tableNumberForm = new CCalculatorForm("Product PLU Information", "PLU of the Product"); 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; } productPLU = Convert.ToInt32("0" + CCalculatorForm.inputResult); CResult objProductName = objOrderManager.GetProductByProductPLU(productPLU); if (Convert.ToString(objProductName.Data) == "NO") { CMessageBox tempMessageBox = new CMessageBox("Error", "Invalid PLU.Please enter valid PLU"); tempMessageBox.ShowDialog(); return; } ProductQuantityForm quantityForm = new ProductQuantityForm(Convert.ToString(objProductName.Data)); quantityForm.ShowDialog(); if (ProductQuantityForm.m_productQuantity.Equals("Cancel")) { return; } if (ProductQuantityForm.m_productQuantity.Equals("") || Int32.Parse(ProductQuantityForm.m_productQuantity) == 0) { CMessageBox tempMessageBox = new CMessageBox("Error", "Input invalid!"); tempMessageBox.ShowDialog(); return; } productQuantity = Convert.ToInt32("0" + ProductQuantityForm.m_productQuantity); CResult oResult = objOrderManager.GetPluDataByProductPLU(productPLU, priceTakeType, orderID, productQuantity); if (oResult.IsSuccess && oResult.Data != null) { returnVal = int.Parse(oResult.Data.ToString()); } if (returnVal == 0) { MessageBox.Show("Please enter valid plu product", RMSGlobal.MessageBoxTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); } ///End new this.FillNonFoods(); btnPLU_Click(sender, e); }
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); } }
public void CurrrentTableDataGridView_CellClick(object sender,DataGridViewCellEventArgs e) { try { if (CurrrentTableDataGridView.Columns[e.ColumnIndex].Name.Equals("ActionButtonColumn") && e.RowIndex >= 0 && CurrrentTableDataGridView.Rows[e.RowIndex].Cells["OrderIDColumn"].Value != null) { this.CustomerNameTextBox.Text = CurrrentTableDataGridView.Rows[e.RowIndex].Cells["CustomerNameColumn"].Value.ToString(); this.TableNumberTextBox.Text = CurrrentTableDataGridView.Rows[e.RowIndex].Cells["TableNumberColumn"].Value.ToString(); String tempOrderID = CurrrentTableDataGridView.Rows[e.RowIndex].Cells["OrderIDColumn"].Value.ToString(); int tempOldTableNumber = int.Parse(CurrrentTableDataGridView.Rows[e.RowIndex].Cells["TableNumberColumn"].Value.ToString()); int tempOldTableGuestCount = int.Parse(CurrrentTableDataGridView.Rows[e.RowIndex].Cells["GuestCountColumn"].Value.ToString()); CCalculatorForm tempCalculator = new CCalculatorForm("Transfer Table", "Enter new Table Number to Transfer"); tempCalculator.BackColor = Color.LightGray; tempCalculator.InputNameLabel.ForeColor = Color.Black; tempCalculator.InputTextBox.BackColor = Color.LightGray; tempCalculator.InputTextBox.ForeColor = Color.Black; tempCalculator.ShowDialog(); if (CCalculatorForm.inputResult.Equals("Cancel")) return; if (CCalculatorForm.inputResult.Equals("") || Int32.Parse(CCalculatorForm.inputResult) == 0) { MessageBox.Show("Input invalid.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (!CCalculatorForm.inputResult.Equals("Cancel") && !CCalculatorForm.inputResult.Equals(String.Empty)) { int tempNewTableNumber = int.Parse(CCalculatorForm.inputResult); COrderManager tempTransferTableManager = new COrderManager(); List<CTableInfo> tempAvailableTableList = new List<CTableInfo>(); tempAvailableTableList = (List<CTableInfo>)tempTransferTableManager.AvailableTableForTransfer().Data; CTableInfo[] tempAvailableTableArray = tempAvailableTableList.ToArray(); bool tempPromptAgainBool = false; CResult tempResult = new CResult(); for (int i = 0; i < tempAvailableTableArray.Length; i++) { if (tempNewTableNumber == tempAvailableTableArray[i].TableNumber) tempPromptAgainBool = true; } if (tempPromptAgainBool) { MessageBox.Show("The Table selected is already occupied.\n Please select another table.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { tempResult = tempTransferTableManager.UpdateForTransferTable(tempOrderID, tempOldTableNumber, tempNewTableNumber, tempOldTableGuestCount); if (tempResult.IsSuccess) { CurrrentTableDataGridView.Rows[e.RowIndex].Cells["TableNumberColumn"].Value = tempNewTableNumber; TableNumberTextBox.Text = tempNewTableNumber.ToString(); } } } } } catch (Exception ex) { } }
private void NewTableButton_Click(object sender, EventArgs e) { try { COrderManager tempOrderManager = new COrderManager(); List<COrderShow> tempOrderShowList = (List<COrderShow>)tempOrderManager.OrderListShowByStatus("Paid").Data; 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; if (tableNumber.Equals("")) return; bool found = false; for (int recordCounter = 0; recordCounter < tempOrderShowList.Count; recordCounter++) { if (int.Parse(tableNumber) == tempOrderShowList[recordCounter].TableNumber && tempOrderShowList[recordCounter].OrderType.Equals("Table")) found = true; } if (found) { CMessageBox tempMessageBox = new CMessageBox("Error", "Table already opened. Please select another table number."); tempMessageBox.ShowDialog(); return; } if (tableNumber.Equals("Cancel")) { return; } CCalculatorForm tableGuestForm = new CCalculatorForm("Table Information", "Covers"); 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; if (tableGuest.Equals("Cancel")) //If cancelled then exit. { return; } CCalculatorForm floorNumberForm = new CCalculatorForm("Floor Information", "Floor Number"); floorNumberForm.ShowDialog(); if (CCalculatorForm.inputResult.Equals("Cancel")) return; string floorNumber = ""; floorNumber = CCalculatorForm.inputResult; COrderInfo tempOrderInfo = new COrderInfo(); tempOrderInfo.TableNumber = int.Parse(tableNumber); //tempOrderInfo.TableName = "Table " + tableNumber; tempOrderInfo.UserID = m_oCommonConstants.UserInfo.UserID; tempOrderInfo.OrderTime = System.DateTime.Now; //needed now tempOrderInfo.OrderType = "Table"; tempOrderInfo.GuestCount = int.Parse(tableGuest); tempOrderInfo.Status = "Seated"; tempOrderInfo.FloorNo = floorNumber; //tempOrderInfo.InitialKitchenText = kitchenText; COrderManager tempOrderManager2 = new COrderManager(); tempOrderInfo = (COrderInfo)tempOrderManager2.InsertOrderInfo(tempOrderInfo).Data; COrderSeatTime tempOrderSeatTime = new COrderSeatTime(); tempOrderSeatTime.OrderID = tempOrderInfo.OrderID; tempOrderSeatTime.SeatTime = DateTime.Now; tempOrderManager2.InsertOrderSeatTime(tempOrderSeatTime); LobbyItemButton tableIcon = new LobbyItemButton(); tableIcon.OrderID = tempOrderInfo.OrderID; tableIcon.TableName = "Table " + tableNumber; tableIcon.GuestCount = tableGuest; tableIcon.User = m_oCommonConstants.UserInfo.UserName; tableIcon.SeatedTime = tempOrderSeatTime.SeatTime; // tableIcon.Icon = global::RMS.Properties.Resources.seated; tableIcon.ItemType = RMSUIConstants.ItemType.SeatedButNoOrdered; tableIcon.TableNumber = int.Parse(tableNumber); tableIcon.Click += new EventHandler(TableIcon_MouseClick); tableIconList.Add(tableIcon); CTableInfo tempTableInfo = new CTableInfo(); tempTableInfo.TableNumber = int.Parse(tableNumber); tempTableInfo.TableType = "Table"; tempTableInfo.Status = 0; tempOrderManager.InsertTableInfo(tempTableInfo); try { WaiterForm waiterForm = new WaiterForm(); waiterForm.UserList = userList; waiterForm.ShowDialog(); if (waiterForm.DialogResult == DialogResult.OK) { COrderWaiterDao orderwaiterDao = new COrderWaiterDao(); COrderwaiter orderwaiter = new COrderwaiter(); orderwaiter = orderwaiterDao.GetOrderwaiterByOrderID(tempOrderInfo.OrderID); if (orderwaiter != null && orderwaiter.ID > 0 && orderwaiter.WaiterID != waiterForm.UserInfoData.UserID) { orderwaiter.OrderID = tempOrderInfo.OrderID; orderwaiter.WaiterID = waiterForm.UserInfoData.UserID; orderwaiter.WaiterName = waiterForm.UserInfoData.UserName; orderwaiterDao.UpdateOrderwaiter(orderwaiter); } else if (orderwaiter.ID == 0) { orderwaiter.OrderID = tempOrderInfo.OrderID; orderwaiter.WaiterID = waiterForm.UserInfoData.UserID; orderwaiter.WaiterName = waiterForm.UserInfoData.UserName; orderwaiterDao.InsertOrderwaiter(orderwaiter); } } } catch (Exception ex) { } #region "OLD Code" //TablePanel.Controls.Clear(); //Init(); #endregion #region "New code added by Baruri" CTableOrderForm objOrderDetailsForm = new CTableOrderForm(tempOrderInfo.OrderID, 0, tempTableInfo.TableNumber); objOrderDetailsForm.m_orderUserName = RMSGlobal.LoginUserName; objOrderDetailsForm.Show(); CFormManager.Forms.Push(this); this.Hide(); #endregion } catch (Exception ee) { } }