예제 #1
0
파일: CPcInfoDAO.cs 프로젝트: Jusharra/RMS
        CPcInfo ReaderToPcInfo(IDataReader inReader)
        {
            CPcInfo tempPcInfo = new CPcInfo();

            if (inReader["pc_id"] != null)
                tempPcInfo.PcID =Int32.Parse( inReader["pc_id"].ToString());

            if (inReader["pc_ip"] != null)
                tempPcInfo.PcIP = inReader["pc_ip"].ToString();

            if (inReader["name"] != null)
                tempPcInfo.Name = inReader["name"].ToString();
            return tempPcInfo;
        }
예제 #2
0
파일: CPcInfoDAO.cs 프로젝트: Jusharra/RMS
 public CPcInfo PcInfoByPcIP(String inPcIP)
 {
     CPcInfo tempPcInfo = new CPcInfo();
     try
     {
         this.OpenConnection();
         string sSql = String.Format(SqlQueries.GetQuery(Query.PcInfoByPcIP), inPcIP);
         IDataReader oReader = this.ExecuteReader(sSql);
         if (oReader != null)
         {
             while (oReader.Read())
             {
                 tempPcInfo = ReaderToPcInfo(oReader);
             }
         }
     }
     catch (Exception ex)
     {
         Logger.Write("Exception : " + ex + " in PcInfoByPcIP()", LogLevel.Error, "Database");
         if (ex.GetType().Equals(typeof(SqlException)))
         {
             SqlException oSQLEx = ex as SqlException;
             if (oSQLEx.Number != 7619)
                 throw new Exception("Exception occured at PcInfoByPcIP()", ex);
         }
         else
         {
             throw new Exception("Exception occure at PcInfoByPcIP()", ex);
         }
     }
     finally
     {
         this.CloseConnection();
     }
     return tempPcInfo;
 }
