Ejemplo n.º 1
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            AppConfiguration a = new AppConfiguration();
            int  n             = InsertTempDataToMain(a.TerminalID);
            bool Flag          = CheckTokenPrintStatus(a.TerminalID);

            if (Flag == false)
            {
                for (int i = 0; i < 2; i++)
                {
                    ReadInvoice = false;
                    PrintReport(); // Print Invoice
                }
            }
            else
            {
                ReadInvoice = false;
                PrintReport(); // Print Invoice
            }

            this.Visible = false;
            this.Close();
            this.Hide();
            if (Application.OpenForms.OfType <frmOrder>().Any())
            {
                frmOrder frm = new frmOrder();
                frm.Visible = false;
                frm.Close();
                frm.Hide();
            }
            frmOrder frm1 = new frmOrder();

            frm1.Show();
        }
Ejemplo n.º 2
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            this.Hide();
            this.Close();
            if (Application.OpenForms.OfType <frmOrder>().Any())
            {
                frmOrder frm = new frmOrder();
                frm.Hide();
                frm.Close();
            }
            frmOrder frm1 = new frmOrder();

            frm1.Show();
        }
Ejemplo n.º 3
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (float.Parse(txtQuantity.Text) > 0)
            {
                InventryOrder    i   = new InventryOrder();
                AppConfiguration a   = new AppConfiguration();
                int   unit           = GetSelectedUnit();
                int   IsOutsideUP    = i.CustomerOutsideUP;
                float TotalTaxAmount = 0;
                float IGST           = 0;
                float CGST           = 0;
                float SGST           = 0;
                float IGSTAmount     = 0;
                float CGSTAmount     = 0;
                float SGSTAmount     = 0;
                float BaseAmount     = 0;
                if (unit == 1)
                {
                    BaseAmount = i.OrderItemBasePricePerKG;
                }
                else if (unit == 0)
                {
                    BaseAmount = i.OrderItemBasePricePerPiece;
                }

                float InventryAmount = (float.Parse(txtQuantity.Text.Trim()) * BaseAmount);

                if (IsOutsideUP == 1)
                {
                    IGST       = i.OrderIGST;
                    CGST       = i.OrderCGST;
                    SGST       = i.OrderSGST;
                    IGSTAmount = (InventryAmount * IGST) / 100;
                    CGSTAmount = 0;
                    SGSTAmount = 0;
                }
                else
                {
                    IGST       = i.OrderIGST;
                    CGST       = i.OrderCGST;
                    SGST       = i.OrderSGST;
                    IGSTAmount = 0;
                    CGSTAmount = (InventryAmount * CGST) / 100;
                    SGSTAmount = (InventryAmount * SGST) / 100;
                }
                TotalTaxAmount = IGSTAmount + CGSTAmount + SGSTAmount;
                bool ExistFlag = CheckDataExists(i.OrderItemID, a.TerminalID);
                if (ExistFlag == true)
                {
                    MessageBox.Show("This item is already exists in order!!", "Alert Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    int n = INSERT_NewOrder_Temp_DATA(0, i.OrderItemID, unit, BaseAmount, float.Parse(txtQuantity.Text.Trim()), InventryAmount,
                                                      TotalTaxAmount, 0, a.CounterID, a.TerminalID, i.OrderCustomerID, GetMacAddress(), IGST, CGST, SGST, IGSTAmount, CGSTAmount, SGSTAmount, i.OrderCustomerName);
                    if (n > 0)
                    {
//                        MessageBox.Show("New order has been successfully saved.", "Success Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.Visible = false;
                        this.Hide();
                        this.Close();
                        if (Application.OpenForms.OfType <frmOrder>().Any())
                        {
                            frmOrder frm = new frmOrder();
                            frm.Hide();
                            frm.Close();
                        }
                        frmOrder frm1 = new frmOrder();
                        frm1.Show();
                    }
                    else
                    {
                        MessageBox.Show("Failed to saved new order", "Alert Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            btnPoint.Enabled = true;
        }