public CTakeAwayForm(Int32 orderIndex) { InitializeComponent(); m_cCurrentControl = txtCustomerName; m_customerEditStatus = false; m_deliveryTime = String.Empty; m_orderType = String.Empty; m_orderIndex = orderIndex; if (orderIndex != 1) { // this.ChangeVisibility(); } if (orderIndex == 2 || orderIndex == 3) //If waiting type orders { this.GetWaitingNumber(); txtTips.Visible = true; } CUserManager tempUserManager = new CUserManager(); CResult tempResult = tempUserManager.GetAllUser(); if (tempResult.IsSuccess) { userList = new List<CUserInfo>(); userList = (List<CUserInfo>)tempResult.Data; } ScreenTitle = "Takeaway Customer Information"; m_oCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); if (m_oCommonConstants.UserInfo == null) return; }
static SqlQueries() { if (oConstants == null) { oConstants = ConfigManager.GetConfig <CCommonConstants>(); m_sDateFormat = string.Format(m_sDateFormat, oConstants.SqlQueryDateFormat); } }
private DataSet HeaderFooterDataset() { DataSet tempDataSet = new DataSet(); CCommonConstants oConstants = ConfigManager.GetConfig <CCommonConstants>(); string tempConnectionString = oConstants.DBConnection; string sSql = SqlQueries.GetQuery(Query.GetPrintStyles); SqlDataAdapter tempSqlAdapter = new SqlDataAdapter(sSql, tempConnectionString); tempSqlAdapter.Fill(tempDataSet, "PrintStyle"); return(tempDataSet); }
protected void OpenConnection() { CCommonConstants m_oDalConfig = ConfigManager.GetConfig <CCommonConstants>(); if (m_oDalConfig != null) { OpenConnection(m_oDalConfig.DBConnection); } else { throw new DAOException("Error occured while oppening database connection: DalConfig object was null."); } }
public static string CollectFooter() { CCommonConstants oConstants = ConfigManager.GetConfig <CCommonConstants>(); string tempConnectionString = oConstants.DBConnection; string sqlCommand = SqlQueries.GetQuery(Query.GetPrintStyles); SqlDataAdapter tempSqlAdapter = new SqlDataAdapter(sqlCommand, tempConnectionString); DataSet tempDataSet = new DataSet(); tempSqlAdapter.Fill(tempDataSet, "PrintStyle"); string HeaderContent = "\r\n\t" + tempDataSet.Tables["PrintStyle"].Select("style_name = 'normal'")[0]["footer"].ToString(); StringTokenizer tempStringTokenizer = new StringTokenizer(HeaderContent, "\r\n"); string footerString = tempStringTokenizer.NextToken(); return(footerString); }
private void ProcessLogin() { try { CCommonConstants objCommonConstant = ConfigManager.GetConfig <CCommonConstants>(); CDalConfig objDalConstant = ConfigManager.GetConfig <CDalConfig>(); CUserManager tempUserManager = new CUserManager(); CLogin objLogin = new CLogin(); CUserInfo objUserInfo = new CUserInfo(); //objUserInfo.UserName = UserLabel.Text.Trim(); //objUserInfo.Password = LoginTextBox.Text.Trim(); objLogin = (RmsRemote.CLogin)Activator.GetObject(typeof(RmsRemote.CLogin), objCommonConstant.RemoteURL); CResult objResult = objLogin.ProcessAdminLogin(objUserInfo); if (objResult.IsSuccess && objResult.Data != null) { CUserLogin objUserLogin = (CUserLogin)objResult.Data; objCommonConstant.UserInfo = objUserLogin.UserInfo; objDalConstant.ConnectionString = objUserLogin.ConnectionStr; RMSGlobal.LogInUserName = objCommonConstant.UserInfo.UserName; objCommonConstant.DBConnection = objUserLogin.ConnectionStr; RMSAdminMdiForm objParent = new RMSAdminMdiForm(); //Previous objParent.Show(); this.Hide(); } else { //g_ErrorLabel.Show(); } } catch (Exception exp) { MessageBox.Show(exp.Message, RMSGlobal.MessageBoxTitle, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private static void Init() { ConfigManager.Init(); ConfigManager.ReloadConfig(); CCommonConstants oTempConstant = ConfigManager.GetConfig <CCommonConstants>(); CDalConfig oTempDal = ConfigManager.GetConfig <CDalConfig>(); CLogin oLogin = new CLogin(); oLogin = (RmsRemote.CLogin)Activator.GetObject(typeof(RmsRemote.CLogin), oTempConstant.RemoteURL); CResult oResult = oLogin.GetInitialDBStr(); if (oResult.IsSuccess && oResult.Data != null) { DataSet dsRecords = new DataSet(); String oTempStr = (String)oResult.Data; oTempConstant.DBConnection = oTempStr; RMSGlobal.m_serverConnectionString = oTempConstant.DBConnection; CReportManager objReportMgnr = new CReportManager(); CResult objFoodType = objReportMgnr.GetFoodTypesRecords(); dsRecords = (DataSet)objFoodType.Data; m_foodTypeRecords = dsRecords.Tables[0]; objFoodType = objReportMgnr.GetFoodCategoryRecords(); dsRecords = (DataSet)objFoodType.Data; m_categoryRecords = dsRecords.Tables[0]; objFoodType = objReportMgnr.GetFoodItemRecords(); dsRecords = (DataSet)objFoodType.Data; m_foodItemRecords = dsRecords.Tables[0]; objFoodType = objReportMgnr.GetSelectionofItemsRecords(); dsRecords = (DataSet)objFoodType.Data; m_selectionItemRecords = dsRecords.Tables[0]; //m_initDataSet.Relations.Add("category1_to_category2", // m_foodTypeRecords.Columns["cat1_id"], // m_categoryRecords.Columns["cat1_id"], false); } }
public void PostPrintingRequest(CPrintingFormat inPrintRequest) { try { CPrintQueue.Init(); CCommonConstants oCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); m_oPrintRequest = inPrintRequest; m_mPrintMutex = oCommonConstants.PrintMutex; try { m_mPrintMutex.WaitOne(oCommonConstants.ThreadWaitTime, false); } catch (Exception ex) { } try { if (m_oPrintRequest != null && CPrintQueue.PrintQueue != null) { CPrintQueue.PrintQueue.Enqueue(m_oPrintRequest); } } catch (Exception ex) { } try { m_mPrintMutex.ReleaseMutex(); } catch (Exception ex1) { } } catch (Exception ex2) { } }
private void UpdateReceiptStyle_Load(object sender, EventArgs e) { CPrintStyle oPrint = new CPrintStyle(); CCommonConstants oConstant = ConfigManager.GetConfig <CCommonConstants>(); oPrint.StyleID = m_styleID; CUserManager oManager = new CUserManager(); CResult oResult = oManager.GetPrintStyle(oPrint); if (oResult.IsSuccess && oResult.Data != null) { oPrint = (CPrintStyle)oResult.Data; txtHeader.Text = oPrint.Header.Trim(); txtMessage.Text = oPrint.Body.Trim(); txtFooter.Text = oPrint.Footer.Trim(); } }
private void btnSave_Click(object sender, EventArgs e) { String sTempHeader = txtHeader.Text.Trim(); String sTempBody = txtMessage.Text.Trim(); String sTempFooter = txtFooter.Text.Trim(); CPrintStyle oPrint = new CPrintStyle(); oPrint.Header = sTempHeader; oPrint.Body = sTempBody; oPrint.Footer = sTempFooter; CCommonConstants oConstant = ConfigManager.GetConfig <CCommonConstants>(); oPrint.StyleID = m_styleID;// oConstant.PrintStyleID; CUserManager oManager = new CUserManager(); CResult oResult = oManager.UpdatePrintStyle(oPrint); if (oResult.IsSuccess) { lblSaveStatus.Text = " Receipt style is updated successfully."; lblSaveStatus.Visible = true; } else { lblSaveStatus.Text = " Could not update receipt style. Please try again."; lblSaveStatus.Visible = true; } }
static SqlQueries() { if (oConstants==null) { oConstants = ConfigManager.GetConfig<CCommonConstants>(); m_sDateFormat = string.Format(m_sDateFormat, oConstants.SqlQueryDateFormat); } }
private void Init() { string onlineOrders = String.Empty; try { m_bTableInfoClicked = false; m_bNameTableClicked = false; m_bChangeDetailsClicked = false; m_oCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); if (m_oCommonConstants.UserInfo == null) { return; } UserStatusLabel.Text = "Logged in as " + m_oCommonConstants.UserInfo.UserName; tableIconList = new List<LobbyItemButton>(); COrderManager tempOrderManager = new COrderManager(); List<COrderShow> tempOrderShowList = (List<COrderShow>)tempOrderManager.OrderListShowByStatus("Paid").Data; onlineOrders = String.Empty; for (int orderCounter = 0; orderCounter < tempOrderShowList.Count; orderCounter++) { LobbyItemButton tableIcon = new LobbyItemButton(); // tableIcon.Visible = false; tableIcon.User = tempOrderShowList[orderCounter].UserName; tableIcon.GuestCount = tempOrderShowList[orderCounter].GuestCount.ToString(); tableIcon.TableName = tempOrderShowList[orderCounter].TableName; tableIcon.Type = tempOrderShowList[orderCounter].OrderType; tableIcon.FloorName = tempOrderShowList[orderCounter].FloorNo; if (tableIcon.TableName.Equals("")) { if (tableIcon.Type.Equals("Table")) tableIcon.TableName = "Table " + tempOrderShowList[orderCounter].TableNumber.ToString(); else if (tableIcon.Type.Equals("Tabs")) tableIcon.TableName = "Tab " + tempOrderShowList[orderCounter].TableNumber.ToString(); else if (tableIcon.Type.Equals("TakeAway")) { COrderInfo temp2OrderInfo = (COrderInfo)tempOrderManager.OrderInfoByOrderID(tempOrderShowList[orderCounter].OrderID).Data; CCustomerManager tempCustomerManager = new CCustomerManager(); CCustomerInfo tempCustomerinfo = new CCustomerInfo(); tempCustomerinfo = (CCustomerInfo)tempCustomerManager.CustomerInfoGetByCustomerID(temp2OrderInfo.CustomerID).Data; if (tempCustomerinfo != null) tableIcon.TableName = tempCustomerinfo.CustomerName; else tableIcon.TableName = "Take Away"; //tableIcon.GuestCountLabel.Text = tempOrderShowList[orderCounter].Status; tableIcon.TableName = tempOrderShowList[orderCounter].Status; } } tableIcon.TableNumber = Int64.Parse(tempOrderShowList[orderCounter].TableNumber.ToString()); string status = tempOrderShowList[orderCounter].Status; tableIcon.OrderID = tempOrderShowList[orderCounter].OrderID; //Added by Baruri at 13.12.2008.This portion is used for automatic printing of online orders. if (tempOrderShowList[orderCounter].OnlineOrderID >1) //If online order { if (onlineOrders.Length == 0) { onlineOrders = tempOrderShowList[orderCounter].OrderID.ToString(); } else { onlineOrders = onlineOrders + "," + tempOrderShowList[orderCounter].OrderID.ToString(); } } COrderInfo tempOrderInfo = (COrderInfo)tempOrderManager.OrderInfoByOrderID(tableIcon.OrderID).Data; COrderSeatTime tempOrderSeatTime = (COrderSeatTime)tempOrderManager.OrderSeatTimeByOrderID(tableIcon.OrderID).Data; tableIcon.OrderedTime = tempOrderInfo.OrderTime; tableIcon.SeatedTime = tempOrderSeatTime.SeatTime; if (tempOrderShowList[orderCounter].OrderType.Equals("Table")) { if (status.Equals("Seated")) { tableIcon.ItemType = RMSUIConstants.ItemType.SeatedButNoOrdered; } else if (status.Equals("Ordered")) { tableIcon.ItemType = RMSUIConstants.ItemType.Ordered; //tableIcon.Icon = global::RMS.Properties.Resources.ordered_png; } else if (status.Equals("Billed")) { tableIcon.ItemType = RMSUIConstants.ItemType.WaitingForPayment; //tableIcon.Icon = global::RMS.Properties.Resources.awaiting_png; } else if (tempOrderShowList[orderCounter].Status.Equals("DelivaryFromKitchen")) { tableIcon.ItemType = RMSUIConstants.ItemType.Delevery; // tableIcon.Icon = global::RMS.Properties.Resources.Delevery_png; } tableIcon.Type = "Table"; } else if (tempOrderShowList[orderCounter].OrderType.Equals("TakeAway")) { if (tempOrderShowList[orderCounter].Status.Equals("Collection")) { tableIcon.ItemType = RMSUIConstants.ItemType.Collection; // tableIcon.Icon = global::RMS.Properties.Resources.takeaway_png; } else if (tempOrderShowList[orderCounter].Status.Equals("DelivaryFromKitchen")) { tableIcon.ItemType = RMSUIConstants.ItemType.Delevery; // tableIcon.Icon = global::RMS.Properties.Resources.Delevery_png; } //else if(tempOrderShowList[orderCounter].Status.Equals("Delivery")) //{ // tableIcon.ItemType = RMSUIConstants.ItemType.Delevery; // // tableIcon.Icon = global::RMS.Properties.Resources.Delevery_png; //} else if (tempOrderShowList[orderCounter].Status.Equals("Waiting")) { tableIcon.ItemType = RMSUIConstants.ItemType.Waiting; } tableIcon.Type = "TakeAway"; } else if (tempOrderShowList[orderCounter].OrderType.Equals("Tabs")) { // tableIcon.i = global::RMS.Properties.Resources.rms_bar_service; tableIcon.ItemType = RMSUIConstants.ItemType.BarService; //tableIcon.Icon = global::RMS.Properties.Resources.tab_png; tableIcon.Type = "Tabs"; } tableIcon.Click += new EventHandler(TableIcon_MouseClick); tableIconList.Add(tableIcon); } this.SortIcons(); for (int k = ((m_iPageIndex - 1) * m_page_order_capacity); k < tableIconList.Count && k < (m_iPageIndex * m_page_order_capacity); k++) TablePanel.Controls.Add(tableIconList[k]); #region "Current Code Modified by Baruri at 30/07/2008" if (tableIconList.Count % m_page_order_capacity == 0) { m_iTotalPageCount = tableIconList.Count / m_page_order_capacity; } else { m_iTotalPageCount = (tableIconList.Count / m_page_order_capacity) + 1; } TotalPageLabel.Text = m_iTotalPageCount.ToString(); #endregion if (m_iPageIndex < m_iTotalPageCount) NextButton.Enabled = true; else NextButton.Enabled = false; if (m_iPageIndex > 1) PreviousButton.Enabled = true; else PreviousButton.Enabled = false; CurrentPageLabel.Text = m_iPageIndex.ToString(); String BarServiceColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Bar Service'")[0]["color"].ToString(); BarServiceButton.BackColor = Color.FromArgb(Int32.Parse(BarServiceColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber), Int32.Parse(BarServiceColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber), Int32.Parse(BarServiceColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber)); String TakeAwayColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Take Away'")[0]["color"].ToString(); TWButton.BackColor = Color.FromArgb(Int32.Parse(TakeAwayColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber), Int32.Parse(TakeAwayColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber), Int32.Parse(TakeAwayColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber)); String NewTableColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'New Table'")[0]["color"].ToString(); NewTableButton.BackColor = Color.FromArgb(Int32.Parse(NewTableColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber), Int32.Parse(NewTableColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber), Int32.Parse(NewTableColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber)); LoadStatusBar(tempOrderShowList.Count); } catch (Exception ee) { } m_onlineOrders = onlineOrders.Split(','); //Online order list . }
public KitchenVoidForm() { InitializeComponent(); m_cCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); }
public RMS.Common.ObjectModel.CResult Cat4UpdateOrderUp(RMS.Common.ObjectModel.CCategory4 oCat, RMS.Common.ObjectModel.CCategory4 oCat2) { CResult oResult = new CResult(); try { CCommonConstants oConstants = ConfigManager.GetConfig <CCommonConstants>(); int iTempCat2Order = 0; int iTempCat3Order = 0; CResult oResult4 = GetCategory2Order(oCat.Category3ID); if (oResult4.IsSuccess && oResult4.Data != null) { CCat4Rank oTempCat4Rank5 = (CCat4Rank)oResult4.Data; iTempCat2Order = oTempCat4Rank5.Category2Order; iTempCat3Order = oTempCat4Rank5.Category3Order; } else { return(oResult); } this.OpenConnectionWithTransection(); CCat4Rank oTempCat4Rank7 = new CCat4Rank(); oTempCat4Rank7.Category4ID = oCat.Category4ID; oTempCat4Rank7.Category4Order = oCat2.Category4Order; UpdateCat4Rank(oTempCat4Rank7, iTempCat2Order, iTempCat3Order); CCat4Rank oTempCat4Rank6 = new CCat4Rank(); oTempCat4Rank6.Category4ID = oCat2.Category4ID; oTempCat4Rank6.Category4Order = oCat.Category4Order; UpdateCat4Rank(oTempCat4Rank6, iTempCat2Order, iTempCat3Order); string sSql = String.Format(SqlQueries.GetQuery(Query.UpdateCategory4Order), oConstants.MaxOrderChange, oCat2.Category4ID, RMSGlobal.LogInUserName, DateTime.Now.Ticks); this.ExecuteNonQuery(sSql); sSql = String.Format(SqlQueries.GetQuery(Query.UpdateCategory4Order), oCat2.Category4Order, oCat.Category4ID, RMSGlobal.LogInUserName, DateTime.Now.Ticks); this.ExecuteNonQuery(sSql); sSql = String.Format(SqlQueries.GetQuery(Query.UpdateCategory4Order), oCat.Category4Order, oCat2.Category4ID, RMSGlobal.LogInUserName, DateTime.Now.Ticks); this.ExecuteNonQuery(sSql); oResult.IsSuccess = true; this.CommitTransection(); } catch (Exception ex) { Logger.Write("Exception : " + ex + " in ItemDelete()", LogLevel.Error, "Database"); //throw new Exception("Exception occure at ItemDelete()", ex); this.RollBackTransection(); } finally { this.CloseConnection(); } return(oResult); }
public CTakeAwayForm(Int64 inOrderId) { InitializeComponent(); ScreenTitle = "Takeaway Customer Information"; m_cCurrentControl = txtCustomerName; m_customerEditStatus = false; m_deliveryTime = String.Empty; m_orderType = String.Empty; m_oCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); if (m_oCommonConstants.UserInfo == null) return; m_iOrderID = inOrderId; CUserManager tempUserManager = new CUserManager(); CResult tempResult = tempUserManager.GetAllUser(); if (tempResult.IsSuccess) { userList = new List<CUserInfo>(); userList = (List<CUserInfo>)tempResult.Data; } }
public CPaymentForm(Int64 inOrderID, Double inTotalAmount, String inTableType, DataTable inItemList, Double inDiscount, int drinksIndex, string serviceCharge) { InitializeComponent(); m_cCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); String ConnectionString = m_cCommonConstants.DBConnection; SqlDataAdapter daCategory3 = new SqlDataAdapter(SqlQueries.GetQuery(Query.Category3GetAll), ConnectionString); daCategory3.Fill(dsCategory3, "Category3"); daCategory3.Dispose(); SqlDataAdapter daCategory4 = new SqlDataAdapter(SqlQueries.GetQuery(Query.Category4GetAll), ConnectionString); daCategory4.Fill(dsCategory4, "Category4"); daCategory4.Dispose(); SqlDataAdapter tempSqlDataAdapter5 = new SqlDataAdapter(SqlQueries.GetQuery(Query.Category2GetAll), ConnectionString); tempSqlDataAdapter5.Fill(dsCategory2, "Category2"); tempSqlDataAdapter5.Dispose(); m_oDepositUsed = new CDepositUsed(); m_oDeposit = new CDeposit(); m_iOrderID = inOrderID; m_dTotalAmount = inTotalAmount; m_dBalance = inTotalAmount + Convert.ToDouble("0" + serviceCharge); m_sTableType = inTableType; m_dtItemList = inItemList; m_iDrinksIndex = drinksIndex; m_dServiceAmount = Convert.ToDouble("0" + serviceCharge); g_BalaceLabel.Text = String.Format("Balace Due {0}" + (inTotalAmount + Convert.ToDouble("0" + serviceCharge)).ToString("F02"), Program.currency); g_BillTotalLabel.Text = Program.currency + inTotalAmount.ToString("F02"); m_tobePaid = inTotalAmount; //Total without service charge g_DiscountLabel.Text = Program.currency + inDiscount.ToString("F02"); g_ServiceChargeLabel.Text = Program.currency + Convert.ToDouble("0" + serviceCharge).ToString("F02"); //String CashButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Cash'")[0]["color"].ToString(); //g_CashButton.BackColor = Color.FromArgb(Int32.Parse(CashButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(CashButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(CashButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber)); //String ChequeButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Cheque'")[0]["color"].ToString(); //g_ChequeButton.BackColor = Color.FromArgb(Int32.Parse(ChequeButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(ChequeButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(ChequeButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber)); //String EFTButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'EFT'")[0]["color"].ToString(); //g_EFTButton.BackColor = Color.FromArgb(Int32.Parse(EFTButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(EFTButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(EFTButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber)); //String VoucherButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Voucher'")[0]["color"].ToString(); //g_VoucherButton.BackColor = Color.FromArgb(Int32.Parse(VoucherButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(VoucherButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(VoucherButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber)); //String AccountButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Account'")[0]["color"].ToString(); //g_AccountButton.BackColor = Color.FromArgb(Int32.Parse(AccountButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(AccountButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(AccountButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber)); //String LoyaltiCardButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Loyalty Card'")[0]["color"].ToString(); //g_LoyaltiCardButton.BackColor = Color.FromArgb(Int32.Parse(LoyaltiCardButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(LoyaltiCardButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(LoyaltiCardButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber)); //String DiscountColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Discount'")[0]["color"].ToString(); //g_DiscountButton.BackColor = Color.FromArgb(Int32.Parse(DiscountColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(DiscountColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(DiscountColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber)); LoadPrintOffButton(); LoadStatusBar(inOrderID); }
//public void SerialPrintBody(List<CSerialPrintContent> inBody) //{ // try // { // for (int i = 0; i < inBody.Count; i++) // { // m_oCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); // if (inBody[0].Bold) // { // m_pSerialPort.Write(m_oCommonConstants.BoldOnCode, 0, m_oCommonConstants.BoldOnCode.Length); // } // m_pSerialPort.WriteLine(inBody[i].StringLine); // if (inBody[0].Bold) // { // m_pSerialPort.Write(m_oCommonConstants.BoldOffCode, 0, m_oCommonConstants.BoldOffCode.Length); // } // } // } // catch (Exception eee) // { // } //} public void OpenDrawer() { try { Debug.WriteLine("Open drawer started"); m_oCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); InitSerialPort(); Debug.WriteLine("Open drawer code sent"); m_pSerialPort.Write(m_oCommonConstants.DrawerKickCode, 0, m_oCommonConstants.DrawerKickCode.Length); Debug.WriteLine("Open drawer code send ended"); DisposeSerialPort(); } catch (Exception ex) { Debug.WriteLine("In OpenDrawer Method catch"); Debug.WriteLine(ex.ToString()); } }
public void SerialPrint(PRINTER_TYPES inPrinterType, String inHeader, string inBody, String inFooter,String inSerialNumber) { try { InitSerialPort(); m_oCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); m_oCommonConstants.CutPaperCode = ToByteArray(RMSGlobal.m_printer_kitchen_cut_command); //Added by at 08.07.2009 if (inPrinterType == PRINTER_TYPES.NORMAL_PRINTER) { Debug.WriteLine("Write to Port Started"); SerialPrintHeader(); m_pSerialPort.Write(inBody); SerialPrintFooter(); // SerialPrintBarCode(inSerialNumber); // m_pSerialPort.Write("\r\n VAT No: 870028049\r\n"); m_pSerialPort.Write("\r\n\r\n\r\n\r\n\r\n\r\n"); m_pSerialPort.Write(m_oCommonConstants.BeepCode, 0, m_oCommonConstants.BeepCode.Length); m_pSerialPort.Write(m_oCommonConstants.CutPaperCode, 0, m_oCommonConstants.CutPaperCode.Length); m_pSerialPort.Write("\n"); Debug.WriteLine("Write to Port Ended"); } else if (inPrinterType == PRINTER_TYPES.KITCHEN_PRINTER) { } DisposeSerialPort(); } catch (Exception ex) { Debug.WriteLine("In SerialPrint Method catch"); Debug.WriteLine(ex.ToString()); } }
public void SerialPrintBarCode(String inSerialNumber) { try { if (inSerialNumber.Equals("")) { return; } Debug.WriteLine("printing barcode"); m_oCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); m_pSerialPort.Write(m_oCommonConstants.SelectFontHRI, 0, m_oCommonConstants.SelectFontHRI.Length); m_pSerialPort.Write(m_oCommonConstants.PrintBarCode, 0, m_oCommonConstants.PrintBarCode.Length); m_pSerialPort.Write(inSerialNumber); byte[] nullByte ={ 0x00 }; m_pSerialPort.Write(nullByte, 0, nullByte.Length); Debug.WriteLine("printing barcode ended"); } catch (Exception eee) { Debug.WriteLine("Error in SerialPrintBarCode"); Debug.WriteLine(eee.ToString()); } }
private void Init() { try { m_sDiscountType = "Fixed"; m_dDiscountAmount = 0; parentCategoryButtonList = new List<CCategoryButton>(); category2ButtonList = new List<CCategoryButton>(); category3ButtonList = new List<CCategoryButton>(); category4ButtonList = new List<CCategoryButton>(); m_cCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); //New Addition at 04/08/2011 String ConnectionString = m_cCommonConstants.DBConnection; SqlDataAdapter daParentCategory = new SqlDataAdapter(SqlQueries.GetQuery(Query.ParentCategoryGetAll), ConnectionString); daParentCategory.Fill(dsParentCategory, "ParentCategory"); daParentCategory.Dispose(); //New Addition at 08/08/2008 SqlDataAdapter daCategory3 = new SqlDataAdapter(SqlQueries.GetQuery(Query.Category3GetAll), ConnectionString); daCategory3.Fill(dsCategory3, "Category3"); daCategory3.Dispose(); SqlDataAdapter daCategory4 = new SqlDataAdapter(SqlQueries.GetQuery(Query.Category4GetAll), ConnectionString); daCategory4.Fill(dsCategory4, "Category4"); daCategory4.Dispose(); SqlDataAdapter tempSqlDataAdapter5 = new SqlDataAdapter(SqlQueries.GetQuery(Query.Category2GetAll), ConnectionString); tempSqlDataAdapter5.Fill(dsCategory2, "Category2"); tempSqlDataAdapter5.Dispose(); SqlDataAdapter tempSqlDataAdapter6 = new SqlDataAdapter(SqlQueries.GetQuery(Query.Category1GetAll), ConnectionString); tempSqlDataAdapter6.Fill(dsCategory1, "Category1"); tempSqlDataAdapter6.Dispose(); if (m_cCommonConstants.UserInfo == null) return; //Remove Items .This code will be optimized later CUserManager tempUserManager = new CUserManager(); /*CUserAccess tempUserAccess2 = (CUserAccess)tempUserManager.GetUserAccess(m_cCommonConstants.UserInfo).Data; if (tempUserAccess2.RemoveItems == 1) g_RemoveButton.Enabled = true; else g_RemoveButton.Enabled = false;*/ if (m_iType == m_cCommonConstants.TableType) this.g_ConvertButton.Text = ""; else if (m_iType == m_cCommonConstants.TakeAwayType) this.g_ConvertButton.Text = "Convert to Table"; // For Food Menu @Mahmud foreach (DataRow tempDataRow in Program.initDataSet.Tables["ParentCategory"].Rows) { CCategoryButton tempCategoryButton = new CCategoryButton(); tempCategoryButton.CategoryID = int.Parse(tempDataRow["parent_cat_id"].ToString()); tempCategoryButton.CategoryOrder = int.Parse(tempDataRow["parent_cat_order"].ToString()); tempCategoryButton.CategoryLevel = 0; tempCategoryButton.Text = tempDataRow["parent_cat_name"].ToString(); tempCategoryButton.Width = 110;//new at 05.03.2010 // OLD PARENT CATEGORY SIZE AND COLOR tempCategoryButton.Height = tempCategoryButton.Height - 1; tempCategoryButton.BackColor = Color.LightSeaGreen;//Parent colour Change ////tempCategoryButton.Width = 170; ////tempCategoryButton.Height = tempCategoryButton.Height + 10; // CHANGE MITHU ////tempCategoryButton.BackColor = Color.Firebrick; //#try //#{ //# tempCategoryButton.BackColor = Color.FromArgb(Int32.Parse(tempDataRow["cat2_color"].ToString().Substring(1, 2), System.Globalization.NumberStyles.HexNumber), //# Int32.Parse(tempDataRow["cat2_color"].ToString().Substring(3, 2), System.Globalization.NumberStyles.HexNumber), //# Int32.Parse(tempDataRow["cat2_color"].ToString().Substring(5, 2), System.Globalization.NumberStyles.HexNumber)); //#} //#catch (Exception exp) //#{ //# Console.Write(exp.Message); //#} //tempCategoryButton.BackColor = Color.FromName(tempDataRow["cat2_color"].ToString()); tempCategoryButton.Click += new EventHandler(parentCategoryButton_Click); parentCategoryButtonList.Add(tempCategoryButton); } // For Food Menu @Mahmud foodMenuPanal.Controls.Clear(); foreach (CCategoryButton pcb in parentCategoryButtonList) { // foodMenuPanal.Controls.Add(pcb); if (m_iParentNavigationPoint != 0) { foodMenuPanal.Controls.Clear(); for (int counter = 0; counter < m_capacity; counter++) { if (parentCategoryButtonList.Count > (m_capacity * m_iParentNavigationPoint + counter)) { foodMenuPanal.Controls.Add(parentCategoryButtonList[(m_capacity * m_iParentNavigationPoint + counter)]); } } if (m_iParentNavigationPoint < (parentCategoryButtonList.Count / m_capacity)) { if ((m_iParentNavigationPoint + 1) == (parentCategoryButtonList.Count / m_capacity) && (parentCategoryButtonList.Count % m_capacity) == 0) { btnNextParent.Enabled = false; } else { btnNextParent.Enabled = true; } } else btnNextParent.Enabled = false; if (m_iParentNavigationPoint > 0) btnPrevParent.Enabled = true; else btnPrevParent.Enabled = false; } else { foodMenuPanal.Controls.Clear(); for (int counter = 0; counter < m_capacity && counter < parentCategoryButtonList.Count; counter++) { foodMenuPanal.Controls.Add(parentCategoryButtonList[counter]); } if (parentCategoryButtonList.Count > m_capacity) btnNextParent.Enabled = true; else btnNextParent.Enabled = false; btnPrevParent.Enabled = false; } // #endregion } this.LoadStatusBar(); if (m_customerEditStatus == true)//If customer edit button is pressed.This function is called for getting the latest information after modification { this.FillSummary(); m_customerEditStatus = false; } } catch (Exception exp) { Console.Write(exp.Message); } }
public CBarServiceForm() { InitializeComponent(); m_bOrderState = false; m_cCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); m_iType = m_cCommonConstants.TabsType; FillRMSDataGridView(); category2ButtonList = new List<CCategoryButton>(); category3ButtonList = new List<CCategoryButton>(); category4ButtonList = new List<CCategoryButton>(); try { m_cCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); this.ActivateButtons(); if (m_cCommonConstants.UserInfo == null) return; this.g_ConvertButton.Text = "Convert to Table"; foreach (DataRow tempDataRow in Program.initDataSet.Tables["Category2"].Rows) { if (int.Parse(tempDataRow["cat2_type"].ToString()) == 1) continue; CCategoryButton tempCategoryButton = new CCategoryButton(); tempCategoryButton.CategoryID = int.Parse(tempDataRow["cat2_id"].ToString()); tempCategoryButton.CategoryOrder = int.Parse(tempDataRow["cat2_order"].ToString()); tempCategoryButton.CategoryLevel = 2; tempCategoryButton.Text = tempDataRow["cat2_name"].ToString(); try { tempCategoryButton.BackColor = Color.FromArgb(Int32.Parse(tempDataRow["cat2_color"].ToString().Substring(1, 2), System.Globalization.NumberStyles.HexNumber), Int32.Parse(tempDataRow["cat2_color"].ToString().Substring(3, 2), System.Globalization.NumberStyles.HexNumber), Int32.Parse(tempDataRow["cat2_color"].ToString().Substring(5, 2), System.Globalization.NumberStyles.HexNumber)); } catch (Exception eeee) { } //tempCategoryButton.BackColor = Color.FromName(tempDataRow["cat2_color"].ToString()); tempCategoryButton.Click += new EventHandler(Category2Button_Click); category2ButtonList.Add(tempCategoryButton); } g_Category2Panel.Controls.Clear(); for (int counter = 0; counter < CATEGORY2PANEL_CAPACITY && counter < category2ButtonList.Count; counter++) { g_Category2Panel.Controls.Add(category2ButtonList[counter]); } if (category2ButtonList.Count > CATEGORY2PANEL_CAPACITY) g_NextButton.Enabled = true; else g_NextButton.Enabled = false; g_PreviousButton.Enabled = false; LoadStatusBar(); } catch (Exception eee) { } }
public void SerialPrintBody(List<CSerialPrintContent> inBody) { try { for (int counter = 0; counter < inBody.Count; counter++) { m_oCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); if (inBody[0].Bold) { m_pSerialPort.Write(m_oCommonConstants.BoldOnCode, 0, m_oCommonConstants.BoldOnCode.Length); } m_pSerialPort.WriteLine(inBody[counter].StringLine); if (inBody[0].Bold) { m_pSerialPort.Write(m_oCommonConstants.BoldOffCode, 0, m_oCommonConstants.BoldOffCode.Length); } } } catch (Exception eee) { Debug.WriteLine("In SerialPrintBody Method catch"); Debug.WriteLine(eee.ToString()); } }
//public void SerialPrint(PRINTER_TYPES inPrinterType, String inHeader, List<CSerialPrintContent> inBody, String inFooter, String inSerialNumber) //{ // try // { // InitSerialPort(); // m_oCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); // if (inPrinterType == PRINTER_TYPES.NORMAL_PRINTER) // { // Debug.WriteLine("Write to Port Started"); // SerialPrintHeader(); // SerialPrintBody(inBody); // SerialPrintFooter(); // SerialPrintBarCode(inSerialNumber); // m_pSerialPort.Write(m_oCommonConstants.BeepCode, 0, m_oCommonConstants.BeepCode.Length); // m_pSerialPort.Write(m_oCommonConstants.CutPaperCode, 0, m_oCommonConstants.CutPaperCode.Length); // m_pSerialPort.Write("\n"); // Debug.WriteLine("Write to Port Ended"); // } // else if (inPrinterType == PRINTER_TYPES.KITCHEN_PRINTER) // { // } // DisposeSerialPort(); // } // catch (Exception ex) // { // Debug.WriteLine("In SerialPrint Method catch"); // Debug.WriteLine(ex.ToString()); // } //} public void SerialPrint(PRINTER_TYPES inPrinterType, String inHeader, string inBody, String inFooter, String inSerialNumber) { try { InitSerialPort(); m_oCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); if (inPrinterType == PRINTER_TYPES.NORMAL_PRINTER) { Debug.WriteLine("Write to Port Started"); SerialPrintHeader(); m_pSerialPort.Write(inBody); SerialPrintFooter(); SerialPrintBarCode(inSerialNumber); m_pSerialPort.Write(m_oCommonConstants.BeepCode, 0, m_oCommonConstants.BeepCode.Length); m_pSerialPort.Write(m_oCommonConstants.CutPaperCode, 0, m_oCommonConstants.CutPaperCode.Length); m_pSerialPort.Write("\n"); Debug.WriteLine("Write to Port Ended"); } else if (inPrinterType == PRINTER_TYPES.KITCHEN_PRINTER) { } DisposeSerialPort(); } catch (Exception ex) { Debug.WriteLine("In SerialPrint Method catch"); Debug.WriteLine(ex.ToString()); } }
public RMS.Common.ObjectModel.CResult Cat2UpdateOrderDown(RMS.Common.ObjectModel.CCategory2 oCat, RMS.Common.ObjectModel.CCategory2 oCat2) { CResult oResult = new CResult(); try { CCommonConstants oConstants = ConfigManager.GetConfig <CCommonConstants>(); CCat2Rank oTempList = new CCat2Rank(); CCat2Rank oTempList2 = new CCat2Rank(); CResult oResult2 = GetOrderCandidateSingle(oCat); if (oResult2.IsSuccess && oResult2.Data != null) { oTempList = (CCat2Rank)oResult2.Data; } CResult oResult3 = GetOrderCandidateSingle(oCat2); if (oResult3.IsSuccess && oResult3.Data != null) { oTempList2 = (CCat2Rank)oResult3.Data; } this.OpenConnectionWithTransection(); //for (int i = 0; i < oTempList.Count; i++) //{ // CCat2Rank oTempCat2Rank = oTempList[i]; List <CCat3Rank> oTempCat3List = oTempList.ChildCat3List; List <CCat4Rank> oTempCat4List = oTempList.ChildCat4List; if (oTempCat3List.Count > 0) { UpdateChildCat3Rank(oTempCat3List, oCat2.Category2Order); } if (oTempCat4List.Count > 0) { UpdateChildCat4Rank(oTempCat4List, oCat2.Category2Order); } // } //for (int k = 0; k < oTempList2.Count; k++) // { //CCat2Rank oTempCat2Rank = oTempList2[k]; oTempCat3List = oTempList2.ChildCat3List; oTempCat4List = oTempList2.ChildCat4List; if (oTempCat3List.Count > 0) { UpdateChildCat3Rank(oTempCat3List, oCat.Category2Order); } if (oTempCat4List.Count > 0) { UpdateChildCat4Rank(oTempCat4List, oCat.Category2Order); } // } string sSql = String.Format(SqlQueries.GetQuery(Query.UpdateCategory2Order), oConstants.MaxOrderChange, oCat.Category2ID, RMSGlobal.LogInUserName, DateTime.Now.Ticks); this.ExecuteNonQuery(sSql); sSql = String.Format(SqlQueries.GetQuery(Query.UpdateCategory2Order), oCat.Category2Order, oCat2.Category2ID, RMSGlobal.LogInUserName, DateTime.Now.Ticks); this.ExecuteNonQuery(sSql); sSql = String.Format(SqlQueries.GetQuery(Query.UpdateCategory2Order), oCat2.Category2Order, oCat.Category2ID, RMSGlobal.LogInUserName, DateTime.Now.Ticks); this.ExecuteNonQuery(sSql); oResult.IsSuccess = true; this.CommitTransection(); } catch (Exception ex) { Logger.Write("Exception : " + ex + " in ItemDelete()", LogLevel.Error, "Database"); //throw new Exception("Exception occure at ItemDelete()", ex); this.RollBackTransection(); } finally { this.CloseConnection(); } return(oResult); }
public void SerialPrintBarCode(String inSerialNumber) { if (inSerialNumber.Equals("")) return; m_oCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); m_pSerialPort.Write(m_oCommonConstants.SelectFontHRI, 0, m_oCommonConstants.SelectFontHRI.Length); m_pSerialPort.Write(m_oCommonConstants.PrintBarCode, 0, m_oCommonConstants.PrintBarCode.Length); m_pSerialPort.Write(inSerialNumber); byte[] nullByte ={ 0x00 }; m_pSerialPort.Write(nullByte, 0, nullByte.Length); }
private void FinishButton_Click(object sender, EventArgs e) { CResult objResultant = new CResult(); try { if (!CheckEmpty() && m_orderIndex == 1) { CMessageBox tempMessageBox = new CMessageBox("Error", "Please enter all the mandatory values."); tempMessageBox.ShowDialog(); return; } CCustomerManager tempCustomerManager = new CCustomerManager(); CCustomerInfo tempCustomerInfo = new CCustomerInfo(); if (txtPhoneNumber.Text.Trim().Equals(String.Empty)) { CResult oResult5 = tempCustomerManager.CustomerInfoGetByName(txtCustomerName.Text.Trim()); if (oResult5.IsSuccess && oResult5.Data != null) { tempCustomerInfo = (CCustomerInfo)oResult5.Data; } } else { CResult oResult = tempCustomerManager.CustomerInfoGetByPhone(txtPhoneNumber.Text.Trim()); if (oResult.IsSuccess && oResult.Data != null) { tempCustomerInfo = (CCustomerInfo)oResult.Data; } } if (txtCustomerName.Text.Length == 0 && (m_orderIndex == 2 || m_orderIndex == 3)) { txtCustomerName.Text = m_order_name; } tempCustomerInfo.CustomerName = txtCustomerName.Text.Trim(); tempCustomerInfo.CustomerPhone = txtPhoneNumber.Text.Trim(); if (m_orderIndex == 1) //If only delivery type order is considered { tempCustomerInfo.CustomerPostalCode = txtPostalCode.Text.Trim(); tempCustomerInfo.FloorAptNumber = txtFloorAptNumber.Text.Trim(); tempCustomerInfo.HouseNumber = txtHouseNumber.Text.Trim(); tempCustomerInfo.StreetName = txtStreetName.Text.Trim() + "-" + txtStreet2.Text.Trim(); tempCustomerInfo.BuildingName = txtBuildingName.Text.Trim(); tempCustomerInfo.CustomerTown = txtTown.Text.Trim(); tempCustomerInfo.CustomerCountry = cmbCountry.Text; tempCustomerInfo.UserName = RMSGlobal.LoginUserName; tempCustomerInfo.TerminalId = RMSGlobal.Terminal_Id; Int64 currentdateTime = DateTime.Now.Ticks; tempCustomerInfo.InsertDate = currentdateTime; } if (tempCustomerInfo.CustomerID == 0) { CResult oResult6 = tempCustomerManager.InsertCustomerInfo(tempCustomerInfo); if (oResult6.IsSuccess && oResult6.Data != null) tempCustomerInfo = (CCustomerInfo)oResult6.Data; } else { tempCustomerManager.UpdateCustomerInfo(tempCustomerInfo); } #region "Older" if (m_customerEditStatus == false) { if (m_iOrderID == 0) { COrderManager tempOrderManager = new COrderManager(); COrderInfo tempOrderInfo = new COrderInfo(); tempOrderInfo.CustomerID = tempCustomerInfo.CustomerID; tempOrderInfo.OrderType = "TakeAway"; tempOrderInfo.OrderTime = System.DateTime.Now; tempOrderInfo.TableNumber = GetValidTableNumber("TakeAway"); CTableInfo tempTableInfo = new CTableInfo(); tempTableInfo.TableNumber = tempOrderInfo.TableNumber; tempTableInfo.TableType = "TakeAway"; tempOrderManager.InsertTableInfo(tempTableInfo); if (m_orderIndex==1) { tempOrderInfo.Status = "Delivery"; } else if (m_orderIndex ==2 ) { tempOrderInfo.Status = "Collection"; } else if (m_orderIndex == 3) { tempOrderInfo.Status = "Waiting"; } m_oCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); tempOrderInfo.UserID = m_oCommonConstants.UserInfo.UserID; objResultant = tempOrderManager.InsertOrderInfo(tempOrderInfo); //New Order COrderInfo tempOrderInfoNew = (COrderInfo)objResultant.Data;//Taking the order ID m_iOrderID = tempOrderInfoNew.OrderID; #region " Inserting Order details info if items are selected from the previous orders" //Developed by baruri List<COrderDetails> tempOrderDetailsList = new List<COrderDetails>(); if (m_htOrderInfo.Count > 0) //If item is selected from the previous order { tempOrderDetailsList = (List<COrderDetails>)m_htOrderInfo["orderdetail"]; } if (tempOrderDetailsList.Count > 0) //Insert details for the new order { for (int itemDetailIndex = 0; itemDetailIndex < tempOrderDetailsList.Count; itemDetailIndex++) { COrderDetails objOrderDetails = (COrderDetails)tempOrderDetailsList[itemDetailIndex]; objOrderDetails.OrderID = tempOrderInfo.OrderID; tempOrderManager.InsertOrderDetails(objOrderDetails); } m_htOrderInfo = new Hashtable();//Clearing the previous items from the order if there is any. } #endregion //insert delivery time if (tempOrderInfo.Status.Equals("Delivery")) { CDelivery tempDelivery = new CDelivery(); tempDelivery.DeliveryOrderID = tempOrderInfo.OrderID; string deliveryTime = Convert.ToInt32("0" + cmbHour.Text).ToString("00") + ":" + Convert.ToInt32("0" + cmbMinute.Text).ToString("00") + " " + cmbMeridiem.Text; tempDelivery.DeliveryTime = deliveryTime;// DeliveryTimeTextBox.Text.Trim(); tempOrderManager.InsertDeliveryInfo(tempDelivery); } //OLD Code //Form tempForm = CFormManager.Forms.Pop(); //tempForm.Show(); 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) { } m_oCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); CTableOrderForm tempForm = new CTableOrderForm(m_iOrderID, m_oCommonConstants.TakeAwayType, tempOrderInfo.TableNumber); tempForm.m_orderUserName = RMSGlobal.LoginUserName; tempForm.Show(); this.Close(); } else { COrderManager tempOrderManager = new COrderManager(); CResult oResult7 = tempOrderManager.OrderInfoByOrderID(m_iOrderID); COrderInfo tempOrderInfo = new COrderInfo(); if (oResult7.IsSuccess && oResult7.Data != null) { tempOrderInfo = (COrderInfo)oResult7.Data; } tempOrderInfo.OrderType = "TakeAway"; tempOrderInfo.Status = "TakeAway"; tempOrderInfo.GuestCount = 0; tempOrderInfo.TableName = ""; tempOrderInfo.CustomerID = tempCustomerInfo.CustomerID; tempOrderInfo.TableNumber = GetValidTableNumber("TakeAway"); CTableInfo tempTableInfo = new CTableInfo(); tempTableInfo.TableNumber = tempOrderInfo.TableNumber; tempTableInfo.TableType = "TakeAway"; tempOrderManager.InsertTableInfo(tempTableInfo); if (m_orderIndex == 1) { tempOrderInfo.Status = "Delivery"; } else if (m_orderIndex == 3) { tempOrderInfo.Status = "Waiting"; } else if (m_orderIndex == 2) { tempOrderInfo.Status = "Collection"; } tempOrderManager.UpdateOrderInfo(tempOrderInfo); //insert delivery time if (tempOrderInfo.Status.Equals("Delivery")) { CDelivery tempDelivery = new CDelivery(); tempDelivery.DeliveryOrderID = tempOrderInfo.OrderID; string deliveryTime = Convert.ToInt32("0" + cmbHour.Text).ToString("00") + ":" + Convert.ToInt32("0" + cmbMinute.Text).ToString("00") + " " + cmbMeridiem.Text; tempDelivery.DeliveryTime = deliveryTime;// DeliveryTimeTextBox.Text.Trim(); tempOrderManager.InsertDeliveryInfo(tempDelivery); } 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) { } m_oCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); CTableOrderForm tempForm = (CTableOrderForm)CFormManager.Forms.Pop(); tempForm.m_iType = m_oCommonConstants.TakeAwayType; tempForm.Show(); this.Close(); } } #endregion else //Edit order information.As here is reached from order details screen. { COrderInfo tempOrderInfo = new COrderInfo(); COrderManager tempOrderManager = new COrderManager(); CDelivery tempDelivery = null; tempOrderInfo.OrderID = m_iOrderID; tempOrderManager.DeleteDeliveryInfo(m_iOrderID);//Delete previous record from delivery information table if (m_orderIndex==2) { tempOrderInfo.Status = "Collection"; } else if (m_orderIndex==3) { tempOrderInfo.Status = "Waiting"; } else { tempOrderInfo.Status = "Delivery"; tempDelivery = new CDelivery(); tempDelivery.DeliveryOrderID = tempOrderInfo.OrderID; string deliveryTime = Convert.ToInt32("0" + cmbHour.Text).ToString("00") + ":" + Convert.ToInt32("0" + cmbMinute.Text).ToString("00") + " " + cmbMeridiem.Text; tempDelivery.DeliveryTime = deliveryTime;// tempOrderManager.InsertDeliveryInfo(tempDelivery);//Update delivery information } tempOrderManager.UpdateTakeawayOrderInfo(tempOrderInfo);//Update order information 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) { } m_oCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); CTableOrderForm tempForm = (CTableOrderForm)CFormManager.Forms.Pop(); tempForm.m_iType = m_oCommonConstants.TakeAwayType; tempForm.Show(); this.Close(); } m_phoneNumber = String.Empty; } catch (Exception exp) { Console.Write(exp.Message); } }
public RMS.Common.ObjectModel.CResult Cat3UpdateOrderUp(RMS.Common.ObjectModel.CCategory3 oCat, RMS.Common.ObjectModel.CCategory3 oCat2) { CResult oResult = new CResult(); try { int iTempCat2Order = 0; CCat3Rank oTempList = new CCat3Rank(); CCat3Rank oTempList2 = new CCat3Rank(); CResult oResult4 = GetCategory2Order(oCat.Category2ID); if (oResult4.IsSuccess && oResult4.Data != null) { iTempCat2Order = (int)oResult4.Data; } else { return(oResult); } CResult oResult2 = GetOrderCandidateSingle(oCat); if (oResult2.IsSuccess && oResult2.Data != null) { oTempList = (CCat3Rank)oResult2.Data; } CResult oResult3 = GetOrderCandidateSingle(oCat2); if (oResult3.IsSuccess && oResult3.Data != null) { oTempList2 = (CCat3Rank)oResult3.Data; } int i = 0; this.OpenConnectionWithTransection(); UpdateCat3Rank(oTempList, iTempCat2Order, oCat2.Category3Order); List <CCat4Rank> oTempCat4List = oTempList.ChildCat4List; if (oTempCat4List.Count > 0) { UpdateChildCat4Rank(oTempCat4List, iTempCat2Order, oCat2.Category3Order); } UpdateCat3Rank(oTempList2, iTempCat2Order, oCat.Category3Order); oTempCat4List = oTempList2.ChildCat4List; if (oTempCat4List.Count > 0) { UpdateChildCat4Rank(oTempCat4List, iTempCat2Order, oCat.Category3Order); } CCommonConstants oConstants = ConfigManager.GetConfig <CCommonConstants>(); string sqlCommand = String.Format(SqlQueries.GetQuery(Query.UpdateCategory3Order), oConstants.MaxOrderChange, oCat2.Category3ID, RMSGlobal.LogInUserName, DateTime.Now.Ticks); this.ExecuteNonQuery(sqlCommand); sqlCommand = String.Format(SqlQueries.GetQuery(Query.UpdateCategory3Order), oCat2.Category3Order, oCat.Category3ID, RMSGlobal.LogInUserName, DateTime.Now.Ticks); this.ExecuteNonQuery(sqlCommand); sqlCommand = String.Format(SqlQueries.GetQuery(Query.UpdateCategory3Order), oCat.Category3Order, oCat2.Category3ID, RMSGlobal.LogInUserName, DateTime.Now.Ticks); this.ExecuteNonQuery(sqlCommand); oResult.IsSuccess = true; this.CommitTransection(); } catch (Exception ex) { Logger.Write("Exception : " + ex + " in ItemDelete()", LogLevel.Error, "Database"); this.RollBackTransection(); } finally { this.CloseConnection(); } return(oResult); }
public CPaymentForm(Int64 inOrderID, Double inTotalAmount, String inTableType, DataTable inItemList, decimal inDiscount, int drinksIndex, string terminalName, string operatorName, string serviceCharge,decimal inMembershipdiscount) { eFTCardManager = new EFTCardManager(); if (!isVatEnabled) { vat = 0.00; } InitializeComponent(); g_BalaceLabel.Text = Program.currency + "0.00"; g_BillTotalLabel.Text = Program.currency + "0.00"; g_CashLabel.Text = Program.currency + "0.00"; g_ChequeLabel.Text = Program.currency + "0.00"; g_DiscountLabel.Text = Program.currency + "0.00"; g_EFTLabel.Text = Program.currency + "0.00"; g_SplitAmountLabel.Text = Program.currency + "0.00"; g_ServiceChargeLabel.Text = Program.currency + "0.00"; g_VoucherLabel.Text = Program.currency + "0.00"; g_AccountLabel.Text = Program.currency + "0.00"; g_DepositUsedLabel.Text = Program.currency + "0.00"; g_InputTextBox.Text = Program.currency + "0.00"; membershipdiscountlabel.Text = Program.currency + "0.00"; g_InputTextBox.MaxLength = 20; currencyKeyPad1.CurrencySign = Program.currency; m_OperatorName = operatorName; m_TerminalName = terminalName; m_cCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); String ConnectionString = m_cCommonConstants.DBConnection; SqlDataAdapter daCategory3 = new SqlDataAdapter(SqlQueries.GetQuery(Query.Category3GetAll), ConnectionString); daCategory3.Fill(dsCategory3, "Category3"); daCategory3.Dispose(); SqlDataAdapter daCategory4 = new SqlDataAdapter(SqlQueries.GetQuery(Query.Category4GetAll), ConnectionString); daCategory4.Fill(dsCategory4, "Category4"); daCategory4.Dispose(); SqlDataAdapter tempSqlDataAdapter5 = new SqlDataAdapter(SqlQueries.GetQuery(Query.Category2GetAll), ConnectionString); tempSqlDataAdapter5.Fill(dsCategory2, "Category2"); tempSqlDataAdapter5.Dispose(); m_oDepositUsed = new CDepositUsed(); m_oDeposit = new CDeposit(); m_iOrderID = inOrderID; m_dTotalAmount = inTotalAmount; membershipdiscount = inMembershipdiscount; m_dBalance = inTotalAmount + Convert.ToDouble("0" + serviceCharge); m_sTableType = inTableType; m_dtItemList = inItemList; m_iDrinksIndex = drinksIndex; m_dServiceAmount = Convert.ToDouble("0" + serviceCharge); g_BalaceLabel.Text = String.Format("Balace Due {0}" + (inTotalAmount + Convert.ToDouble("0" + serviceCharge)).ToString("F02"), Program.currency); g_BillTotalLabel.Text = Program.currency + m_dBalance.ToString("F02"); m_tobePaid = inTotalAmount; //Total without service charge g_DiscountLabel.Text = Program.currency + inDiscount.ToString(); g_ServiceChargeLabel.Text = Program.currency + Convert.ToDouble("0" + serviceCharge).ToString("F02"); membershipdiscountlabel.Text = Program.currency + inMembershipdiscount.ToString(); // double grand = m_dTotalAmount + Convert.ToDouble(inDiscount); //Vat Claculation DataTable dt = inItemList; for (int i = 0; i < dt.Rows.Count;i++ ) { vatTotalAmount += Convert.ToDouble( dt.Rows[i]["Vat"].ToString()); } lblVat.Text = Program.currency + vatTotalAmount.ToString("F02"); // vatTotalAmount = ((m_dTotalAmount + Convert.ToDouble(inDiscount)) * (vat / 100)) / (1 + (vat / 100)); // lblVat.Text = Program.currency + vatTotalAmount.ToString("F02"); //String CashButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Cash'")[0]["color"].ToString(); //g_CashButton.BackColor = Color.FromArgb(Int32.Parse(CashButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(CashButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(CashButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber)); //String ChequeButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Cheque'")[0]["color"].ToString(); //g_ChequeButton.BackColor = Color.FromArgb(Int32.Parse(ChequeButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(ChequeButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(ChequeButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber)); //String EFTButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'EFT'")[0]["color"].ToString(); //g_EFTButton.BackColor = Color.FromArgb(Int32.Parse(EFTButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(EFTButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(EFTButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber)); //String VoucherButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Voucher'")[0]["color"].ToString(); //g_VoucherButton.BackColor = Color.FromArgb(Int32.Parse(VoucherButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(VoucherButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(VoucherButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber)); //String AccountButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Account'")[0]["color"].ToString(); //g_AccountButton.BackColor = Color.FromArgb(Int32.Parse(AccountButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(AccountButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(AccountButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber)); //String LoyaltiCardButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Loyalty Card'")[0]["color"].ToString(); //g_LoyaltiCardButton.BackColor = Color.FromArgb(Int32.Parse(LoyaltiCardButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(LoyaltiCardButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(LoyaltiCardButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber)); //String DiscountColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Discount'")[0]["color"].ToString(); //g_DiscountButton.BackColor = Color.FromArgb(Int32.Parse(DiscountColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(DiscountColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber), // Int32.Parse(DiscountColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber)); LoadPrintOffButton(); LoadStatusBar(inOrderID); }