Esempio n. 1
0
        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;
                }
        }
Esempio n. 2
0
 private void btnAddOrder_Click(object sender, EventArgs e)
 {
     COrderManager tempOrderManager = new COrderManager();
     tempOrderManager.SaveOrderKitchenText(m_orderID,txtKitchenText.Text,0);
     this.Close();
 }