private void btnSend_Click(object sender, EventArgs e) { string serialHeader = ""; string serialFooter = ""; string serialBody = ""; if (txtKitchenText.Text == null || txtKitchenText.Text.Length < 1) { MessageBox.Show("Please enter kitchen text.", RMSGlobal.MessageBoxTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } try { if (MessageBox.Show("Do you confirm to send: '" + txtKitchenText.Text + "' at kitchen", RMSGlobal.MessageBoxTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { CCommonConstants oConstant = ConfigManager.GetConfig<CCommonConstants>(); COrderManager tempOrderManager = new COrderManager(); COrderInfo tempOrderInfo = (COrderInfo)tempOrderManager.OrderInfoByOrderID(m_orderID).Data; CCustomerManager tempCustomerManager = new CCustomerManager(); CCustomerInfo tempCustomerInfo = (CCustomerInfo)tempCustomerManager.CustomerInfoGetByCustomerID(tempOrderInfo.CustomerID).Data; string printedText = txtKitchenText.Text; serialBody += "\r\n----------------------------------------"; if (tempOrderInfo.OrderType == "Table") { serialBody += "\r\n TABLE NO: " + tempOrderInfo.TableNumber; serialBody += "\r\n COVERS: " + tempOrderInfo.GuestCount.ToString(); } else { serialBody += "\r\nCUSTOMER NAME: " + tempCustomerInfo.CustomerName; serialBody += "\r\nPHONE: " + tempCustomerInfo.CustomerPhone; if (tempOrderInfo.Status.Equals("Delivery")) { CDelivery objDelivery = new CDelivery(); objDelivery.DeliveryOrderID = m_orderID; CResult objDeliveryInfo = tempOrderManager.GetDeliveryInfo(objDelivery); objDelivery = (CDelivery)objDeliveryInfo.Data; serialBody += "\r\nDELIVERY TIME:" + objDelivery.DeliveryTime; } } serialBody += "\r\n----------------------------------------"; serialBody += "\r\n TIME:" + DateTime.Now.ToString("hh:m tt"); serialBody += "\r\n----------------------------------------"; serialBody += "\r\n" + printedText.ToUpper(); serialBody += "\r\n----------------------------------------"; serialBody += "\r\nWaiter:" + RMSGlobal.LoginUserName; serialBody += "\r\n" + m_terminalName; CPrintingFormat tempPrintingFormat = new CPrintingFormat(); tempPrintingFormat.Header = serialHeader; tempPrintingFormat.Body = serialBody; tempPrintingFormat.Footer = serialFooter; tempPrintingFormat.PrintType = (int)PRINTER_TYPES.Serial; CLogin oLogin = new CLogin(); oLogin = (RmsRemote.CLogin)Activator.GetObject(typeof(RmsRemote.CLogin), oConstant.RemoteURL); oLogin.PostPrintingRequest(tempPrintingFormat); tempOrderManager.SaveOrderKitchenText(m_orderID, txtKitchenText.Text,1); this.DialogResult = DialogResult.OK; } } catch (Exception exp) { throw exp; } }
private void btnPrint_Click(object sender, EventArgs e) { try { if (dgvLogRecords.RowCount > 0) { String logBody = String.Empty; string serialFooter = ""; string serialHeader = ""; CCommonConstants oConstant = ConfigManager.GetConfig<CCommonConstants>(); logBody += "\r\n\r\n\t\tLog Register"; logBody += "\r\n-----------------------------------"; logBody += "\r\nTID OID UID Date & Time Activity"; logBody += "\r\n-----------------------------------"; for (int rowIndex = 0; rowIndex < dgvLogRecords.Rows.Count; rowIndex++) { logBody += "\r\n\r " + dgvLogRecords[0, rowIndex].Value.ToString(); logBody += " " + dgvLogRecords[1, rowIndex].Value.ToString(); logBody += " " + dgvLogRecords[2, rowIndex].Value.ToString(); logBody += " " +Convert.ToDateTime(dgvLogRecords[3, rowIndex].Value).ToString("dd/MM/yy hh:mmtt"); logBody += " " +Convert.ToDouble("0"+ dgvLogRecords[4, rowIndex].Value).ToString("F02"); } CPrintingFormat tempPrintingFormat = new CPrintingFormat(); tempPrintingFormat.Header = serialHeader; tempPrintingFormat.Body = logBody.ToUpper(); tempPrintingFormat.Footer = serialFooter; tempPrintingFormat.PrintType = (int)PRINTER_TYPES.Serial; CLogin oLogin = new CLogin(); oLogin = (RmsRemote.CLogin)Activator.GetObject(typeof(RmsRemote.CLogin), oConstant.RemoteURL); oLogin.PostPrintingRequest(tempPrintingFormat); } } catch (Exception exp) { } }
/// <summary> /// Collecting the printed copy of the respective order .added by Baruri at 13.12.2008 /// </summary> private void GetPrintedCopy(Int64 orderID, List<COrderDetails> tempOrderDetailsList) { string Cat1ID = String.Empty; try { CPrintMethods tempPrintMethods = new CPrintMethods(); int categoryID = 0; string serialHeader = "IBACS RMS"; string serialFooter = "Please Come Again"; string serialBody = ""; CSerialPrintContent tempSerialPrintContent = new CSerialPrintContent(); serialBody = " KITCHEN COPY\r\n"; COrderManager tempOrderManager = new COrderManager(); COrderInfo tempOrderInfo = (COrderInfo)tempOrderManager.OrderInfoByOrderID(orderID).Data;//order information for online orders serialBody += "\r\nOrder Date: " + tempOrderInfo.OrderTime.ToString("dd/MM/yy hh:mm tt"); serialBody += "\r\nPrint Date: " + System.DateTime.Now.ToString("dd/MM/yy hh:mm tt"); serialBody += "\r\nType: " + tempOrderInfo.Status; CCustomerManager tempCustomerManager = new CCustomerManager(); CCustomerInfo tempCustomerInfo = (CCustomerInfo)tempCustomerManager.CustomerInfoGetByCustomerID(tempOrderInfo.CustomerID).Data; serialBody += "\r\nCustomer Name: " + tempCustomerInfo.CustomerName; serialBody += "\r\nPhone: " + tempCustomerInfo.CustomerPhone; if (tempOrderInfo.Status.Equals("Delivery")) { serialBody += "\r\nAddress:"; serialBody += "\r\n----------------------------------------"; serialBody += "\r\nFloor or Apartment:" + tempCustomerInfo.FloorAptNumber; serialBody += "\r\nBuilding Name:" + tempCustomerInfo.BuildingName; serialBody += "\r\nHouse Number:" + tempCustomerInfo.HouseNumber; serialBody += "\r\nPhone:" + tempCustomerInfo.CustomerPhone; serialBody += "\r\nPostal Code:" + tempCustomerInfo.CustomerPostalCode; serialBody += "\r\nTown:" + tempCustomerInfo.CustomerTown; serialBody += "\r\nCountry:" + tempCustomerInfo.CustomerCountry; serialBody += "\r\n----------------------------------------"; } serialBody += "\r\nOrder Information"; serialBody += "\r\n----------------------------------------"; serialBody += "\r\nQty Item Price "; serialBody += "\r\n----------------------------------------"; if (tempOrderDetailsList.Count > 0) { for (int counter = 0; counter < tempOrderDetailsList.Count; counter++) { serialBody += "\r\n" + tempOrderDetailsList[counter].OrderQuantity.ToString() + " "; serialBody += CPrintMethods.GetFixedString(tempOrderDetailsList[counter].ItemName.ToString(), 30)+" "; serialBody += CPrintMethods.RightAlign(tempOrderDetailsList[counter].OrderAmount.ToString(), 6); // billTotal += Convert.ToDouble("0" + tempOrderDetailsList[j].OrderAmount); } } serialBody += "\r\n----------------------------------------"; //serialBody += "\r\n Order Total: " + billTotal.ToString("F02"); //serialBody += "\r\n Total Payable: " + billTotal.ToString("F02"); //serialBody += "\r\n----------------------------------------"; //serialBody += "\r\n S/N: " + tempOrderInfo.SerialNo.ToString(); //serialBody += "\r\nDeveloped by:ibacs limited."; serialBody += "\r\nThis is an online order."; serialBody += "\r\n [END] "; CCommonConstants oConstant = ConfigManager.GetConfig<CCommonConstants>(); CPrintingFormat tempPrintingFormat = new CPrintingFormat(); tempPrintingFormat.Header = serialHeader; tempPrintingFormat.Body = serialBody.ToUpper(); tempPrintingFormat.Footer = serialFooter; tempPrintingFormat.OrderID = orderID; tempPrintingFormat.PrintType = (int)PRINTER_TYPES.Serial; CLogin oLogin = new CLogin(); oLogin = (RmsRemote.CLogin)Activator.GetObject(typeof(RmsRemote.CLogin), oConstant.RemoteURL); oLogin.PostPrintingRequest(tempPrintingFormat); ///Update status /// if (tempOrderInfo.OrderType.Equals("Table")) { tempOrderInfo.Status = "Billed"; tempOrderInfo.OrderTime = System.DateTime.Now; tempOrderManager.UpdateOrderInfo(tempOrderInfo); CPaymentManager tempPaymentManager = new CPaymentManager(); CPayment tempPayment = new CPayment(); tempPayment.OrderID = tempOrderInfo.OrderID; tempPayment.BillPrintTime = DateTime.Now; tempPaymentManager.InsertBillPrintTime(tempPayment); } } catch (Exception exp) { } }
private void btnPrintSummary_Click(object sender, EventArgs e) { m_htFoods = new Hashtable(); m_htNonFoods = new Hashtable(); // FormatDataTime(); DataSet dsSalesRecords = new DataSet(); CResult objResult = new CResult(); SystemManager objSystemMgnr = new SystemManager(); DateTime dtNow = DateTime.Now; DateTime dtStart = new DateTime(dtNow.Year, dtNow.Month, dtNow.Day, 0, 0, 0); DateTime dtEnd = new DateTime(dtNow.Year, dtNow.Month, dtNow.Day, 23, 59, 59); //if (chkFromTime.Checked) //{ dtStart = new DateTime(dtStart.Year, dtStart.Month, dtStart.Day, 7, 0, 0); dtEnd = new DateTime(dtEnd.Year, dtEnd.Month, dtEnd.Day, 6, 59, 59); // } dtEnd = dtEnd.AddDays(1); objResult = objSystemMgnr.GetSalesRecordsForINV(dtStart.Ticks, dtEnd.Ticks); StringPrintFormater strPrintFormatter = new StringPrintFormater(40); DataTable dt = (DataTable)objResult.Data; tableReport = new DataTable(); tableReport.Columns.Add("product_id", typeof(int)); tableReport.Columns.Add("product_Name", typeof(string)); tableReport.Columns.Add("amount", typeof(string)); tableReport.Columns.Add("quantity", typeof(string)); tableReport.Columns.Add("TotalAmount", typeof(string)); tableReport.Columns.Add("guest_count", typeof(int)); tableReport.Columns.Add("cat_level", typeof(int)); tableReport.Columns.Add("food_type", typeof(string)); if (dt != null || dt.Rows.Count > 0) for (int i = 0; i < dt.Rows.Count; i++) { tableReport.Rows.Add(Convert.ToInt16(dt.Rows[i]["product_id"]), Convert.ToString(dt.Rows[i]["product_Name"]), dt.Rows[i]["amount"].ToString(), dt.Rows[i]["quantity"].ToString(), dt.Rows[i]["TotalAmount"].ToString(), Convert.ToInt16(dt.Rows[i]["guest_count"]), Convert.ToInt16(dt.Rows[i]["cat_level"]), dt.Rows[i]["food_type"].ToString()); } if (dataGridView1.Rows.Count > 0) if (tableReport.Rows.Count > 0) { // Int32 guestCounter = Convert.ToInt32(dsSalesRecords.Tables[0].Rows[0]["guest_count"]); Int32 guestCounter = Convert.ToInt32(tableReport.Rows[0]["guest_count"]); CPrintMethods tempPrintMethods = new CPrintMethods(); string serialHeader = RMSClientController.CollectHeader(); string serialFooter = RMSClientController.CollectFooter(); List<CSerialPrintContent> serialBody = new List<CSerialPrintContent>(); CSerialPrintContent tempSerialPrintContent = new CSerialPrintContent(); tempSerialPrintContent.StringLine = "\r\n" + strPrintFormatter.CenterTextWithWhiteSpace("Inventory Sales Report") + "\r\n"; serialBody.Add(tempSerialPrintContent); tempSerialPrintContent = new CSerialPrintContent(); tempSerialPrintContent.StringLine = strPrintFormatter.CenterTextWithWhiteSpace("Date of Consumption of Items:" + DateTime.Now.ToString("dd/MM/yyyy")) + "\r\n"; serialBody.Add(tempSerialPrintContent); //tempSerialPrintContent = new CSerialPrintContent(); //tempSerialPrintContent.StringLine = "No. of Covers:" + guestCounter.ToString() + "\n"; //serialBody.Add(tempSerialPrintContent); tempSerialPrintContent = new CSerialPrintContent(); tempSerialPrintContent.StringLine = strPrintFormatter.CreateDashedLine() +"\r\n"; serialBody.Add(tempSerialPrintContent); tempSerialPrintContent = new CSerialPrintContent(); tempSerialPrintContent.StringLine = "Qty Item Price(£)"+"\r\n"; serialBody.Add(tempSerialPrintContent); tempSerialPrintContent = new CSerialPrintContent(); tempSerialPrintContent.StringLine = strPrintFormatter.CreateDashedLine() + "\r\n"; serialBody.Add(tempSerialPrintContent); CCategory3DAO category3DAO = new CCategory3DAO(); SortedList slorderedFoodItems = new SortedList(); SortedList slorderedNonFoodItems = new SortedList(); //if (dsSalesRecords.Tables[0].Rows.Count > 0) if (tableReport.Rows.Count > 0) { // foreach (DataRow dtRrow in dsSalesRecords.Tables[0].Rows) foreach (DataRow dtRrow in tableReport.Rows) { clsOrderReport objOrderedItems = new clsOrderReport(); string[] returnedValue = GetProductName(dtRrow).Split(':'); // string productName = Convert.ToString(returnedValue[0]); string productName = ""; CCategory3 cat3 = category3DAO.GetAllCategory3ByCategory3ID(Convert.ToInt32(dtRrow["product_id"].ToString())); if (cat3 != null && cat3.Category3Name.Length>0) { productName = cat3.Category3Name; } else { productName = Convert.ToString(dtRrow["product_Name"].ToString()); // @hafiz } string cat1ID = Convert.ToString(returnedValue[1]); objOrderedItems.Quantity = Convert.ToInt32("0" + dtRrow["quantity"].ToString()); objOrderedItems.ItemName = productName; objOrderedItems.Price = Convert.ToDouble(dtRrow["TotalAmount"]); objOrderedItems.FoodTypeName = Convert.ToString(returnedValue[2]); Int32 category1OrderNumber = 0; if (cat1ID != "") { category1OrderNumber = this.GetCategory1OrderNumber(Convert.ToInt32(cat1ID)); objOrderedItems.OrderNumber = category1OrderNumber; string keyCode = category1OrderNumber + "-" + objOrderedItems.Quantity.ToString() + "-" + objOrderedItems.ItemName; if (Convert.ToString(dtRrow["food_type"]).Equals("Food")) //Separate food/nonfoods { m_htFoods.Add(keyCode, objOrderedItems); } else { m_htNonFoods.Add(keyCode, objOrderedItems); } } else { category1OrderNumber = maxOrder + 1; objOrderedItems.OrderNumber = category1OrderNumber; string keyCode = category1OrderNumber + "-" + objOrderedItems.Quantity.ToString() + "-" + objOrderedItems.ItemName; if (Convert.ToString(dtRrow["food_type"]).Equals("Food")) //Separate food/nonfoods { m_htFoods.Add(keyCode, objOrderedItems); } else { m_htNonFoods.Add(keyCode, objOrderedItems); } } } int separatorNumber = -1; NumericComparer nc = new NumericComparer(); slorderedFoodItems = new SortedList(m_htFoods, nc); //Creating the sorted list from the hash table. slorderedNonFoodItems = new SortedList(m_htNonFoods, nc); SortedList slMaster1 = new SortedList(); ArrayList arrListItems = null; foreach (DictionaryEntry objOrderedItems in slorderedFoodItems) { clsOrderReport objItem = (clsOrderReport)objOrderedItems.Value; string keyValue = objOrderedItems.Key.ToString(); string[] splitter = new string[0]; splitter = keyValue.Split('-'); if (separatorNumber != Convert.ToInt32(splitter[0])) { separatorNumber = Convert.ToInt32(splitter[0]); arrListItems = new ArrayList(); arrListItems.Add(objItem); slMaster1.Add(separatorNumber, arrListItems); } else { arrListItems.Add(objItem); separatorNumber = Convert.ToInt32(splitter[0]); } } PrintUtility printUtility = new PrintUtility(); ArrayList alReverseOrderedItem; foreach (DictionaryEntry deReverseOrderedItem in slMaster1) { alReverseOrderedItem = (ArrayList)deReverseOrderedItem.Value; alReverseOrderedItem.Reverse();//Reversing the current item order. foreach (clsOrderReport objOrderedItems in alReverseOrderedItem) { if (separatorNumber != objOrderedItems.OrderNumber) { tempSerialPrintContent = new CSerialPrintContent(); tempSerialPrintContent.StringLine = objOrderedItems.FoodTypeName + ":" +"\r\n"; serialBody.Add(tempSerialPrintContent); tempSerialPrintContent = new CSerialPrintContent(); //tempSerialPrintContent.StringLine += objOrderedItems.Quantity.ToString() + " "; //tempSerialPrintContent.StringLine += CPrintMethods.GetFixedString(objOrderedItems.ItemName, 30); //tempSerialPrintContent.StringLine += CPrintMethods.RightAlign(objOrderedItems.Price.ToString("F02"), 6); tempSerialPrintContent.StringLine = strPrintFormatter.ItemLabeledText(objOrderedItems.Quantity.ToString() + " " + printUtility.MultipleLine(objOrderedItems.ItemName, 32, objOrderedItems.Price.ToString("F02"), 37), ""); serialBody.Add(tempSerialPrintContent); separatorNumber = objOrderedItems.OrderNumber; } else { tempSerialPrintContent = new CSerialPrintContent(); //tempSerialPrintContent.StringLine += objOrderedItems.Quantity.ToString() + " "; //tempSerialPrintContent.StringLine += CPrintMethods.GetFixedString(objOrderedItems.ItemName, 30); //tempSerialPrintContent.StringLine += CPrintMethods.RightAlign(objOrderedItems.Price.ToString("F02"), 6); tempSerialPrintContent.StringLine = strPrintFormatter.ItemLabeledText(objOrderedItems.Quantity.ToString() + " " + printUtility.MultipleLine(objOrderedItems.ItemName, 32, objOrderedItems.Price.ToString("F02"), 37), ""); serialBody.Add(tempSerialPrintContent); } } } #region "Non food items" tempSerialPrintContent = new CSerialPrintContent(); tempSerialPrintContent.StringLine = strPrintFormatter.CenterTextWithDashed("Drinks") + "\r\n"; // tempSerialPrintContent.StringLine = "-----------------Drinks-----------------" + "\r\n"; serialBody.Add(tempSerialPrintContent); SortedList slMaster2 = new SortedList(); ArrayList arrListItemsNonFood = new ArrayList(); separatorNumber = -1; foreach (DictionaryEntry objOrderedNonFood in slorderedNonFoodItems) { clsOrderReport objItem = (clsOrderReport)objOrderedNonFood.Value; string keyValue = objOrderedNonFood.Key.ToString(); string[] splitter = new string[0]; splitter = keyValue.Split('-'); if (separatorNumber != Convert.ToInt32(splitter[0])) { separatorNumber = Convert.ToInt32(splitter[0]); arrListItemsNonFood = new ArrayList(); arrListItemsNonFood.Add(objItem); slMaster2.Add(separatorNumber, arrListItemsNonFood); } else { arrListItemsNonFood.Add(objItem); separatorNumber = Convert.ToInt32(splitter[0]); } } separatorNumber = -1; bool istrue = false; foreach (DictionaryEntry objNonFood in slMaster2) { ArrayList alNonFoods = (ArrayList)objNonFood.Value; alNonFoods.Reverse(); foreach (clsOrderReport objNonFoodItem in alNonFoods) { if (separatorNumber != objNonFoodItem.OrderNumber) { tempSerialPrintContent = new CSerialPrintContent(); // tempSerialPrintContent.StringLine = "----------------------------------------"; serialBody.Add(tempSerialPrintContent); if (tempSerialPrintContent != null && tempSerialPrintContent.StringLine.Equals("") && !istrue) { tempSerialPrintContent = new CSerialPrintContent(); tempSerialPrintContent.StringLine = objNonFoodItem.FoodTypeName + ":" +"\r\n"; serialBody.Add(tempSerialPrintContent); } tempSerialPrintContent = new CSerialPrintContent(); //tempSerialPrintContent.StringLine += objNonFoodItem.Quantity.ToString() + " "; //tempSerialPrintContent.StringLine += CPrintMethods.GetFixedString(objNonFoodItem.ItemName, 30); //tempSerialPrintContent.StringLine += CPrintMethods.RightAlign(objNonFoodItem.Price.ToString("F02"), 6); tempSerialPrintContent.StringLine = strPrintFormatter.ItemLabeledText(objNonFoodItem.Quantity.ToString() + " " + printUtility.MultipleLine(objNonFoodItem.ItemName, 32, objNonFoodItem.Price.ToString("F02"), 37), ""); serialBody.Add(tempSerialPrintContent); separatorNumber = objNonFoodItem.OrderNumber; istrue = true; } else { tempSerialPrintContent = new CSerialPrintContent(); //tempSerialPrintContent.StringLine += objNonFoodItem.Quantity.ToString() + " "; //tempSerialPrintContent.StringLine += CPrintMethods.GetFixedString(objNonFoodItem.ItemName, 30); //tempSerialPrintContent.StringLine += CPrintMethods.RightAlign(objNonFoodItem.Price.ToString("F02"), 6); tempSerialPrintContent.StringLine = strPrintFormatter.ItemLabeledText(objNonFoodItem.Quantity.ToString() + " " + printUtility.MultipleLine(objNonFoodItem.ItemName, 32, objNonFoodItem.Price.ToString("F02"), 37), ""); serialBody.Add(tempSerialPrintContent); } } } #endregion tempSerialPrintContent = new CSerialPrintContent(); tempSerialPrintContent.StringLine = "----------------------------------------\r\n"; serialBody.Add(tempSerialPrintContent); tempSerialPrintContent = new CSerialPrintContent(); tempSerialPrintContent.StringLine = "Total No Of Item: " + lblNoOfItemsSold.Text + "\r\n"; serialBody.Add(tempSerialPrintContent); tempSerialPrintContent = new CSerialPrintContent(); tempSerialPrintContent.StringLine = "Total Qty: " + lblTotalQty.Text + "\r\n"; serialBody.Add(tempSerialPrintContent); tempSerialPrintContent = new CSerialPrintContent(); tempSerialPrintContent.StringLine = "Total Item Amount: " + lblTotalAmount.Text + "\r\n"; serialBody.Add(tempSerialPrintContent); tempSerialPrintContent = new CSerialPrintContent(); tempSerialPrintContent.StringLine = strPrintFormatter.CreateDashedLine() + "\r\n"; serialBody.Add(tempSerialPrintContent); tempSerialPrintContent = new CSerialPrintContent(); //tempSerialPrintContent.StringLine = strPrintFormatter.CenterTextWithWhiteSpace("Developed By: www.ibacs.co.uk") + "\r\n\n"; serialBody.Add(tempSerialPrintContent); #region "Testing printing area" string printingObject = ""; for (int arrayIndex = 0; arrayIndex < serialBody.Count; arrayIndex++) { printingObject += serialBody[arrayIndex].StringLine.ToString(); } this.WriteString(printingObject);///Write to a file when print command is executed #endregion //@aamr Remote Print CCommonConstants m_oCommonConstants; m_oCommonConstants = ConfigManager.GetConfig<CCommonConstants>(); CLogin oLogin = new CLogin(); oLogin = (RmsRemote.CLogin)Activator.GetObject(typeof(RmsRemote.CLogin), m_oCommonConstants.RemoteURL); CResult oResult = oLogin.GetInitialDBStr(); Object o = oLogin.GetType(); CPrintingFormat inPrintRequest = new CPrintingFormat(); inPrintRequest.Header = "Header"; inPrintRequest.Footer = "Footer"; inPrintRequest.Body = "Hello Remote Printing..."; try { oLogin.PostPrintingRequest(inPrintRequest); PostPrintingRequest1(inPrintRequest); } catch (Exception ex) { } CPrintMethodsEXT tempPrintMethods1 = new CPrintMethodsEXT(); DataSet tempDataSet = new DataSet(); tempDataSet.ReadXml("Config/Print_Config.xml"); if (Convert.ToBoolean(tempDataSet.Tables[0].Rows[0]["IsGuestBillPrinterSerial"]) == true) { // tempPrintMethods.SerialPrint(PRINTER_TYPES.NORMAL_PRINTER, serialHeader, serialBody, serialFooter, "SN".ToString()); tempPrintMethods.SerialPrint(PRINTER_TYPES.NORMAL_PRINTER, serialHeader, printingObject, serialFooter, "SN".ToString()); } else { tempPrintMethods1.USBPrint(printingObject, PrintDestiNation.CLIENT, true); } } } else { MessageBox.Show("There is no record", RMSGlobal.MessageBoxTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); } }