/// <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) { MessageBox.Show("RIReport:04" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { MessageBox.Show("RIReport:3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <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 VoucherType combobox /// </summary> public void VoucherTypeComboFill() { RejectionInMasterSP spRejectionInMaster = new RejectionInMasterSP(); try { spRejectionInMaster.VoucherTypeSelectionFill(cmbVoucherType, "Rejection In", true); } catch (Exception ex) { MessageBox.Show("RIReport:05" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <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 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) { MessageBox.Show("RIReport:06" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <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) { MessageBox.Show("RIReport:08" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <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) { MessageBox.Show("RIRgstr:01" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <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; } }
/// <summary> /// function to Rejection In updation /// </summary> public void RejectionInview() { decimal decRejectioInMasterId = 0; try { btnSave.Text = "Update"; btnDelete.Enabled = true; isFromRejectionInRegister = true; RejectionInMasterSP SpRejectionInMaster = new RejectionInMasterSP(); RejectionInMasterInfo InfoRejectionInMaster = new RejectionInMasterInfo(); InfoRejectionInMaster = SpRejectionInMaster.RejectionInMasterView(decRejectionInIdToEdit); DeliveryNoteMasterSP SpDeliveryNoteMaster = new DeliveryNoteMasterSP(); DeliveryNoteMasterInfo InfoDeliveryNoteMaster = new DeliveryNoteMasterInfo(); InfoDeliveryNoteMaster = SpDeliveryNoteMaster.DeliveryNoteMasterView(InfoRejectionInMaster.DeliveryNoteMasterId); strRejectionInVoucherNo = SpRejectionInMaster.GetRejectionInVoucherNo(InfoRejectionInMaster.RejectionInMasterId); decRejectionInVoucherTypeId = InfoRejectionInMaster.VoucherTypeId; decRejectionInSuffixPrefixId = InfoRejectionInMaster.SuffixPrefixId; strVoucherNo = InfoRejectionInMaster.VoucherNo; VoucherTypeSP spVoucherType = new VoucherTypeSP(); isAutomatic = spVoucherType.CheckMethodOfVoucherNumbering(decRejectionInVoucherTypeId); if (!isAutomatic) { txtRejectionInNo.ReadOnly = false; txtRejectionInNo.Focus(); } else { txtRejectionInNo.ReadOnly = true; txtDate.Focus(); } txtRejectionInNo.Text = InfoRejectionInMaster.InvoiceNo; txtDate.Text = InfoRejectionInMaster.Date.ToString("dd-MMM-yyyy"); dtpDate.Value = Convert.ToDateTime(txtDate.Text); cmbCashorParty.SelectedValue = InfoRejectionInMaster.LedgerId; cmbVoucherType.SelectedValue = InfoDeliveryNoteMaster.VoucherTypeId; cmbPricingLevel.SelectedValue = InfoRejectionInMaster.PricinglevelId; cmbDeliveryNoteNo.SelectedValue = InfoRejectionInMaster.DeliveryNoteMasterId; cmbSalesMan.SelectedValue = InfoRejectionInMaster.EmployeeId; cmbCurrency.SelectedValue = InfoRejectionInMaster.ExchangeRateId; txtTransportationCompany.Text = InfoRejectionInMaster.TransportationCompany; txtNarration.Text = InfoRejectionInMaster.Narration; txtLRNo.Text = InfoRejectionInMaster.LrNo; txtTotalAmount.Text = Convert.ToString(InfoRejectionInMaster.TotalAmount); RejectionInDetailsSP SpRejectionInDetails = new RejectionInDetailsSP(); DataTable dtblRejectionInDetails = SpRejectionInDetails.RejectionInDetailsViewByRejectionInMasterId(decRejectionInIdToEdit); decRejectioInMasterId = Convert.ToDecimal(dtblRejectionInDetails.Rows[0]["voucherTypeId"].ToString()); VoucherTypeInfo infoVoucherType = new VoucherTypeInfo(); infoVoucherType = spVoucherType.VoucherTypeView(decRejectioInMasterId); this.Text = infoVoucherType.VoucherTypeName; foreach (DataRow drRejectionInDetails in dtblRejectionInDetails.Rows) { isDoCellValueChange = false; DGVGodownComboFill(); dgvProduct.Rows.Add(); dgvProduct.Rows[dgvProduct.Rows.Count - 1].Cells["dgvtxtProductId"].Value = drRejectionInDetails["productId"].ToString(); dgvProduct.Rows[dgvProduct.Rows.Count - 1].Cells["dgvtxDeliveryNoteDetailsId"].Value = drRejectionInDetails.ItemArray[2].ToString(); AssignProductDefaultValues(dgvProduct.Rows.Count - 1, Convert.ToDecimal(drRejectionInDetails.ItemArray[3].ToString())); DGVBatchComboFill(dgvProduct.Rows.Count - 1, Convert.ToDecimal(drRejectionInDetails.ItemArray[3].ToString())); dgvProduct.Rows[dgvProduct.Rows.Count - 1].Cells["dgvtxtQuantity"].Value = drRejectionInDetails["qty"].ToString(); isDoCellValueChange = true; dgvProduct.Rows[dgvProduct.Rows.Count - 1].Cells["dgvcmbUnit"].Value = Convert.ToDecimal(drRejectionInDetails["unitId"].ToString()); dgvProduct.Rows[dgvProduct.Rows.Count - 1].Cells["dgvtxtUnitConversionId"].Value = Convert.ToDecimal(drRejectionInDetails["unitconversionId"].ToString()); dgvProduct.Rows[dgvProduct.Rows.Count - 1].Cells["dgvcmbGodown"].Value = Convert.ToDecimal(drRejectionInDetails["godownId"].ToString()); dgvProduct.Rows[dgvProduct.Rows.Count - 1].Cells["dgvcmbRack"].Value = Convert.ToDecimal(drRejectionInDetails["rackId"].ToString()); dgvProduct.Rows[dgvProduct.Rows.Count - 1].Cells["dgvcmbBatch"].Value = Convert.ToDecimal(drRejectionInDetails["batchId"].ToString()); dgvProduct.Rows[dgvProduct.Rows.Count - 1].Cells["dgvtxtRate"].Value = drRejectionInDetails["rate"].ToString(); dgvProduct.Rows[dgvProduct.Rows.Count - 1].Cells["dgvtxtAmount"].Value = drRejectionInDetails["amount"].ToString(); dgvProduct.CurrentCell = null; } SerialNo(); CalcTotalAmt(); isDoCellValueChange = true; isDoAfterGridFill = true; isFromRejectionInRegister = false; } catch (Exception ex) { MessageBox.Show("RI:35" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill Account ledger combobox while return from ledger creation when creating new ledger /// </summary> /// <param name="decId"></param> public void ReturnFromAccountLedgerForm(decimal decLedgerId) { AccountLedgerInfo infoAccountLedger = new AccountLedgerInfo(); AccountLedgerSP spAccountLedger = new AccountLedgerSP(); RejectionInMasterSP spRejectionOutMaster = new RejectionInMasterSP(); DataTable dtbl = new DataTable(); try { CashOrPartyComboFill(); if (decLedgerId.ToString() != "0") { cmbCashOrParty.SelectedValue = decLedgerId; cmbCashOrParty.Focus(); } else if (strCashOrParty != string.Empty) { cmbCashOrParty.SelectedItem = strCashOrParty; cmbCashOrParty.Focus(); } else { cmbCashOrParty.SelectedIndex = -1; } } catch (Exception ex) { MessageBox.Show("RO42:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }