Example #1
0
 private void btnTakeAway_Click_1(object sender, EventArgs e)
 {
     try
     {
         Button TakeAway     = (Button)sender;
         var    menuid       = Convert.ToInt32(TakeAway.Tag);
         var    departmentid = UserLoginModel.UserLoginInfo.DepartmentID;
         var    shiftid      = UserLoginModel.ShiffID;
         var    result       = PermissionService.GetPermissionByDepartment(departmentid, menuid);
         //frmTakeAway frm = new frmTakeAway();
         //frm.ShowDialog();
         if (result > 0)
         {
             if (shiftid > 0)
             {
                 frmTakeAway frm = new frmTakeAway();
                 this.picWarning.Show();
                 this.lbWarning.Show();
                 frm.ShowDialog();
             }
             else
             {
                 frmAgainShift frm = new frmAgainShift();
                 if (frmOpacity.ShowDialog(this, frm) == System.Windows.Forms.DialogResult.OK)
                 {
                     frmTakeAway frm1 = new frmTakeAway();
                     this.picWarning.Show();
                     this.lbWarning.Show();
                     frm1.ShowDialog();
                 }
             }
         }
         else
         {
             frmMessager frm = new frmMessager("Messenger", "You can not accept. Please contact admin");
             frmOpacity.ShowDialog(this, frm);
         }
     }
     catch (Exception ex)
     {
         LogPOS.WriteLog("frmMain:::::::::::::::::::::::::::::::btnTakeAway_Click_1::::::::::::::::::::::;" + ex.Message);
     }
 }
Example #2
0
        private void btnSendOrder_Click(object sender, EventArgs e)
        {
            try
            {
                if (OrderMain.isPrevOrder==1)
                {
                    OrderCompleted();
                }
                else
                {
                    GetListPrinter();
                    if (OrderMain.Status == PRINTBILL)
                    {
                        OrderCompleted();
                    }
                    else
                    {
                        if (OrderMain.ListOrderDetail.Count > 0)
                        {
                            int result = 0;
                            OrderMain.PrintType = 1;

                            result = OrderService.InsertOrder(OrderMain);
                            if (result == 1)
                            {
                                PrinterServer printServer = new PrinterServer();
                                printServer.PrintData(OrderMain, PrintData);
                                if (OrderMain.isTKA == 1)
                                {
                                    frmTakeAway frm = new frmTakeAway();
                                    //CallBackStatusOrderTKA(OrderMain);
                                    //frm.Show();
                                    this.Close();
                                }
                                else
                                {
                                    //CallBackStatusOrder(OrderMain);
                                    CallBackStatusOrderCancel();
                                    this.Close();
                                }

                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogPOS.WriteLog("btnSendOrder_Click::::::::::::::::::::::::::::::::::::::::::" + ex.Message);
            }
        }
Example #3
0
        private void btnPayMent_Click(object sender, EventArgs e)
        {
            //flags = WinAPI.AW_ACTIVATE | WinAPI.AW_HOR_POSITIVE;
            try
            {
                if (OrderMain.Status == 1)
                    OrderCompleted();
                else
                {
                    if (OrderMain.ListOrderDetail.Count > 0)
                    {
                        frmse.BindOrder(OrderMain);
                        frmPayMent frm = new frmPayMent(OrderMain, 1000, 131073);
                        if (frmOpacity.ShowDialog(this, frm) == System.Windows.Forms.DialogResult.OK)
                        {
                            GetListPaymentPrinter();
                            int result = 0;
                            OrderMain = frm.OrderMain;
                            OrderMain.PrintType = 2;
                            result = InvoiceService.InsertInvoice(OrderMain);

                            if (result == 1)
                            {
                                if (OrderMain.isNoPrintBill == 1)
                                {
                                    if (OrderMain.isTKA == 1)
                                    {
                                        this.Close();
                                        frmTakeAway frmTKA = new frmTakeAway();
                                        frmTKA.Show();

                                    }
                                    else
                                    {
                                        CallBackStatusOrderCancel();
                                        this.Close();
                                    }
                                }
                                else
                                {
                                    PrinterServer printServer = new PrinterServer();
                                    printServer.PrintData(OrderMain, PrintData);
                                    if (OrderMain.isTKA == 1)
                                    {
                                        this.Close();
                                        frmTakeAway frmTKA = new frmTakeAway();
                                        frmTKA.Show();

                                    }
                                    else
                                    {
                                        frmse.fullScreen();
                                        CallBackStatusOrderCancel();
                                        this.Close();
                                    }
                                }
                                foreach(PrinterModel item in PrintData)
                                {
                                    if (item.PrinterType == 4)
                                        Class.RawPrinterHelper.openCashDrawer(item.PrinterName);
                                }

                            }

                        }
                    }
                    else
                    {
                        frmMessager frm = new frmMessager("PayMent", "Order empty");
                        frmOpacity.ShowDialog(this, frm);
                    }
                }
            }
            catch (Exception ex)
            {
                LogPOS.WriteLog("frmOrder:::::::::::::::::::::::btnPayMent_Click::::::::::::::::;" + ex.Message);
            }
        }
Example #4
0
        private void btnTakeAway_Click_1(object sender, EventArgs e)
        {
            try
            {
                Button TakeAway = (Button)sender;
                var menuid = Convert.ToInt32(TakeAway.Tag);
                var departmentid = UserLoginModel.UserLoginInfo.DepartmentID;
                var shiftid = UserLoginModel.ShiffID;
                var result = PermissionService.GetPermissionByDepartment(departmentid, menuid);
                //frmTakeAway frm = new frmTakeAway();
                //frm.ShowDialog();
                if (result > 0)
                {
                    if (shiftid > 0)
                    {
                        frmTakeAway frm = new frmTakeAway();
                        this.picWarning.Show();
                        this.lbWarning.Show();
                        frm.ShowDialog();
                    }
                    else
                    {
                        frmAgainShift frm = new frmAgainShift();
                        if (frmOpacity.ShowDialog(this,frm) == System.Windows.Forms.DialogResult.OK)
                        {
                            frmTakeAway frm1 = new frmTakeAway();
                            this.picWarning.Show();
                            this.lbWarning.Show();
                            frm1.ShowDialog();
                        }
                    }

                }
                else
                {
                    frmMessager frm = new frmMessager("Messenger", "You can not accept. Please contact admin");
                    frmOpacity.ShowDialog(this, frm);
                }
            }
            catch (Exception ex)
            {
                LogPOS.WriteLog("frmMain:::::::::::::::::::::::::::::::btnTakeAway_Click_1::::::::::::::::::::::;" + ex.Message);
            }
        }