private void Save_Click(object sender, EventArgs e)
        {
            try
            {
                _a.InsertPaymentDetails("Customer", txt_Amount.Text, cmb_PaymentType.Text, lbl_id.Text, dtp_Date.Value.ToString("dd/MM/yyyy"), txt_ReceiptNo.Text);
                MessageBox.Show("Payment Saved");
            }
            catch (Exception ex)
            {
                _e.AddException(ex, "Customer Payment");
            }

            try
            {
                DialogResult dr = MessageBox.Show("Do You want to print Receipt", "", MessageBoxButtons.YesNo);
                if (dr == DialogResult.Yes)
                {
                    Report.CrystalReport.frm_ReportViewer _objfrm_ReportViewer = new Report.CrystalReport.frm_ReportViewer();
                    SendData _obj = new SendData(_objfrm_ReportViewer.PaymentReceipt);
                    _obj(txt_ReceiptNo.Text, "Customer");
                }
            }
            catch (Exception ex)
            {
                _e.AddException(ex, "Customer Payment/Print");
            }
            MessageBox.Show("Done");
            Clear();
        }
Esempio n. 2
0
        private void bttn_PrintCard_Click(object sender, EventArgs e)
        {
            DataRow   foundRows;
            DataTable NewDt = new DataTable();

            DataTable table = _common.DataGridView2DataTable(dgv_Job, "JobList", 0);

            // Presuming the DataTable has a column named Date.
            for (int i = 0; i < table.Rows.Count; i++)
            {
                if (table.Rows[i]["Select"].ToString() == "false")
                {
                    foundRows = table.Rows[i];
                    table.Rows[i].Delete();
                }
            }

            try
            {
                int Copies = _objPrinterSetting.copies;
                Report.CrystalReport.frm_ReportViewer _objfrm_ReportViewer = new Report.CrystalReport.frm_ReportViewer();
                SendData _obj = new SendData(_objfrm_ReportViewer.JobCard);
                _obj(table, "Print", "");
            }
            catch (Exception ex)
            {
            }
        }
Esempio n. 3
0
 private void bttn_Print_Click(object sender, EventArgs e)
 {
     try
     {
         Report.CrystalReport.frm_ReportViewer _objfrm_ReportViewer = new Report.CrystalReport.frm_ReportViewer();
         SendData _obj = new SendData(_objfrm_ReportViewer.GSTReport);
         _obj(GST, "Supplier", dtp_From.Value.ToString("dd/MM/yyyy"), dtp_to.Value.ToString("dd/MM/yyyy"));
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         _error.AddException(ex, "Supplier GST Report");
     }
 }
 private void bttn_print_Click(object sender, EventArgs e)
 {
     try
     {
         Report.CrystalReport.frm_ReportViewer _objfrm_ReportViewer = new Report.CrystalReport.frm_ReportViewer();
         SendData _obj = new SendData(_objfrm_ReportViewer.MonthlyGST);
         _obj(Sale, Purchase, cmb_month.Text);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         _error.AddException(ex, "Supplier GST Report");
     }
 }
        private void bttn_Sale_Click(object sender, EventArgs e)
        {
            string BillNo = cmb_ServiceId.Text;

            string TransactionLedgerID = null;

            try
            {
                for (int i = 0; i < dgv_ItemInfo.Rows.Count; i++)
                {
                    //string barcode = Convert.ToString(dgv_ItemInfo.Rows[i].Cells["BarcodeNo"].Value);
                    string category    = Convert.ToString(dgv_ItemInfo.Rows[i].Cells["Category"].Value);
                    string subcategory = Convert.ToString(dgv_ItemInfo.Rows[i].Cells["SubCategory"].Value);
                    string HSN         = Convert.ToString(dgv_ItemInfo.Rows[i].Cells["HSN"].Value);
                    string BatchNo     = Convert.ToString(dgv_ItemInfo.Rows[i].Cells["BatchNo"].Value);
                    string Qty         = Convert.ToString(dgv_ItemInfo.Rows[i].Cells["Qty"].Value);
                    string price       = Convert.ToString(dgv_ItemInfo.Rows[i].Cells["Rate"].Value);
                    string CGSTper     = Convert.ToString(dgv_ItemInfo.Rows[i].Cells["CGSTper"].Value);
                    string CGST        = Convert.ToString(dgv_ItemInfo.Rows[i].Cells["CGST"].Value);
                    string SGSTper     = Convert.ToString(dgv_ItemInfo.Rows[i].Cells["SGSTper"].Value);
                    string SGST        = Convert.ToString(dgv_ItemInfo.Rows[i].Cells["SGST"].Value);
                    string IGSTper     = Convert.ToString(dgv_ItemInfo.Rows[i].Cells["IGSTper"].Value);
                    string IGST        = Convert.ToString(dgv_ItemInfo.Rows[i].Cells["IGST"].Value);
                    string TotalAmount = Convert.ToString(dgv_ItemInfo.Rows[i].Cells["TotalAmt"].Value);
                    string TotalPrice  = Convert.ToString(dgv_ItemInfo.Rows[i].Cells["TotalPrice"].Value);
                    string Size        = Convert.ToString(dgv_ItemInfo.Rows[i].Cells["Size"].Value);
                    string PBillNo     = BillNo;
                    //string SalesPerson = Convert.ToString(dgv_ItemInfo.Rows[i].Cells["Sales"].Value);
                    string Maintain = Convert.ToString(dgv_ItemInfo.Rows[i].Cells["Maintain"].Value);

                    _Sale.AddItemDetails(category, subcategory, Size, cmb_ServiceId.Text, "Service Invoice", dtp_Date.Value.ToString("dd/MM/yyyy"), price, Qty, CGSTper, CGST, SGSTper, SGST, IGSTper, IGST, TotalAmount, BatchNo, HSN, TotalPrice, "", Maintain, "0", "0", "0", "0", "0");


                    if (dgv_ItemInfo.Rows[i].Cells["Maintain"].Value.ToString() != "0")
                    {
                        _service.AddMaintain(dtp_Date.Value.ToString("dd/MM/yyyy"), category + " " + subcategory, dtp_Date.Value.AddMonths(Convert.ToInt32(Maintain)).ToString("dd/MM/yyyy"), lbl_CustID.Text);
                    }
                }
            }

            catch (Exception ex)
            {
                _error.AddException(ex, "Service Invoice");
            }

            try
            {
                _Sale.AddBillDetails(cmb_ServiceId.Text, lbl_CustID.Text, dtp_Date.Value.ToString("dd/MM/yyyy"), DateTime.Now.ToString("HH:mm:ss"), txt_TotalAmt.Text, lbl_CGSTValue.Text, lbl_SGSTValue.Text, lbl_IGSTValue.Text, txt_NetAmt.Text, "", txt_BillAmt.Text, txt_Discount.Text, "Service Invoice", txt_Extra.Text, txt_Other.Text, "0");

                if (txt_PaidAmt.Text != "" || txt_PaidAmt.Text != "0" || txt_PaidAmt.Text == string.Empty)
                {
                    _a.InsertPaymentDetails("Sale", txt_PaidAmt.Text, cmb_PayMode.Text, lbl_CustID.Text, dtp_Date.Value.ToString("dd/MM/yyyy"), cmb_ServiceId.Text);
                }
                //create account ledger
                string ledgerId;
                ledgerId = _Sale.insertAcountLedgerDetail(Vouchertypeid: VouchertypeID, AccNo: lbl_CustID.Text, Name: txt_name.Text, Narration: "", Date: dtp_Date.Text);

                bool Payformstatus = true;
                if (Convert.ToInt32(txt_PaidAmt.Text) == 0)
                {
                    DialogResult dr1 = MessageBox.Show("Save with Zero Amount :" + txt_PaidAmt.Text + "\n\n Do You Want To Continue", "ShopIn Says ", MessageBoxButtons.YesNo);
                    if (dr1 == DialogResult.No)
                    {
                        Payformstatus = false;
                    }
                }

                else if (Convert.ToInt32(txt_PaidAmt.Text) > 0)

                {
                    DialogResult dr = MessageBox.Show("Amount to be Payed :" + txt_PaidAmt.Text + "\n\n Do You Want To Continue", "ShopIn Says ", MessageBoxButtons.YesNo);
                    if (dr == DialogResult.Yes)
                    {
                        if (dtSett.PaymentForm == "1")
                        {
                            frm_PaymentOptionForReceiptVoucher form = new frm_PaymentOptionForReceiptVoucher
                                                                      (
                                Amountpaid: txt_PaidAmt.Text,
                                billno: cmb_ServiceId.Text,
                                Accountno: lbl_CustID.Text,
                                Date: dtp_Date.Text,

                                CustomerType: CustomerType.CustomerSaleGST,
                                OperationType: OperationType.Create
                                                                      );

                            form.ShowDialog();
                            Payformstatus       = true;
                            TransactionLedgerID = form.TransactionLedgerID;
                            PaymentIDs          = form.PaymentIDs;
                            if (form.ReturnStatus == false)
                            {
                                Payformstatus = false;
                            }
                        }
                        else if (dtSett.PaymentForm == "0")
                        {
                            Payformstatus = true;
                        }
                    }
                    else if (dr == DialogResult.No)
                    {
                        Payformstatus = false;
                    }
                }
                _Sale.InsertCreditDebitInSalesAccount(customerLedgerID: ledgerId, VouchertypeID: VouchertypeID, sbillno: lbl_CustID.Text.ToString(), Name: txt_name.Text, Amount: txt_PaidAmt.Text, Narration: "", Date: dtp_Date.Text);
            }


            catch (Exception ex)
            {
                _error.AddException(ex, "Sale/AddBillDetails");
            }
            try
            {
                Report.CrystalReport.frm_ReportViewer _objfrm_ReportViewer = new Report.CrystalReport.frm_ReportViewer();
                SendData _obj = new SendData(_objfrm_ReportViewer.ServiceInvoice);
                _obj(cmb_ServiceId.Text, "Print");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                _error.AddException(ex, "Sale/PrintBill");
            }
            //_Sale.PrintBillThermal(BillNo);

            MessageBox.Show("Sale Successfully Done");
            Masterclear();
            Clear();
            this.BringToFront();
        }