예제 #3
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            try
            {
                CDepositManager tempDepositManager = new CDepositManager();
                CDeposit tempDeposit = new CDeposit();

                Double tempCash = 0.000;
                Double tempEFT = 0.000;
                Double tempCheque = 0.000;
                Double tempAccount = 0.000;
                Double tempTotal = 0.000;

                Double.TryParse(g_CashLabel.Text.Substring(1), out tempCash);
                Double.TryParse(g_EFTLabel.Text.Substring(1), out tempEFT);
                Double.TryParse(g_ChequeLabel.Text.Substring(1), out tempCheque);
                Double.TryParse(g_AccountLabel.Text.Substring(1), out tempAccount);
                Double.TryParse(g_DepositTotalLabel.Text.Substring(1), out tempTotal);

                if (tempTotal == 0)
                {
                    MessageBox.Show("Zero amount given for deposit. Please recheck", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                tempDeposit.DepositBalance = tempTotal;
                tempDeposit.DepositTime = DateTime.Now.Ticks;
                tempDeposit.CustomerID=m_iCustomerID;
                tempDeposit.DepositTotalAmount = tempTotal;
                tempDeposit.DepositType = m_sDepositType;
                tempDeposit.Status = 1;

                CPcInfoManager tempPcInfoManager = new CPcInfoManager();
                IPHostEntry ipEntry = System.Net.Dns.GetHostByName(Dns.GetHostName());
                CPcInfo tempPcInfo=new CPcInfo();
                CResult oResult= tempPcInfoManager.PcInfoByPcIP(ipEntry.AddressList[0].ToString());
                if (oResult.IsSuccess && oResult.Data != null)
                {
                    tempPcInfo = (CPcInfo)oResult.Data;
                }
                tempDeposit.PcID = tempPcInfo.PcID;

                oResult = tempDepositManager.InsertDeposit(tempDeposit);
                if (oResult.IsSuccess && oResult.Data != null)
                {
                    tempDeposit = (CDeposit)oResult.Data;
                }

                //get customer name & phone
                CCustomerManager tempCustomerManager= new CCustomerManager();
                CCustomerInfo tempCustomerInfo= new CCustomerInfo();
                oResult = tempCustomerManager.CustomerInfoGetByCustomerID(m_iCustomerID);
                if(oResult.IsSuccess && oResult.Data!=null)
                {
                    tempCustomerInfo = (CCustomerInfo)oResult.Data;
                }

                //string serialBody = "\r\n         Deposit Token\r\n";
                //serialBody += "\r\n         Customer Name: "+tempCustomerInfo.CustomerName;
                //serialBody += "\r\n         Phone: " + tempCustomerInfo.CustomerPhone+"\r\n";

                //serialBody += "\r\n         By " + tempDeposit.DepositType;
                //serialBody += "\r\n---------------------------------";
                //serialBody += "\r\n         Total: " + tempDeposit.DepositBalance.ToString("F02");
                //serialBody += "\r\n";
                //serialBody += "\r\nS/N: " + tempDeposit.DepositID.ToString();

                string serialBody = "\r\n                Deposit Token\r\n";
                DateTime tempODate = new DateTime(tempDeposit.DepositTime);
                string tempODateString = "Deposit Date: " + tempODate.ToLongDateString();
                serialBody += "".PadRight((int)((45 - tempODateString.Length) / 2), ' ') + tempODateString.Trim() + "\r\n";
                string tempDateString = "Reprint Date: " + DateTime.Now.ToLongDateString();
                serialBody += "".PadRight((int)((45 - tempDateString.Length) / 2), ' ') + tempDateString.Trim() + "\r\n\r\n";
                serialBody += "Customer Name: " + tempCustomerInfo.CustomerName + "\r\n";
                string tempAddressString = "Customer Address: " + tempCustomerInfo.CustomerAddress.Trim();
                if (tempAddressString.Length > 40)
                {
                    tempAddressString = tempAddressString.Substring(0, 40) + "\r\n".PadRight(19, ' ') + tempAddressString.Substring(40);
                }
                serialBody += tempAddressString + "\r\n";
                serialBody += "Phone: " + tempCustomerInfo.CustomerPhone + "\r\n\r\n";
                serialBody += "Deposit Type:     " + tempDeposit.DepositType + "\r\n";
                serialBody += "Deposited Amount: " + tempDeposit.DepositTotalAmount.ToString("F02") + "\r\n";
                double tempDepositUsed = (tempDeposit.DepositTotalAmount - tempDeposit.DepositBalance);
                serialBody += "Deposit Used:     " + tempDepositUsed.ToString("F02") + "\r\n";
                serialBody += "---------------------------------\r\n";
                serialBody += "Total Balance:    " + tempDeposit.DepositBalance.ToString("F02") + "\r\n\r\n";
                serialBody += "S/N: " + tempDeposit.DepositID.ToString() + "\r\n";

                CPrintMethods tempPrintMethods = new CPrintMethods();
                tempPrintMethods.SerialPrint(PRINTER_TYPES.NORMAL_PRINTER,"",serialBody,"",tempDeposit.DepositID.ToString());
                this.Close();

            }
            catch (Exception eee)
            {
            }
        }
예제 #4
0
        private void PrintBeverageVoidItems()
        {
            string Cat1ID = String.Empty;
            bool itemAvailable = false;
            try
            {
                StringPrintFormater strPrintFormatter = new StringPrintFormater(29);
                int papersize = 29;

                CPrintMethodsEXT tempPrintMethods = new CPrintMethodsEXT();

                string serialHeader = "";
                string serialFooter = "";

                COrderManager tempOrderManager = new COrderManager();
                COrderInfo tempOrderInfo = (COrderInfo)tempOrderManager.OrderInfoByOrderID(m_orderID).Data;
                List<CSerialPrintContent> serialBody = new List<CSerialPrintContent>();
                CSerialPrintContent tempSerialPrintContent = new CSerialPrintContent();

                if ("Table" == tempOrderInfo.OrderType)
                {
                    //tempSerialPrintContent = new CSerialPrintContent();
                    //tempSerialPrintContent.StringLine = "Order Date: " + tempOrderInfo.OrderTime.ToString("dd/MM/yy hh:mm tt");
                    //serialBody.Add(tempSerialPrintContent);

                    //tempSerialPrintContent = new CSerialPrintContent();
                    //tempSerialPrintContent.StringLine = "Print Date:" + System.DateTime.Now.ToString("dd/MM/yy  hh:mm tt");
                    //serialBody.Add(tempSerialPrintContent);

                    tempSerialPrintContent = new CSerialPrintContent();
                    tempSerialPrintContent.StringLine = "\r\n\r\nTable No:" + tempOrderInfo.TableNumber.ToString() + "\r\n";
                    tempSerialPrintContent.Bold = true;
                    serialBody.Add(tempSerialPrintContent);

                    tempSerialPrintContent = new CSerialPrintContent();
                    tempSerialPrintContent.StringLine = "COVERS:" + tempOrderInfo.GuestCount.ToString() + "\r\n";
                    tempSerialPrintContent.Bold = true;
                    serialBody.Add(tempSerialPrintContent);
                }

                 tempSerialPrintContent = new CSerialPrintContent();
                tempSerialPrintContent.StringLine = "           Void Beverages/Non-Foods\n";
                serialBody.Add(tempSerialPrintContent);

                if ("Table" == tempOrderInfo.OrderType)
                {
                    tempSerialPrintContent = new CSerialPrintContent();
                    tempSerialPrintContent.StringLine = "Order Date: " + tempOrderInfo.OrderTime.ToString("dd/MM/yy hh:mm tt");
                    serialBody.Add(tempSerialPrintContent);

                    tempSerialPrintContent = new CSerialPrintContent();
                    tempSerialPrintContent.StringLine = "Print Date:" + System.DateTime.Now.ToString("dd/MM/yy  hh:mm tt");
                    serialBody.Add(tempSerialPrintContent);

                    //tempSerialPrintContent = new CSerialPrintContent();
                    //tempSerialPrintContent.StringLine = "Table No:" + tempOrderInfo.TableNumber.ToString() + "\r\n";
                    //tempSerialPrintContent.Bold = true;
                    //serialBody.Add(tempSerialPrintContent);

                    //tempSerialPrintContent = new CSerialPrintContent();
                    //tempSerialPrintContent.StringLine = "COVERS:" + tempOrderInfo.GuestCount.ToString() + "\r\n";
                    //tempSerialPrintContent.Bold = true;
                    //serialBody.Add(tempSerialPrintContent);
                }
                else if ("TakeAway" == tempOrderInfo.OrderType)
                {

                    tempSerialPrintContent = new CSerialPrintContent();
                    tempSerialPrintContent.StringLine = "Order Date: " + tempOrderInfo.OrderTime.ToString("dd/MM/yy hh:mm tt");
                    serialBody.Add(tempSerialPrintContent);

                    tempSerialPrintContent = new CSerialPrintContent();
                    tempSerialPrintContent.StringLine = "Print Date: " + System.DateTime.Now.ToString("dd/MM/yy  hh:mm tt");
                    serialBody.Add(tempSerialPrintContent);

                    tempSerialPrintContent = new CSerialPrintContent();
                    tempSerialPrintContent.StringLine = "Type: " + tempOrderInfo.Status;
                    serialBody.Add(tempSerialPrintContent);

                    CCustomerManager tempCustomerManager = new CCustomerManager();
                    CCustomerInfo tempCustomerInfo = (CCustomerInfo)tempCustomerManager.CustomerInfoGetByCustomerID(tempOrderInfo.CustomerID).Data;

                    tempSerialPrintContent = new CSerialPrintContent();
                    tempSerialPrintContent.StringLine = "Customer Name: " + tempCustomerInfo.CustomerName;
                    serialBody.Add(tempSerialPrintContent);

                    tempSerialPrintContent = new CSerialPrintContent();
                    tempSerialPrintContent.StringLine = "Phone:" + tempCustomerInfo.CustomerPhone;
                    serialBody.Add(tempSerialPrintContent);

                    if (tempOrderInfo.Status.Equals("Delivery"))
                    {
                        tempSerialPrintContent = new CSerialPrintContent();
                        tempSerialPrintContent.StringLine = "Address:";
                        serialBody.Add(tempSerialPrintContent);

                        tempSerialPrintContent = new CSerialPrintContent();
                        tempSerialPrintContent.StringLine = "----------------------------------------";
                        serialBody.Add(tempSerialPrintContent);

                        if (tempCustomerInfo.FloorAptNumber.Length > 0)
                        {
                            tempSerialPrintContent = new CSerialPrintContent();
                            tempSerialPrintContent.StringLine = "Floor or Apartment:" + tempCustomerInfo.FloorAptNumber;
                            serialBody.Add(tempSerialPrintContent);
                        }

                        if (tempCustomerInfo.BuildingName.Length > 0)
                        {
                            tempSerialPrintContent = new CSerialPrintContent();
                            tempSerialPrintContent.StringLine = "Building Name:" + tempCustomerInfo.BuildingName;
                            serialBody.Add(tempSerialPrintContent);
                        }

                        if (tempCustomerInfo.HouseNumber.Length > 0)
                        {
                            tempSerialPrintContent = new CSerialPrintContent();
                            tempSerialPrintContent.StringLine = "House Number:" + tempCustomerInfo.HouseNumber;
                            serialBody.Add(tempSerialPrintContent);
                        }

                        string[] street = new string[0];
                        street = tempCustomerInfo.StreetName.Split('-');

                        if (street.Length > 1)
                        {
                            if (street[0].ToString().Length > 0)
                            {
                                tempSerialPrintContent = new CSerialPrintContent();
                                tempSerialPrintContent.StringLine = "Street:" + street[0].ToString();
                                serialBody.Add(tempSerialPrintContent);
                            }

                            if (street[1].ToString().Length > 0)
                            {
                                tempSerialPrintContent = new CSerialPrintContent();
                                tempSerialPrintContent.StringLine = street[1].ToString();
                                serialBody.Add(tempSerialPrintContent);
                            }
                        }
                        else if (street.Length > 0 && street.Length < 2)
                        {
                            if (street[0].ToString().Length > 0)
                            {
                                tempSerialPrintContent = new CSerialPrintContent();
                                tempSerialPrintContent.StringLine = "Street:" + street[0].ToString();
                                serialBody.Add(tempSerialPrintContent);
                            }
                        }

                        if (tempCustomerInfo.CustomerPostalCode.Length > 0)
                        {
                            tempSerialPrintContent = new CSerialPrintContent();
                            tempSerialPrintContent.StringLine = "Postal Code:" + tempCustomerInfo.CustomerPostalCode;
                            serialBody.Add(tempSerialPrintContent);
                        }
                        if (tempCustomerInfo.CustomerTown.Length > 0)
                        {
                            tempSerialPrintContent = new CSerialPrintContent();
                            tempSerialPrintContent.StringLine = "Town:" + tempCustomerInfo.CustomerTown;
                            serialBody.Add(tempSerialPrintContent);
                        }

                        tempSerialPrintContent = new CSerialPrintContent();
                        tempSerialPrintContent.StringLine = "----------------------------------------";
                        serialBody.Add(tempSerialPrintContent);

                        CDelivery objDelivery = new CDelivery();
                        objDelivery.DeliveryOrderID = m_orderID;
                        CResult objDeliveryInfo = tempOrderManager.GetDeliveryInfo(objDelivery);
                        objDelivery = (CDelivery)objDeliveryInfo.Data;
                        if (objDelivery != null)
                        {
                            tempSerialPrintContent = new CSerialPrintContent();
                            tempSerialPrintContent.StringLine = "\r\nDelivery Time:" + objDelivery.DeliveryTime;
                            serialBody.Add(tempSerialPrintContent);
                        }
                    }
                }

                tempSerialPrintContent = new CSerialPrintContent();
                tempSerialPrintContent.StringLine = "Order Information";
                serialBody.Add(tempSerialPrintContent);

                tempSerialPrintContent = new CSerialPrintContent();
                tempSerialPrintContent.StringLine = "----------------------------------------";
                serialBody.Add(tempSerialPrintContent);

                tempSerialPrintContent = new CSerialPrintContent();

                tempSerialPrintContent.StringLine = "Item                           Qty";
                serialBody.Add(tempSerialPrintContent);

                tempSerialPrintContent = new CSerialPrintContent();
                tempSerialPrintContent.StringLine = "----------------------------------------";
                serialBody.Add(tempSerialPrintContent);

                    Hashtable htOrderedItems = new Hashtable();
                    string categoryOrder = String.Empty;
                    PrintUtility printUtility = new PrintUtility();
                    foreach(ListViewItem lsvItem in lsvRemovable.Items)
                    {
                        if (lsvItem.SubItems[5].Text.ToString().Replace(" ", "").ToUpper() == "NonFood".Replace(" ", "").ToUpper())
                        {
                            tempSerialPrintContent = new CSerialPrintContent();
                         //   tempSerialPrintContent.StringLine = "(Void)" + lsvItem.Text.ToString() + "  ";
                        //    tempSerialPrintContent.StringLine += CPrintMethods.GetFixedString(lsvItem.SubItems[1].Text.ToString(), 30);

                            tempSerialPrintContent.StringLine = strPrintFormatter.ItemLabeledText(
                                          printUtility.MultipleLine("(Void)" + lsvItem.Text + "  ", papersize - 5, lsvItem.SubItems[1].Text.ToString(), papersize), "");

                            serialBody.Add(tempSerialPrintContent);
                            itemAvailable = true;

                       //     tempSerialPrintContent.StringLine +=
                       //                                strPrintFormatter.ItemLabeledText(
                       //                             printUtility.MultipleLine(objReport.ItemName.ToString(), papersize - 32, priceString, papersize), "");

                        }
                    }

                tempSerialPrintContent = new CSerialPrintContent();
                tempSerialPrintContent.StringLine = "----------------------------------------";
                serialBody.Add(tempSerialPrintContent);

                //New at 22.08.2008
                tempSerialPrintContent = new CSerialPrintContent();
                tempSerialPrintContent.StringLine = "Order Prepared By :" + RMSGlobal.LoginUserName;
                serialBody.Add(tempSerialPrintContent);

                CPcInfoManager tempPcInfoManager = new CPcInfoManager();
                IPHostEntry ipEntry = System.Net.Dns.GetHostByName(Dns.GetHostName());
                CResult objResult = tempPcInfoManager.PcInfoByPcIP(ipEntry.AddressList[0].ToString());
                CPcInfo tempPcInfo = new CPcInfo();
                if (objResult.IsSuccess && objResult.Data != null)
                {
                    tempPcInfo = (CPcInfo)objResult.Data;
                }

                tempSerialPrintContent = new CSerialPrintContent();
                tempSerialPrintContent.StringLine = tempPcInfo.Name.Trim();
                serialBody.Add(tempSerialPrintContent);

                if (itemAvailable == true) //If there is items for printing
                {
                    for (int printCopy = 0; printCopy < m_barPrintedCopy; printCopy++)
                    {
                       // tempPrintMethods.SerialPrint(PRINTER_TYPES.NORMAL_PRINTER, serialHeader, serialBody, serialFooter, tempOrderInfo.SerialNo.ToString());
                    }

                    string printingObject = ""; //Write to the text file
                    for (int arrayIndex = 0; arrayIndex < serialBody.Count; arrayIndex++)
                    {
                        printingObject += serialBody[arrayIndex].StringLine.ToString() + "\r\n";
                    }

                    tempPrintMethods.USBPrint(printingObject, PrintDestiNation.BEVARAGE, false);
                    this.WriteString(printingObject);///Write to a file when print command is executed
                }
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message, RMSGlobal.MessageBoxTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #5
0
        private void KitchenPrintVoidCopy()
        {
            Hashtable htOrderedItems = new Hashtable();
            bool itemAvailable = false;
            try
            {
                CPrintMethodsEXT tempPrintMethods = new CPrintMethodsEXT();
                CCommonConstants oConstant = ConfigManager.GetConfig<CCommonConstants>();
                COrderManager tempOrderManager = new COrderManager();
                CResult oResult = tempOrderManager.OrderInfoByOrderID(m_orderID);
                COrderInfo tempOrderInfo = new COrderInfo();

                StringPrintFormater strPrintFormatter = new StringPrintFormater(29);
              int   papersize = 29;

                if (oResult.IsSuccess && oResult.Data != null)
                {
                    tempOrderInfo = (COrderInfo)oResult.Data;
                }

                string serialHeader = "";
                string serialFooter = "";
                string serialBody = "";

                if ("Table" == tempOrderInfo.OrderType)
                {
                    serialBody += "\r\n\r\nTable NO:" + tempOrderInfo.TableNumber.ToString();
                    serialBody += "\r\nCovers:" + tempOrderInfo.GuestCount.ToString();
                }

                serialBody += "\r\n           Kitchen Copy";

                if (!tempOrderInfo.Status.Equals("Seated") && "Table"== tempOrderInfo.OrderType)
                {
                    serialBody += "\r\nReprint";
                }
                serialBody += "\r\n\r\nOrdered Date:" + tempOrderInfo.OrderTime.ToString("dd/MM/yy hh:mm tt");
                serialBody += "\r\nPrint Date: " + DateTime.Now.ToString("dd/MM/yy hh:mm tt");

                if ("Table" == tempOrderInfo.OrderType)
                {
                    //serialBody += "\r\n\r\nTable NO:" + tempOrderInfo.TableNumber.ToString();
                    //serialBody += "\r\nCovers:" + tempOrderInfo.GuestCount.ToString();
                }
                else if ("TakeAway" == tempOrderInfo.OrderType)
                {
                    serialBody += "\r\n\r\n        Take Away";
                    serialBody += "\r\n       Type: " + tempOrderInfo.Status;
                    CCustomerManager tempCustomerManager = new CCustomerManager();
                    CCustomerInfo tempCustomerInfo = (CCustomerInfo)tempCustomerManager.CustomerInfoGetByCustomerID(tempOrderInfo.CustomerID).Data;
                    serialBody += "\r\n Customer Name: " + tempCustomerInfo.CustomerName;
                    serialBody += "\r\nPhone:" + tempCustomerInfo.CustomerPhone;

                    if (tempOrderInfo.Status.Equals("Delivery"))
                    {
                        serialBody += "\r\nAddress:";
                        if (tempCustomerInfo.FloorAptNumber.Length > 0)
                        {
                            serialBody += "\r\nFloor or Apartment:" + tempCustomerInfo.FloorAptNumber;
                        }
                        if (tempCustomerInfo.BuildingName.Length > 0)
                        {
                            serialBody += "\r\nBuilding Name:" + tempCustomerInfo.BuildingName;
                        }
                        if (tempCustomerInfo.HouseNumber.Length > 0)
                        {
                            serialBody += "\r\nHouse Number:" + tempCustomerInfo.HouseNumber;
                        }
                        string[] street = new string[0];
                        street = tempCustomerInfo.StreetName.Split('-');

                        if (street.Length > 1)
                        {
                            if (street[0].ToString().Length > 0)
                            {
                                serialBody += "\r\nStreet:" + street[0].ToString();
                            }
                            if (street[1].ToString().Length > 0)
                            {
                                serialBody += "\r\n" + street[1].ToString();
                            }
                        }
                        else if (street.Length > 0 && street.Length < 2)
                        {
                            if (street[0].ToString().Length > 0)
                            {
                                serialBody += "\r\nStreet:" + street[0].ToString();
                            }
                        }
                        if (tempCustomerInfo.CustomerPostalCode.Length > 0)
                        {
                            serialBody += "\r\nPostal Code:" + tempCustomerInfo.CustomerPostalCode;
                        }
                        if (tempCustomerInfo.CustomerTown.Length > 0)
                        {
                            serialBody += "\r\nTown:" + tempCustomerInfo.CustomerTown;
                        }
                        serialBody += "\r\n----------------------------------------";
                        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\r\nOrder Information";
                serialBody += "\r\n---------------------------------";

                serialBody += "\r\n Item                       Qty";
                serialBody += "\r\n---------------------------------";

                PrintUtility printUtility = new PrintUtility();

                foreach (ListViewItem lsvItem in lsvRemovable.Items)
                {
                    if (lsvItem.SubItems[5].Text.Replace(" ", "").ToUpper() == "Food".Replace(" ", "").ToUpper())
                    {
                    //    serialBody += "\r\n(Void)" + CPrintMethods.GetFixedString(lsvItem.Text, 20) + "  ";
                      // serialBody += lsvItem.SubItems[0].Text;
                        itemAvailable = true;

                        serialBody += "\r\n" +  strPrintFormatter.ItemLabeledText(
                                                    printUtility.MultipleLine("(Void)" + lsvItem.Text + "  ", papersize - 5, lsvItem.SubItems[1].Text.ToString(), papersize), "");

                    }
                }
                serialBody += "\r\n---------------------------------";

                serialBody += "\r\nOrder Prepared By:" + RMSGlobal.LoginUserName;

                CPcInfoManager tempPcInfoManager = new CPcInfoManager();
                IPHostEntry ipEntry = System.Net.Dns.GetHostByName(Dns.GetHostName());
                CResult objResult = tempPcInfoManager.PcInfoByPcIP(ipEntry.AddressList[0].ToString());
                CPcInfo tempPcInfo = new CPcInfo();
                if (objResult.IsSuccess && objResult.Data != null)
                {
                    tempPcInfo = (CPcInfo)objResult.Data;
                }

                serialBody += "\r\nTerminal Name:" + tempPcInfo.Name;

                serialBody += "\r\n\r\n          [ E N D ]\r\n\r\n";

                CPrintingFormat tempPrintingFormat = new CPrintingFormat();
                tempPrintingFormat.Header = serialHeader;
                tempPrintingFormat.Body = serialBody.ToUpper();
                tempPrintingFormat.Footer = serialFooter;
                tempPrintingFormat.OrderID = m_orderID;
                tempPrintingFormat.PrintType = (int)PRINTER_TYPES.Serial;

                if (itemAvailable == true)
                {
                    CLogin oLogin = new CLogin();
                    oLogin = (RmsRemote.CLogin)Activator.GetObject(typeof(RmsRemote.CLogin), oConstant.RemoteURL);

                    for (int printCopy = 0; printCopy < m_printedCopy; printCopy++)
                    {
                       // oLogin.PostPrintingRequest(tempPrintingFormat);

                        tempPrintMethods.USBPrint(serialBody, PrintDestiNation.KITCHEN, false);

                    }
                    this.WriteString(serialBody);//Writing to the specified file
                }
            }
            catch (Exception exp)
            {
                throw exp;
            }
        }
예제 #6
0
 private void CTableOrderForm_Activated(object sender, EventArgs e)
 {
     try
     {
         CPcInfoManager tempPcInfoManager = new CPcInfoManager();
         IPHostEntry ipEntry = System.Net.Dns.GetHostByName(Dns.GetHostName());
         CResult oResult = tempPcInfoManager.PcInfoByPcIP(ipEntry.AddressList[0].ToString());
         CPcInfo tempPcInfo = new CPcInfo();
         if (oResult.IsSuccess && oResult.Data != null)
         {
             tempPcInfo = (CPcInfo)oResult.Data;
         }
         m_TerminalName = "Terminal Name:" + tempPcInfo.Name;
         this.SetPrintedItemBackColor();
     }
     catch (Exception exp)
     {
         Console.Write(exp.Message);
     }
 }
예제 #7
0
        private void g_CashButton_Click(object sender, EventArgs e)
        {
            try
            {
                Double tempTotal = Double.Parse(g_BalanceLabel.Text);
                Double tempInput = Double.Parse(g_InputTextBox.Text.Substring(1));
                if (tempTotal > tempInput)
                {
                    CMessageBox tempMessageBox = new CMessageBox("Error", "Paid Amount less than Balance Amount.");
                    tempMessageBox.ShowDialog();
                    return;
                }

                CPaymentManager tempPaymentManager = new CPaymentManager();

                ///insert into payment table
                CPayment tempPayment = new CPayment();
                tempPayment.OrderID = orderID;

                //get pc id from pc ip
                CPcInfoManager tempPcInfoManager = new CPcInfoManager();
                IPHostEntry ipEntry = System.Net.Dns.GetHostByName(Dns.GetHostName());
                CResult oResult = tempPcInfoManager.PcInfoByPcIP(ipEntry.AddressList[0].ToString());
                CPcInfo tempPcInfo = new CPcInfo();
                if (oResult.IsSuccess && oResult.Data != null)
                {
                    tempPcInfo = (CPcInfo)oResult.Data;
                }

                tempPayment.PcID = tempPcInfo.PcID;
                tempPayment.TotalAmount = Double.Parse(g_BalanceLabel.Text);
                tempPayment.CashAmount = tempPayment.TotalAmount;
                tempPayment.PaymentTime = System.DateTime.Now;

                oResult = tempPaymentManager.InsertPayment(tempPayment);
                if (oResult.IsSuccess && oResult.Data != null)
                {
                    tempPayment = (CPayment)oResult.Data;
                }

                ////update order info status
                COrderManager tempOrderManager = new COrderManager();
                COrderInfo tempOrderInfo = (COrderInfo)tempOrderManager.OrderInfoByOrderID(orderID).Data;
                //tempOrderInfo.Status = "Paid";
                //tempOrderManager.UpdateOrderInfo(tempOrderInfo);

                //opening cash drawer
                try
                {
                    CPrintMethods tempPrintMethods = new CPrintMethods();
                    tempPrintMethods.OpenDrawer();
                }
                catch (Exception eee)
                {
                }

                //archiving
                tempOrderManager.InsertOrderArchive(tempOrderInfo);
                tempOrderManager.InsertOrderDetailsArchive(tempOrderInfo);
                tempOrderManager.DeleteTableInfo(tempOrderInfo.TableNumber, "Tabs");
                Reload();
            }
            catch (Exception eee)
            {
            }
        }
예제 #8
0
파일: CMainForm.cs 프로젝트: Jusharra/RMS
        private void LoadStatusBar(int openOrders)
        {
            CCommonConstants oConstants = ConfigManager.GetConfig<CCommonConstants>();
            UserStatusLabel.Text = " Logged in as "+oConstants.UserInfo.UserName+" ";
            OpenOrdersLabel.Text = " "+openOrders + " Open Orders";

            CPcInfoManager tempPcInfoManager = new CPcInfoManager();
            IPHostEntry ipEntry = System.Net.Dns.GetHostByName(Dns.GetHostName());
            CResult oResult = tempPcInfoManager.PcInfoByPcIP(ipEntry.AddressList[0].ToString());
            CPcInfo tempPcInfo = new CPcInfo();
            if (oResult.IsSuccess && oResult.Data != null)
            {
                tempPcInfo = (CPcInfo)oResult.Data;
            }
            TerminalIDLabel.Text = " Terminal ID: " + tempPcInfo.Name+" ";
            RMSGlobal.Terminal_Id = tempPcInfo.PcID;
        }