/// <summary>
 /// On 'Print' button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvContraReport.RowCount > 0)
         {
             DataSet ds = new DataSet();
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
             frmReport          reportobj          = new frmReport();
             //ContraMasterSP spContraMaster = new ContraMasterSP();
             ContraVoucherDetailsBll bllContraVoucherDetails = new ContraVoucherDetailsBll();
             List <DataTable>        listObjCompany          = bllCompanyCreation.CompanyViewDataTable(1);
             List <DataTable>        listObjCotraReport      = bllContraVoucherDetails.ContraReport(Convert.ToDateTime(dtpFromDate.Value.ToString()), Convert.ToDateTime(dtpToDate.Value.ToString()), cmbVoucherType.Text, cmbCashOrBank.Text, strType);
             ds.Tables.Add(listObjCompany[0]);
             ds.Tables.Add(listObjCotraReport[0]);
             reportobj.MdiParent = formMDI.MDIObj;
             reportobj.ContraVoucherReport(ds);
         }
         else
         {
             MessageBox.Show("No data found", "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("CRT:12" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#2
0
 /// <summary>
 /// Function to save the items to database
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         decimal           decIdentity       = 0;
         FinancialYearInfo infoFinancialYear = new FinancialYearInfo();
         FinancialYearBll  bllFinancialYear  = new FinancialYearBll();
         //CompanySP spCompany = new CompanySP();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         infoFinancialYear.FromDate  = Convert.ToDateTime(txtFromDate.Text);
         infoFinancialYear.ToDate    = Convert.ToDateTime(txtToDate.Text);
         infoFinancialYear.ExtraDate = System.DateTime.Now;
         infoFinancialYear.Extra1    = string.Empty;
         infoFinancialYear.Extra2    = string.Empty;
         decIdentity       = bllFinancialYear.FinancialYearAddWithReturnIdentity(infoFinancialYear);
         infoFinancialYear = bllFinancialYear.FinancialYearView(decIdentity);
         PublicVariables._decCurrentFinancialYearId = infoFinancialYear.FinancialYearId;
         PublicVariables._dtFromDate    = infoFinancialYear.FromDate;
         PublicVariables._dtToDate      = infoFinancialYear.ToDate;
         PublicVariables._dtCurrentDate = infoFinancialYear.FromDate;
         bllCompanyCreation.CompanyCurrentDateEdit(PublicVariables._dtCurrentDate);
         formMDI.MDIObj.ShowCurrentDate();
         isSave = true;
         this.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show("NFY 2 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#3
0
 /// <summary>
 /// Save button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtCompanyCurrentdate.Text == string.Empty)
         {
             Messages.InformationMessage("Select a date in between financial year");
             txtCompanyCurrentdate.Focus();
         }
         else
         {
             PublicVariables._dtCurrentDate = Convert.ToDateTime(txtCompanyCurrentdate.Text);
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
             bllCompanyCreation.CompanyCurrentDateEdit(Convert.ToDateTime(txtCompanyCurrentdate.Text));
             if (frmCompanyCreationObj != null)
             {
                 if ((MessageBox.Show("Saved successfully...Do you want to save settings now? ", "Open Miracle", MessageBoxButtons.YesNo, MessageBoxIcon.Question)) == DialogResult.Yes)
                 {
                     frmSettings frmSettingsObj = new frmSettings();
                     frmSettingsObj.MdiParent = formMDI.MDIObj;
                     frmSettingsObj.CallFromChangeCurrentDate(frmCompanyCreationObj);
                 }
             }
             this.Close();
             ShowReminderIfAny();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("CCD 11 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#4
0
 /// <summary>
 /// On 'Print' button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvBonusDeductionReport.RowCount > 0)
         {
             DataSet ds = new DataSet();
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
             List <DataTable>   listObjCompany     = bllCompanyCreation.CompanyViewDataTable(1);
             ds.Tables.Add(listObjCompany[0]);
             BonusDeductionBll BllBonusDeduction  = new BonusDeductionBll();
             List <DataTable>  listBonusDeduction = BllBonusDeduction.BonusDeductionReportGridFill(dtpFromDate.Text, dtpToDate.Text, dtpSalaryMonth.Text, cmbDesignation.Text, cmbEmployee.Text, strBonusOrDeduction);
             ds.Tables.Add(listBonusDeduction[0]);
             frmReport frmReportObj = new frmReport();
             frmReportObj.MdiParent = formMDI.MDIObj;
             frmReportObj.BonusDeductionReportPrinting(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("BDR:8" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#5
0
 /// <summary>
 /// On 'Print' button click for print
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvMonthlySalary.Rows.Count > 0)
         {
             DataSet ds = new DataSet();
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
             List <DataTable>   listObjCompany     = bllCompanyCreation.CompanyViewDataTable(1);
             ds.Tables.Add(listObjCompany[0]);
             MonthlySalaryVoucherBll BllMonthlySalary  = new MonthlySalaryVoucherBll();
             List <DataTable>        ListMonthlySalary = BllMonthlySalary.MonthlySalryViewAllForMonthlySalaryReports(Convert.ToDateTime(dtpFromDate.Value.ToString()), Convert.ToDateTime(dtpToDate.Value.ToString()), cmbDesignation.Text, cmbEmployeeCode.Text, Convert.ToDateTime(dtpSalaryMonth.Value.ToString()));
             ds.Tables.Add(ListMonthlySalary[0]);
             frmReport frmReportObj = new frmReport();
             frmReportObj.MdiParent = formMDI.MDIObj;
             frmReportObj.MonthlySalaryReportPrinting(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("MSR:9" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Function to fill Dates
 /// </summary>
 public void FinancialYearDate()
 {
     try
     {
         dtpFromDate.MinDate = PublicVariables._dtFromDate;
         dtpFromDate.MaxDate = PublicVariables._dtToDate;
         CompanyInfo infoComapany = new CompanyInfo();
         //CompanySP spCompany = new CompanySP();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         infoComapany = bllCompanyCreation.CompanyView(1);
         DateTime dtFromDate = infoComapany.CurrentDate;
         dtpFromDate.Value = dtFromDate;
         txtFromDate.Text  = dtFromDate.ToString("dd-MMM-yyyy");
         dtpFromDate.Value = Convert.ToDateTime(txtFromDate.Text);
         dtpTodate.MinDate = PublicVariables._dtFromDate;
         dtpTodate.MaxDate = PublicVariables._dtToDate;
         infoComapany      = bllCompanyCreation.CompanyView(1);
         DateTime dtToDate = infoComapany.CurrentDate;
         dtpTodate.Value      = dtToDate;
         txtToDate.Text       = dtToDate.ToString("dd-MMM-yyyy");
         dtpTodate.Value      = Convert.ToDateTime(txtToDate.Text);
         dtpCheckdate.MinDate = PublicVariables._dtFromDate;
         dtpCheckdate.MaxDate = PublicVariables._dtToDate;
         infoComapany         = bllCompanyCreation.CompanyView(1);
         DateTime dtCheckDate = infoComapany.CurrentDate;
         dtpCheckdate.Value = dtCheckDate;
         txtCheckDate.Text  = dtToDate.ToString("dd-MMM-yyyy");
         dtpCheckdate.Value = Convert.ToDateTime(txtCheckDate.Text);
     }
     catch (Exception ex)
     {
         MessageBox.Show("PCREG5:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// On print button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         DateTime           FromDate           = this.dtpFromDate.Value;
         DateTime           ToDate             = this.dtpToDate.Value;
         DataSet            ds                 = new DataSet();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         DataTable          dtblProduct        = listObj[0].Copy();
         List <DataTable>   listObjCompany     = bllCompanyCreation.CompanyViewDataTable(1);
         if (dgvProductBatch.Rows.Count > 0)
         {
             DataTable dtblNew = listObj[0].Copy();
             ds.Tables.Add(listObjCompany[0]);
             ds.Tables.Add(dtblProduct);
             frmReport frmReport = new frmReport();
             frmReport.MdiParent = formMDI.MDIObj;
             frmReport.ProductBatchReportPrinting(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(" PVSBR:9" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// On 'Print' button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvDailyAttendanceReport.RowCount > 0)
         {
             DataSet ds = new DataSet();
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
             List <DataTable>   listObjCompany     = bllCompanyCreation.CompanyViewDataTable(1);
             ds.Tables.Add(listObjCompany[0]);
             AttendanceBll    BllAttendanceMaster = new AttendanceBll();
             List <DataTable> ListAttendance      = BllAttendanceMaster.DailyAttendanceViewForDailyAttendanceReport(dtpDate.Text.Trim(), cmbStatus.Text.Trim(), cmbEmployee.Text.Trim(), cmbDesignation.Text.Trim());
             ds.Tables.Add(ListAttendance[0]);
             frmReport frmReportObj = new frmReport();
             frmReportObj.MdiParent = formMDI.MDIObj;
             frmReportObj.DailyAttendanceReportPrinting(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("DAR:8" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// On 'Print' button click to take print
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvAdvancePayment.Rows.Count > 0)
         {
             DataSet ds = new DataSet();
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
             List <DataTable>   listObjCompany     = bllCompanyCreation.CompanyViewDataTable(1);
             ds.Tables.Add(listObjCompany[0]);
             AdvancePaymentBll bllAdvancePayment = new AdvancePaymentBll();
             List <DataTable>  listObj           = new List <DataTable>();
             listObj = bllAdvancePayment.AdvancePaymentViewAllForAdvancePaymentReport(dtpFrmDate.Value, dtpToDate.Value, cmbEmployeeCode.Text, DateTime.Parse(dtpSalaryMonth.Text.ToString()));
             ds.Tables.Add(listObj[0]);
             frmReport frmReportObj = new frmReport();
             frmReportObj.MdiParent = formMDI.MDIObj;
             frmReportObj.AdvancePaymentReportPrinting(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("APR:8" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// on "print'  button click for print
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvServiceReport.RowCount > 0)
         {
             DataSet dsServiceVoucherReport = new DataSet();
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll bllCompanyCreation       = new CompanyCreationBll();
             frmReport          reportobj                = new frmReport();
             ServicesBll        BllService               = new ServicesBll();
             List <DataTable>   listObjCompany           = bllCompanyCreation.CompanyViewDataTable(1);
             List <DataTable>   listServiceVoucherReport = BllService.ServiceReport(Convert.ToDateTime(dtpFromDate.Value.ToString()), Convert.ToDateTime(dtpToDate.Value.ToString()), cmbVoucherType.Text, cmbCashOrParty.Text, cmbSalesman.Text);
             dsServiceVoucherReport.Tables.Add(listObjCompany[0]);
             dsServiceVoucherReport.Tables.Add(listServiceVoucherReport[0]);
             reportobj.MdiParent = formMDI.MDIObj;
             reportobj.ServiceVoucherReport(dsServiceVoucherReport);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SVRT 15 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#11
0
 /// <summary>
 /// On 'Print' button click to print
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvPayHead.RowCount > 0)
         {
             DataSet          ds         = new DataSet();
             PayHeadBll       BllPayHead = new PayHeadBll();
             List <DataTable> listObj    = BllPayHead.PayHeadViewAllForPayHeadReport(cmbPayHead.Text, cmbType.Text);
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
             List <DataTable>   listObjCompany     = bllCompanyCreation.CompanyViewDataTable(1);
             frmReport          frmreport          = new frmReport();
             frmreport.MdiParent = formMDI.MDIObj;
             ds.Tables.Add(listObj[0]);
             ds.Tables.Add(listObjCompany[0]);
             frmreport.PayHeadReport(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PHR:7 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#12
0
 /// <summary>
 /// On 'Print' button click to print
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvSalaryPackage.RowCount > 0)
         {
             frmReport frmreport = new frmReport();
             DataSet   ds        = new DataSet();
             SalaryPackageCreationBll bllSalaryPackage = new SalaryPackageCreationBll();
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
             List <DataTable>   ListObj            = bllSalaryPackage.SalaryPackageViewAllForSalaryPackageReport(cmbPackageName.Text, cmbStatus.Text);
             List <DataTable>   listObjCompany     = bllCompanyCreation.CompanyViewDataTable(1);
             ds.Tables.Add(ListObj[0]);
             ds.Tables.Add(listObjCompany[0]);
             frmreport.MdiParent = formMDI.MDIObj;
             frmreport.SalaryPackageReport(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SPD:9 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// On 'Print' button click to print the data
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvPurchaseReturnReport.Rows.Count > 0)
         {
             if (dgvPurchaseReturnReport.Rows.Count > 0)
             {
                 DataSet dsPurchaseReturnReport = new DataSet();
                 //CompanySP spCompany = new CompanySP();
                 CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
                 DataTable          dtblGrid           = ListObjReg[0].Copy();
                 List <DataTable>   listObjCompany     = bllCompanyCreation.CompanyViewDataTable(1);
                 dsPurchaseReturnReport.Tables.Add(dtblGrid);
                 dsPurchaseReturnReport.Tables.Add(listObjCompany[0]);
                 frmReport frmReport = new frmReport();
                 frmReport.MdiParent = formMDI.MDIObj;
                 frmReport.PurchaseReturnReportPrinting(dsPurchaseReturnReport, txtTotalAmount.Text);
             }
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PRRT:13" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#14
0
 /// <summary>
 /// On 'Print' button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         DataSet dsSalesOrderReport = new DataSet();
         // CompanySP spCompany = new CompanySP();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         List <DataTable>   listObjCompany     = bllCompanyCreation.CompanyViewDataTable(1);
         DataTable          dtblDetails        = new DataTable();
         dtblDetails = ListObj[0].Copy();
         if (ListObj[0].Rows.Count > 0)
         {
             dsSalesOrderReport.Tables.Add(listObjCompany[0]);
             dsSalesOrderReport.Tables.Add(dtblDetails);
             frmReport frmReport = new frmReport();
             frmReport.MdiParent = formMDI.MDIObj;
             frmReport.SalesOrderReportPrinting(dsSalesOrderReport, txtTotalAmount.Text);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SORP16:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// On 'Print' button click to take print
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvEmployeeAddressBook.Rows.Count > 0)
         {
             DataSet ds = new DataSet();
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
             List <DataTable>   listObjCompany     = bllCompanyCreation.CompanyViewDataTable(1);
             ds.Tables.Add(listObjCompany[0]);
             EmployeeCreationBll BllEmployeeCreation = new EmployeeCreationBll();
             List <DataTable>    listEmployee        = BllEmployeeCreation.EmployeeViewAllForEmployeeAddressBook(cmbEmployeeCode.Text, txtMobile.Text, txtPhone.Text, txtEmail.Text);
             ds.Tables.Add(listEmployee[0]);
             frmReport frmReportObj = new frmReport();
             frmReportObj.MdiParent = formMDI.MDIObj;
             frmReportObj.EmployeeAddressBookPrinting(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("EMP8 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#16
0
 /// <summary>
 /// Print button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click_1(object sender, EventArgs e)
 {
     try
     {
         //PhysicalStockMasterSP spPhysicalStockMaster = new PhysicalStockMasterSP();
         PhysicalStockBll BllPhysicalStock = new PhysicalStockBll();
         if (dgvPhysicalStockReport.RowCount > 0)
         {
             DataSet ds = new DataSet();
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll bllCompanyCreation         = new CompanyCreationBll();
             frmReport          reportobj                  = new frmReport();
             List <DataTable>   listObjCompany             = bllCompanyCreation.CompanyViewDataTable(1);
             List <DataTable>   listObjPhysicalStockReport = BllPhysicalStock.PhysicalStockReportFill(Convert.ToDateTime(dtpFromDate.Value.ToString()), Convert.ToDateTime(dtpToDate.Value.ToString()), txtVoucherNo.Text.Trim(), txtProductName.Text.Trim(), Convert.ToDecimal(cmbProductCode.SelectedValue), Convert.ToDecimal(cmbVoucherType.SelectedValue));
             ds.Tables.Add(listObjCompany[0]);
             ds.Tables.Add(listObjPhysicalStockReport[0]);
             reportobj.MdiParent = formMDI.MDIObj;
             reportobj.PhysicalStockReport(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PSRT:6" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Function to set financial year date
 /// </summary>
 public void FinancialYearDate()
 {
     try
     {
         //-----For FromDate----//
         dtpFromDate.MinDate = PublicVariables._dtFromDate;
         dtpFromDate.MaxDate = PublicVariables._dtToDate;
         CompanyInfo infoComapany = new CompanyInfo();
         //CompanySP spCompany = new CompanySP();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         infoComapany = bllCompanyCreation.CompanyView(1);
         DateTime dtFromDate = infoComapany.CurrentDate;
         dtpFromDate.Value = dtFromDate;
         dtpFromDate.Text  = dtFromDate.ToString("dd-MMM-yyyy");
         dtpFromDate.Value = Convert.ToDateTime(txtFromDate.Text);
         txtFromDate.Focus();
         txtFromDate.SelectAll();
         //==============================//
         //-----For ToDate-----------------//
         dtpToDate.MinDate = PublicVariables._dtFromDate;
         dtpToDate.MaxDate = PublicVariables._dtToDate;
         infoComapany      = bllCompanyCreation.CompanyView(1);
         DateTime dtToDate = infoComapany.CurrentDate;
         dtpToDate.Value = dtToDate;
         dtpToDate.Text  = dtToDate.ToString("dd-MMM-yyyy");
         dtpToDate.Value = Convert.ToDateTime(txtToDate.Text);
         txtToDate.Focus();
         txtToDate.SelectAll();
         //=====================//
     }
     catch (Exception ex)
     {
         MessageBox.Show("AGR:3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#18
0
 /// <summary>
 /// On 'Print' button click to print
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvDailySalary.RowCount > 0)
         {
             DataSet ds = new DataSet();
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll  bllCompanyCreation  = new CompanyCreationBll();
             EmployeeCreationBll BllEmployeeCreation = new EmployeeCreationBll();
             List <DataTable>    listEmployee        = BllEmployeeCreation.EmployeeViewAllForDailySalaryReport(cmbEmployeeCode.Text, cmbDesignation.Text, Convert.ToDateTime(dtpFromDate.Text.ToString()), Convert.ToDateTime(dtpToDate.Text.ToString()), cmbStatus.Text);
             List <DataTable>    listObjCompany      = bllCompanyCreation.CompanyViewDataTable(1);
             ds.Tables.Add(listObjCompany[0]);
             ds.Tables.Add(listEmployee[0]);
             frmReport frmReportObj = new frmReport();
             frmReportObj.MdiParent = formMDI.MDIObj;
             frmReportObj.DailySalaryReport(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("DSR9 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#19
0
        /// <summary>
        /// Start a login
        /// </summary>
        public void Login()

        {
            try
            {
                UserBll            bllUser            = new UserBll();
                CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
                CompanyInfo        infoCompany        = new CompanyInfo();
                string             strUserName        = txtUserName.Text.Trim();
                string             strPassword        = bllUser.LoginCheck(strUserName);
                if (strPassword == txtPassword.Text.Trim() && strPassword != string.Empty)
                {
                    int inUserId = bllUser.GetUserIdAfterLogin(strUserName, strPassword);
                    PublicVariables._decCurrentUserId = inUserId;
                    infoCompany = bllCompanyCreation.CompanyView(1);
                    PublicVariables._decCurrencyId = infoCompany.CurrencyId;
                    formMDI.MDIObj.CallFromLogin();
                    SettingsCheck();
                    //for Quock Launch menu
                    formMDI.MDIObj.ShowQuickLaunchMenu();
                    formMDI.MDIObj.CurrentSettings();
                    //Display ChangeCurrentDate form//
                    frmChangeCurrentDate frmCurrentDateChangeObj = new frmChangeCurrentDate();
                    frmCurrentDateChangeObj.MdiParent = formMDI.MDIObj;
                    frmCurrentDateChangeObj.CallFromLogin(this);
                    formMDI.MDIObj.Text = "OpenMiracle " + infoCompany.CompanyName + " [ " + PublicVariables._dtFromDate.ToString("dd-MMM-yyyy") + " To " + PublicVariables._dtToDate.ToString("dd-MMM-yyyy") + " ]";
                    // For showing the OpenMiracle message from the website
                    formMDI.MDIObj.logoutToolStripMenuItem.Enabled = true;
                    if (PublicVariables.MessageToShow != string.Empty)
                    {
                        frmMessage frmMsg = new frmMessage();
                        frmMsg.lblHeading.Text = PublicVariables.MessageHeadear;
                        frmMsg.lblMessage.Text = PublicVariables.MessageToShow;
                        frmMsg.MdiParent       = formMDI.MDIObj;
                        frmMsg.Show();
                        frmMsg.Location = new Point(0, formMDI.MDIObj.Height - 270);
                        foreach (Form form in Application.OpenForms)
                        {
                            if (form.GetType() == typeof(frmChangeCurrentDate))
                            {
                                form.Focus();
                            }
                        }
                    }
                }
                else
                {
                    Messages.InformationMessage("Invalid username or password");
                    Clear();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("LOGIN02:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
示例#20
0
 /// <summary>
 /// Function to fill Datagridview
 /// </summary>
 public void CompanyGridFill()
 {
     try
     {
         List <DataTable> listObj = new List <DataTable>();
         //CompanySP spComapny = new CompanySP();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         listObj = bllCompanyCreation.CompanyViewAllForSelectCompany();
         dgvSelectCompany.DataSource = listObj[0];
     }
     catch (Exception ex)
     {
         MessageBox.Show("SELCMPNY : 1" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#21
0
 /// <summary>
 /// To Display the company name in text box
 /// </summary>
 public void txtcompanynamefill()
 {
     try
     {
         //CompanySP spcompany = new CompanySP();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         CompanyInfo        infoCompany        = new CompanyInfo();
         infoCompany = bllCompanyCreation.CompanyView(1);
         string strCompanyName = infoCompany.CompanyName;
         txtShowCompanyName.Text     = strCompanyName;
         txtShowCompanyName.ReadOnly = true;
     }
     catch (Exception ex)
     {
         MessageBox.Show("BS3:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#22
0
 /// <summary>
 /// On print button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvPriceList.Rows.Count > 0)
         {
             frmReport frmReport = new frmReport();
             frmReport.MdiParent = formMDI.MDIObj;
             DataTable dtblOption = new DataTable();
             dtblOption.Columns.Add("PurchaseRate", typeof(String));
             dtblOption.Columns.Add("SalesRate", typeof(String));
             dtblOption.Columns.Add("LastSalesRate", typeof(String));
             dtblOption.Columns.Add("StandardRate", typeof(String));
             dtblOption.Columns.Add("MRP", typeof(String));
             dtblOption.Columns.Add("Price", typeof(String));
             DataRow dr = dtblOption.NewRow();
             dr["PurchaseRate"]  = cbxPurchaseRate.Checked ? "True" : "False";
             dr["SalesRate"]     = cbxSalesRate.Checked ? "True" : "False";
             dr["LastSalesRate"] = cbxlastSalesRate.Checked ? "True" : "False";
             dr["StandardRate"]  = CbxStandardRate.Checked ? "True" : "False";
             dr["MRP"]           = cbxMrp.Checked ? "True" : "False";
             dr["Price"]         = "True";
             dtblOption.Rows.Add(dr);
             DataSet            ds = new DataSet();
             CompanyCreationBll bllCompanyCreation    = new CompanyCreationBll();
             List <DataTable>   listObjPriceList      = BllPriceList.PriceListReportPrint(decGroupId, strProductName, decSizeId, decModelId, decPricingLevelId);
             List <DataTable>   listObjCompanyReport  = bllCompanyCreation.CompanyViewDataTable(1);
             DataTable          dtblPriceListGridFill = listObjPriceListReport[0].Copy();
             ds.Tables.Add(listObjCompanyReport[0]);
             ds.Tables.Add(listObjPriceList[0]);
             ds.Tables.Add(dtblOption);
             frmReport.MdiParent = formMDI.MDIObj;
             frmReport.PriceListReportPrinting(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(" RPL17:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#23
0
 /// <summary>
 /// To set current date
 /// </summary>
 public void CurrentDate()
 {
     try
     {
         dtpCompanyCurrentDate.MinDate = PublicVariables._dtFromDate;
         dtpCompanyCurrentDate.MaxDate = PublicVariables._dtToDate;
         CompanyInfo infoComapany = new CompanyInfo();
         //CompanySP spCompany = new CompanySP();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         infoComapany = bllCompanyCreation.CompanyView(1);
         DateTime dtCurrentDate = PublicVariables._dtFromDate;
         if (infoComapany.CurrentDate != null)
         {
             dtCurrentDate = infoComapany.CurrentDate;
         }
         if (dtCurrentDate > PublicVariables._dtToDate)
         {
             dtCurrentDate = PublicVariables._dtToDate;
         }
         if (dtCurrentDate < PublicVariables._dtFromDate)
         {
             dtCurrentDate = PublicVariables._dtFromDate;
         }
         dtpCompanyCurrentDate.Value    = dtCurrentDate;
         PublicVariables._dtCurrentDate = dtCurrentDate;
         DateTime sysDate = System.DateTime.Today;
         if (sysDate >= PublicVariables._dtFromDate && sysDate <= PublicVariables._dtToDate)
         {
             txtCompanyCurrentdate.Text = sysDate.ToString("dd-MMM-yyyy");
         }
         else
         {
             txtCompanyCurrentdate.Text = dtCurrentDate.ToString("dd-MMM-yyyy");
         }
         dtpCompanyCurrentDate.Value = Convert.ToDateTime(txtCompanyCurrentdate.Text);
         txtCompanyCurrentdate.Focus();
         txtCompanyCurrentdate.SelectAll();
     }
     catch (Exception ex)
     {
         MessageBox.Show("CCD 3 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#24
0
 /// <summary>
 /// ON 'Print' button click to take print
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvMonthlyAttendance.Rows.Count > 0)
         {
             DataSet ds = new DataSet();
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
             List <DataTable>   dlistObjCompany    = bllCompanyCreation.CompanyViewDataTable(1);
             ds.Tables.Add(dlistObjCompany[0]);
             DataTable dtblMonthlyAttendance = new DataTable();
             dtblMonthlyAttendance.Columns.Add("SlNo", typeof(Int32));
             dtblMonthlyAttendance.Columns.Add("employeeCode", typeof(string));
             dtblMonthlyAttendance.Columns.Add("employeeName", typeof(string));
             dtblMonthlyAttendance.Columns.Add("Present", typeof(string));
             dtblMonthlyAttendance.Columns.Add("Absent", typeof(string));
             foreach (DataGridViewRow dgvrow in dgvMonthlyAttendance.Rows)
             {
                 dtblMonthlyAttendance.Rows.Add();
                 dtblMonthlyAttendance.Rows[dgvrow.Index]["SlNo"]         = dgvrow.Cells["SlNo"].Value;
                 dtblMonthlyAttendance.Rows[dgvrow.Index]["employeeCode"] = dgvrow.Cells["employeeCode"].Value;
                 dtblMonthlyAttendance.Rows[dgvrow.Index]["employeeName"] = dgvrow.Cells["employeeName"].Value;
                 dtblMonthlyAttendance.Rows[dgvrow.Index]["Present"]      = dgvrow.Cells["Present"].Value;
                 dtblMonthlyAttendance.Rows[dgvrow.Index]["Absent"]       = dgvrow.Cells["Absent"].Value;
             }
             ds.Tables.Add(dtblMonthlyAttendance);
             frmReport frmReportObj = new frmReport();
             frmReportObj.MdiParent = formMDI.MDIObj;
             frmReportObj.MonthlyAttendancePrinting(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("MAR15 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Changing company's  financial year
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSelect_Click(object sender, EventArgs e)
 {
     try
     {
         if (MessageBox.Show("Are you sure you want to change the financial year?", "OpenMiracle", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             FinancialYearInfo infoFinancialYear = new FinancialYearInfo();
             FinancialYearBll  bllFinancialYear  = new FinancialYearBll();
             decimal           decFinacialId     = Convert.ToDecimal(dgvChangeFinancialYear.CurrentRow.Cells["dgvtxtfinancialYearId"].Value);
             DateTime          dtmFromDate       = Convert.ToDateTime(dgvChangeFinancialYear.CurrentRow.Cells["dgvtxtFromDate"].Value);
             DateTime          dtmToDate         = Convert.ToDateTime(dgvChangeFinancialYear.CurrentRow.Cells["dgvtxtToDate"].Value);
             PublicVariables._decCurrentFinancialYearId = decFinacialId;
             PublicVariables._dtFromDate = dtmFromDate;
             PublicVariables._dtToDate   = dtmToDate;
             DateTime dtGetCurrentdate = DateTime.Now;
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
             bllCompanyCreation.CompanyCurrentDateEdit(dtmFromDate);
             if (dtGetCurrentdate < dtmFromDate)
             {
                 PublicVariables._dtCurrentDate = dtmFromDate;
                 bllCompanyCreation.CompanyCurrentDateEdit(dtmFromDate);
                 formMDI.MDIObj.ShowCurrentDate();
             }
             else
             {
                 PublicVariables._dtCurrentDate = dtGetCurrentdate;
                 bllCompanyCreation.CompanyCurrentDateEdit(dtmFromDate);
                 formMDI.MDIObj.ShowCurrentDate();
             }
             CompanyInfo infoCompany = new CompanyInfo();
             infoCompany         = bllCompanyCreation.CompanyView(1);
             formMDI.MDIObj.Text = "OpenMiracle " + infoCompany.CompanyName + " [ " + PublicVariables._dtFromDate.ToString("dd-MMM-yyyy") + " To " + PublicVariables._dtToDate.ToString("dd-MMM-yyyy") + " ]";
             this.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("CHGFINYR:5" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#26
0
        /// <summary>
        /// Function to Get the Current Date
        /// </summary>
        public void CurrentDate()
        {
            try
            {
                CompanyInfo infoComapany = new CompanyInfo();
                //CompanySP spCompany = new CompanySP();
                CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
                FinancialYearInfo  infoFinancialYear  = new FinancialYearInfo();
                FinancialYearBll   bllFinancialYear   = new FinancialYearBll();

                infoComapany = bllCompanyCreation.CompanyView(1);
                PublicVariables._dtCurrentDate = infoComapany.CurrentDate;
                infoFinancialYear           = bllFinancialYear.FinancialYearView(1);
                PublicVariables._dtFromDate = infoFinancialYear.FromDate;
                PublicVariables._dtToDate   = infoFinancialYear.ToDate;
            }
            catch (Exception ex)
            {
                MessageBox.Show("SELCMPNY :2 " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
 /// <summary>
 /// On 'Print' button click to Print
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvSalaryPackageDetails.RowCount > 0)
         {
             DataTable dtblOther = new DataTable();
             frmReport frmreport = new frmReport();
             DataSet   ds        = new DataSet();
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll       bllCompanyCreation      = new CompanyCreationBll();
             List <DataTable>         listObjCompany          = bllCompanyCreation.CompanyViewDataTable(1);
             SalaryPackageCreationBll bllSalaryPackageDetails = new SalaryPackageCreationBll();
             List <DataTable>         ListObj = bllSalaryPackageDetails.SalaryPackageDetailsForSalaryPackageDetailsReport(cmbSalaryPackage.Text);
             ds.Tables.Add(listObjCompany[0]);
             ds.Tables.Add(ListObj[0]);
             ds.Tables.Add(dtblOther);
             DataColumn dc = new DataColumn("Addition", typeof(decimal));
             dtblOther.Columns.Add(dc);
             dc = new DataColumn("Deduction", typeof(decimal));
             dtblOther.Columns.Add(dc);
             DataRow dr = dtblOther.NewRow();
             dr[0] = decCountAdditon;
             dr[1] = decCountDeduction;
             dtblOther.Rows.InsertAt(dr, 0);
             frmreport.MdiParent = formMDI.MDIObj;
             frmreport.SalaryPackageDetailsReport(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SPDR:7" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#28
0
 /// <summary>
 /// Function to print partyaddress book
 /// </summary>
 public void Print()
 {
     try
     {
         if (dvgPartyAddressBook.RowCount > 0)
         {
             DataSet ds = new DataSet();
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
             frmReport          reportobj          = new frmReport();
             AccountLedgerBll   bllAccountLedger   = new AccountLedgerBll();
             List <DataTable>   listObjCompany     = bllCompanyCreation.CompanyViewDataTable(1);
             List <DataTable>   ListObj            = bllAccountLedger.PartyAddressBookPrint(cmbAccountGroup.Text, txtMobile.Text, txtPhone.Text, txtEmail.Text, txtLedgerName.Text);
             ds.Tables.Add(listObjCompany[0]);
             ds.Tables.Add(ListObj[0]);
             reportobj.MdiParent = formMDI.MDIObj;
             reportobj.PartyAddressBookPrint(ds);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PAB:3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        /// <summary>
        /// Function to execute query from RichTextBox to company path
        /// </summary>
        /// <param name="txt"></param>
        /// <returns></returns>
        public bool ExecuteQueries(RichTextBox txt)
        {
            decimal decCompanyIdForTemp = PublicVariables._decCurrentCompanyId;
            bool    iscontinue          = true;

            try
            {
                if (cbUpdation.SelectedItems.Count == 0)
                {
                    MessageBox.Show("Select DB to execute", "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    cbUpdation.Focus();
                }
                else
                {
                    foreach (System.Data.DataRowView p in cbUpdation.CheckedItems)
                    {
                        PublicVariables._decCurrentCompanyId = Convert.ToDecimal(p[0].ToString());
                        PathForExecuter = p[2].ToString();

                        //CompanySP SpcompanyForExecuter = new CompanySP();
                        CompanyCreationBll BllcompanyForExecuter = new CompanyCreationBll();
                        if (File.Exists(PathForExecuter + "\\DBOpenMiracle.mdf"))
                        {
                            string error = BllcompanyForExecuter.StoredProcedureInserter(txtNarration.Text.Trim());
                            if (error.Trim() != string.Empty)
                            {
                                if (MessageBox.Show(PathForExecuter + " :\n" + error + "\n Continue?", "OpenMiracle", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                                {
                                    iscontinue = true;
                                }
                                else
                                {
                                    iscontinue = false;
                                }
                                if (failed == string.Empty)
                                {
                                    failed = PathForExecuter;
                                }
                                else
                                {
                                    failed = failed + " , " + PathForExecuter;
                                }
                            }
                            else
                            {
                                if (success == "")
                                {
                                    success = PathForExecuter;
                                }
                                else
                                {
                                    success = success + " , " + PathForExecuter;
                                }
                            }
                        }
                        else
                        {
                            if (MessageBox.Show("DB does not exist in " + PathForExecuter + "\n Continue?", "OpenMiracle", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                            {
                                iscontinue = true;
                            }
                            else
                            {
                                iscontinue = false;
                            }
                            if (failed == string.Empty)
                            {
                                failed = PathForExecuter;
                            }
                            else
                            {
                                failed = failed + " , " + PathForExecuter;
                            }
                        }
                        if (!iscontinue)
                        {
                            break;
                        }
                    }
                }
                PublicVariables._decCurrentCompanyId = decCompanyIdForTemp;
            }
            catch (Exception ex)
            {
                MessageBox.Show("SPIns:2" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(iscontinue);
        }
 /// <summary>
 /// On print button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         frmReport        crptReport     = new frmReport();
         DataSet          ds             = new DataSet();
         List <DataTable> listObjFormat2 = new List <DataTable>();
         DataTable        dtblTotal      = new DataTable();
         //CompanySP spCompany = new CompanySP();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         List <DataTable>   listObjCompany     = new List <DataTable>();
         listObjCompany = bllCompanyCreation.CompanyViewAll();
         if (dgvVatreturn.Rows.Count > 0)
         {
             if (dtblFill.Rows.Count > 0)
             {
                 DataTable dtblReportFill = new DataTable();
                 dtblReportFill.Columns.Add("SlNO");
                 dtblReportFill.Columns.Add("Invoice No");
                 dtblReportFill.Columns.Add("Date");
                 dtblReportFill.Columns.Add("Party Name");
                 dtblReportFill.Columns.Add("Mailing Name");
                 dtblReportFill.Columns.Add("Tin No");
                 dtblReportFill.Columns.Add("qt");
                 dtblReportFill.Columns.Add("Sales Amound");
                 dtblReportFill.Columns.Add("Tax Amount");
                 dtblReportFill.Columns.Add("Cess");
                 dtblReportFill.Columns.Add("Net Amount");
                 dtblReportFill.Columns.Add("billDiscount");
                 dtblReportFill.Columns.Add("grandtotal");
                 for (int i = 0; i < dgvVatreturn.Rows.Count; i++)
                 {
                     DataRow drow = dtblReportFill.NewRow();
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtSlno"].Value != null)
                     {
                         drow["SlNO"] = dgvVatreturn.Rows[i].Cells["dgvtxtSlno"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtInvoiceNo"].Value != null)
                     {
                         drow["Invoice No"] = dgvVatreturn.Rows[i].Cells["dgvtxtInvoiceNo"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtDate"].Value != null)
                     {
                         drow["Date"] = dgvVatreturn.Rows[i].Cells["dgvtxtDate"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtPartyName"].Value != null)
                     {
                         drow["Party Name"] = dgvVatreturn.Rows[i].Cells["dgvtxtPartyName"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtMailingName"].Value.ToString() != string.Empty)
                     {
                         drow["Mailing Name"] = dgvVatreturn.Rows[i].Cells["dgvtxtMailingName"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtTinNo"].Value != null)
                     {
                         drow["Tin No"] = dgvVatreturn.Rows[i].Cells["dgvtxtTinNo"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtQty"].Value != null)
                     {
                         drow["qt"] = dgvVatreturn.Rows[i].Cells["dgvtxtQty"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtSalesAmount"].Value != null)
                     {
                         drow["Sales Amound"] = dgvVatreturn.Rows[i].Cells["dgvtxtSalesAmount"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtTaxAmount"].Value != null)
                     {
                         drow["Tax Amount"] = dgvVatreturn.Rows[i].Cells["dgvtxtTaxAmount"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtCess"].Value != null)
                     {
                         drow["Cess"] = dgvVatreturn.Rows[i].Cells["dgvtxtCess"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtNetAmount"].Value != null)
                     {
                         drow["Net Amount"] = dgvVatreturn.Rows[i].Cells["dgvtxtNetAmount"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtbillDiscount"].Value != null)
                     {
                         drow["billDiscount"] = dgvVatreturn.Rows[i].Cells["dgvtxtbillDiscount"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtGrandTotal"].Value != null)
                     {
                         drow["grandtotal"] = dgvVatreturn.Rows[i].Cells["dgvtxtGrandTotal"].Value.ToString();
                     }
                     dtblReportFill.Rows.Add(drow);
                 }
                 ds.Tables.Add(dtblReportFill);
                 ds.Tables.Add(listObjCompany[0]);
                 crptReport.vatreturnReport(ds);
             }
             else
             {
                 VoucherTypeBll BllVoucherType = new VoucherTypeBll();
                 listObjFormat2 = BllVoucherType.VatGridFill(DateTime.Parse(dtpFrmDate.Text), DateTime.Parse(dtpToDate.Text), cmbTypeofVoucher.Text, Convert.ToDecimal(cmbVouchertype.SelectedValue.ToString()), strformat, cmbTax.Text);
                 if (dgvVatreturn.Rows.Count > 1)
                 {
                     dtblTotal.Columns.Add("taxableamt");
                     dtblTotal.Columns.Add("taxAmount");
                     DataRow dr1 = dtblTotal.NewRow();
                     dr1["taxableamt"] = dgvVatreturn.Rows[dgvVatreturn.Rows.Count - 2].Cells["dgvtxtTaxableAmount"].Value.ToString();
                     dr1["taxAmount"]  = dgvVatreturn.Rows[dgvVatreturn.Rows.Count - 2].Cells["dgvtxttax"].Value.ToString();
                     dtblTotal.Rows.Add(dr1);
                     ds.Tables.Add(listObjCompany[0]);
                     ds.Tables.Add(listObjFormat2[0]);
                     ds.Tables.Add(dtblTotal);
                     crptReport.vatreturnReportFormat(ds);
                 }
             }
         }
         else
         {
             MessageBox.Show("No data found", "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("VRR:14" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }