Exemplo n.º 1
0
        private void sbQuotation_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.validateForm() == "Success")
                {
                    DialogResult dr = MessageBox.Show("Are you sure you want to generate quotation for this items?", "Confirm!", MessageBoxButtons.YesNo,
                                                      MessageBoxIcon.Information);

                    if (dr == DialogResult.Yes)
                    {
                        if (SalesQuotation())
                        {
                            AppConstant.ReportName = "Quotation";
                            frmCustomerReceit _frmCustomerReceit = new frmCustomerReceit();
                            _frmCustomerReceit.ShowDialog();
                            MessageBox.Show("Quotation saved successfully");
                        }
                    }
                }
                else
                {
                    MessageBox.Show(this.validateForm(), "Validation Failed", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            finally
            {
                ClearFields();
            }
        }
Exemplo n.º 2
0
        private void sbSave_Click(object sender, EventArgs e)
        {
            try
            {
                Cash = Convert.ToDecimal(txtCash.Text) + Convert.ToDecimal(txtMobileMoney.Text) + Convert.ToDecimal(txtCard.Text);
                Decimal OrderAmount = Convert.ToDecimal(lblSalesTotal.Text);
                if (OrderAmount > Cash)
                {
                    DialogResult dr = MessageBox.Show("Are you sure you want to make this sale on credit?", "Confirm!", MessageBoxButtons.YesNoCancel,
                                                      MessageBoxIcon.Information);

                    if (dr == DialogResult.Yes)
                    {
                        if (this.validateForm() == "Success")
                        {
                            if (this.SalesOrder())
                            {
                                ClearFields();
                                MessageBox.Show("Record saved successfully.");
                            }

                            //rptSalesInvoice report = new rptSalesInvoice();
                            //using (ReportPrintTool printTool = new ReportPrintTool(report))
                            //{
                            //    printTool.Print();
                            //}
                            //}
                        }
                        else
                        {
                            MessageBox.Show(this.validateForm(), "Validation Failed", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                }
                else
                {
                    if (this.validateForm() == "Success")
                    {
                        if (this.SalesOrder())
                        {
                            frmCustomerReceit _frmCustomerReceit = new frmCustomerReceit();
                            _frmCustomerReceit.ShowDialog();
                            MessageBox.Show("Record saved successfully");
                            ClearFields();
                        }
                    }
                    else
                    {
                        MessageBox.Show(this.validateForm(), "Validation Failed", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }