/// <summary> /// Function to fill Datagirdview /// </summary> public void RejectionInReportFill() { try { RejectionInMasterSP SpRejectionInMaster = new RejectionInMasterSP(); try { decimal decDeliveryNoteNo = 0; if (cmbDeliveryNoteNo.SelectedIndex != -1) { decDeliveryNoteNo = Convert.ToDecimal(cmbDeliveryNoteNo.SelectedValue.ToString()); } string strVoucherNo = txtVoucherNo.Text; string strProductCode = txtProductCode.Text; dgvRejectionInReport.DataSource = SpRejectionInMaster.RejectionInReportFill(Convert.ToDateTime(txtFromDate.Text), Convert.ToDateTime(txtToDate.Text), Convert.ToDecimal(cmbVoucherType.SelectedValue.ToString()), strVoucherNo, Convert.ToDecimal(cmbCashorParty.SelectedValue.ToString()), decDeliveryNoteNo, Convert.ToDecimal(cmbSalesMan.SelectedValue.ToString()), strProductCode); txtFromDate.Focus(); } catch (Exception ex) { formMDI.infoError.ErrorString = "RIReport4:" + ex.Message; } } catch (Exception ex) { formMDI.infoError.ErrorString = "RIReport5:" + ex.Message; } }
/// <summary> /// Function to fill VoucherType combobox /// </summary> public void VoucherTypeComboFill() { RejectionInMasterSP spRejectionInMaster = new RejectionInMasterSP(); try { spRejectionInMaster.VoucherTypeSelectionFill(cmbVoucherType, "Rejection In", true); } catch (Exception ex) { formMDI.infoError.ErrorString = "RIReport6:" + ex.Message; } }
/// <summary> /// Function to fill DeliveryNote No combobox /// </summary> public void DeliveryNoteComboFill() { decimal decLedgerId = 0; RejectionInMasterSP spRejectionInMaster = new RejectionInMasterSP(); try { spRejectionInMaster.DeliveryNoteNoComboFillToLedger(cmbDeliveryNoteNo, decLedgerId, true); } catch (Exception ex) { formMDI.infoError.ErrorString = "RIReport7:" + ex.Message; } }
/// <summary> /// Function for Print /// </summary> public void PrintReport() { try { RejectionInMasterSP SpRejectionInMaster = new RejectionInMasterSP(); DataSet dsRejectionInReport = SpRejectionInMaster.RejectionInReportPrinting(dtFromDate, dtToDate, decVoucherType, strVocherNo, decCashOrParty, decDeliveryNoteNo, decSalesManId, strProductCode); frmReport frmReport = new frmReport(); frmReport.MdiParent = formMDI.MDIObj; frmReport.RejectionInReportPrinting(dsRejectionInReport); } catch (Exception ex) { formMDI.infoError.ErrorString = "RIReport9:" + ex.Message; } }
/// <summary> /// Function to fill Datagridview /// </summary> public void RegisterGridFill() { RejectionInMasterSP SpRejectionInMaster = new RejectionInMasterSP(); try { decimal decvouchertypeId = 0; decimal decLedgerId = 0; string strInvoiceNo = string.Empty; strInvoiceNo = (txtRejectionInNo.Text.Trim() == string.Empty) ? string.Empty : txtRejectionInNo.Text; decLedgerId = (cmbCashorParty.SelectedIndex == 0 || cmbCashorParty.SelectedIndex == -1) ? -1 : Convert.ToDecimal(cmbCashorParty.SelectedValue.ToString()); decvouchertypeId = (cmbVoucherType.SelectedIndex == 0 || cmbVoucherType.SelectedIndex == -1) ? -1 : Convert.ToDecimal(cmbVoucherType.SelectedValue.ToString()); DateTime FromDate = this.dtpFromDate.Value; DateTime ToDate = this.dtpToDate.Value; DataTable dtbl = new DataTable(); dgvRejectionInRegister.DataSource = SpRejectionInMaster.RejectionInRegisterFill(FromDate, ToDate, decLedgerId, strInvoiceNo, decvouchertypeId); } catch (Exception ex) { formMDI.infoError.ErrorString = "RIREG1:" + ex.Message; } }