private void PopulateFormat1Grid() { gridControl1.DataSource = null; if (rg1.SelectedIndex == -1) { return; } if (rg1.SelectedIndex == 3) { if (dt1.EditValue == null) { return; } if (dt2.EditValue == null) { return; } } DataTable dt = new DataTable(); dt = ReceiptDetailBL.PopulateF1CollectionReport(rg1.SelectedIndex, Convert.ToDateTime(dt1.EditValue), Convert.ToDateTime(dt2.EditValue)); if (dt == null || dt.Columns.Count == 0) { return; } gridControl1.DataSource = dt; gridControl1.ForceInitialize(); gridView1.PopulateColumns(); gridView1.Columns["ProjectName"].Group(); gridView1.Columns["FlatNo"].Group(); gridView1.ExpandAllGroups(); gridView1.Columns["Gross"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; gridView1.Columns["ServiceTax"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; gridView1.Columns["NetAmount"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; gridView1.Columns["Gross"].DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric; gridView1.Columns["Gross"].DisplayFormat.FormatString = BsfGlobal.g_sDigitFormat; gridView1.Columns["ServiceTax"].DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric; gridView1.Columns["ServiceTax"].DisplayFormat.FormatString = BsfGlobal.g_sDigitFormat; gridView1.Columns["NetAmount"].DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric; gridView1.Columns["NetAmount"].DisplayFormat.FormatString = BsfGlobal.g_sDigitFormat; gridView1.Columns["Gross"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum; gridView1.Columns["Gross"].SummaryItem.DisplayFormat = BsfGlobal.g_sDigitFormatS; gridView1.Columns["ServiceTax"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum; gridView1.Columns["ServiceTax"].SummaryItem.DisplayFormat = BsfGlobal.g_sDigitFormatS; gridView1.Columns["NetAmount"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum; gridView1.Columns["NetAmount"].SummaryItem.DisplayFormat = BsfGlobal.g_sDigitFormatS; gridView1.OptionsView.ShowFooter = true; gridView1.FocusedRowHandle = 0; gridView1.Focus(); dt.Dispose(); }
private void grdNarrationView_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { int PRow = grdNarrationView.FocusedRowHandle; int NarrId = Convert.ToInt32(CommFun.IsNullCheck(grdNarrationView.GetFocusedRowCellValue("NarrationId"), CommFun.datatypes.vartypenumeric)); string NarrDescription = Convert.ToString(CommFun.IsNullCheck(grdNarrationView.GetFocusedRowCellValue("Description"), CommFun.datatypes.vartypestring)); ReceiptDetailBL.InsertNarrationMaster(NarrId, NarrDescription); grdNarrationView.FocusedRowHandle = PRow; }
private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { grdViewAcct.FocusedRowHandle = grdViewAcct.FocusedRowHandle + 1; DataTable dt = new DataTable(); dt = grdAcct.DataSource as DataTable; ReceiptDetailBL.UpdateQualAccount(dt, m_sBussinessType); m_boK = true; Close(); }
private void gridViewReceipt_ShowingEditor(object sender, CancelEventArgs e) { if (ReceiptId != 0) { if (gridViewReceipt.FocusedRowHandle < 0) { return; } //int iBillRegId = Convert.ToInt32(gridViewReceipt.GetFocusedRowCellValue("BillRegId")); string sAppr = ReceiptDetailBL.GetApprove(ReceiptId); m_sMode = sAppr; } }
private void FillPaymentMode() { DataTable dt = new DataTable(); dt = ReceiptDetailBL.GetPaymentMode(); cboMode.Properties.Items.Clear(); foreach (DataRow dr in dt.Rows) { cboMode.Properties.Items.Add(dr["PaymentMode"]); } dt.Dispose(); }
private void PopulateGrid() { DataTable dtNarration = new DataTable(); dtNarration = ReceiptDetailBL.PopulateNarrationMaster(); grdNarration.DataSource = dtNarration; grdNarrationView.PopulateColumns(); grdNarrationView.Columns["NarrationId"].Visible = false; DevExpress.XtraEditors.Repository.RepositoryItemMemoEdit txtTerms = new DevExpress.XtraEditors.Repository.RepositoryItemMemoEdit(); grdNarrationView.Columns["Description"].ColumnEdit = txtTerms; grdNarrationView.OptionsView.RowAutoHeight = true; grdNarrationView.Appearance.HeaderPanel.Font = new Font(grdNarrationView.Appearance.HeaderPanel.Font, FontStyle.Bold); }
private void btnDelete_ItemClick(object sender, ItemClickEventArgs e) { if (BsfGlobal.FindPermission("Buyer-Receipt-Delete") == false) { MessageBox.Show("You don't have Rights to Buyer-Receipt-Delete"); return; } if (Convert.ToInt32(grdViewReceipt.FocusedRowHandle) < 0) { return; } int iRepceiptId = Convert.ToInt32(CommFun.IsNullCheck(grdViewReceipt.GetFocusedRowCellValue("ReceiptId"), CommFun.datatypes.vartypenumeric)); string sAppr = ReceiptDetailBL.GetApprove(iRepceiptId); if (sAppr == "P" || sAppr == "Y") { MessageBox.Show("Approved Receipt should not be Deleted"); return; } bool bCheckValidate = ReceiptDetailBL.Check_ReceiptDet(iRepceiptId); if (bCheckValidate == true) { MessageBox.Show("Cannot Delete, Schedule raised to Bill"); return; } try { if (grdViewReceipt.FocusedRowHandle >= 0) { if (MessageBox.Show("Do you want to delete?", "Confirm delete", MessageBoxButtons.YesNo) == DialogResult.Yes) { ReceiptDetailBL.DeleteReceiptDetails(Convert.ToInt32(grdViewReceipt.GetFocusedRowCellValue("ReceiptId")), grdViewReceipt.GetFocusedRowCellValue("PaymentAgainst").ToString()); grdViewReceipt.DeleteRow(grdViewReceipt.FocusedRowHandle); int iCCId = Convert.ToInt32(CommFun.IsNullCheck(grdViewReceipt.GetFocusedRowCellValue("CostCentreId"), CommFun.datatypes.vartypenumeric)); string sRecNo = CommFun.IsNullCheck(grdViewReceipt.GetFocusedRowCellValue("ReceiptNo"), CommFun.datatypes.vartypestring).ToString(); decimal dAmt = Convert.ToInt32(CommFun.IsNullCheck(grdViewReceipt.GetFocusedRowCellValue("Amount"), CommFun.datatypes.vartypenumeric)); //CommFun.InsertLog(DateTime.Now, "Receipt Register-Delete", "D", "Delete Receipt Register", BsfGlobal.g_lUserId, 0, 0, 0, BsfGlobal.g_sCRMDBName); //BsfGlobal.InsertLog(DateTime.Now, "Buyer-Receipt-Delete", "D", "Delete Receipt Register", Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("ReceiptId")), iCCId, 0, BsfGlobal.g_sCRMDBName, sRecNo, BsfGlobal.g_lUserId, dAmt, 0); } } } catch (Exception ex) { throw ex; } }
private void ChangeGridValue(int argEntryId) { DataTable dt = new DataTable(); dt = ReceiptDetailBL.GetChangeGridReceiptRegister(argEntryId); //int iRowId = frmReceiptRegister.m_oGridMasterView.FocusedRowHandle; int iRowId = i_RowId; if (dt.Rows.Count > 0) { frmReceiptRegister.m_oGridMasterView.SetRowCellValue(iRowId, "Amount", Convert.ToDecimal(CommFun.IsNullCheck(dt.Rows[0]["Amount"], CommFun.datatypes.vartypenumeric))); frmReceiptRegister.m_oGridMasterView.RefreshRow(iRowId); frmReceiptRegister.m_oGridMasterView.RefreshData(); } dt.Dispose(); frmReceiptRegister.m_oGridMasterView.FocusedRowHandle = iRowId; }
private void btnDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { DialogResult reply = MessageBox.Show("Do you want to delete this particular Narration ", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (reply == DialogResult.Yes) { if (grdNarrationView.IsNewItemRow(grdNarrationView.FocusedRowHandle) == true) { grdNarrationView.DeleteRow(grdNarrationView.FocusedRowHandle); } else { int NarrId = Convert.ToInt32(CommFun.IsNullCheck(grdNarrationView.GetFocusedRowCellValue("NarrationId").ToString(), CommFun.datatypes.vartypestring)); ReceiptDetailBL.DeleteNarrationMaster(NarrId); grdNarrationView.DeleteRow(grdNarrationView.FocusedRowHandle); } } }
private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e) { if (grdViewReceipt.FocusedRowHandle < 0) { return; } Cursor.Current = Cursors.WaitCursor; int p_RecpId = Convert.ToInt32(grdViewReceipt.GetRowCellValue(grdViewReceipt.FocusedRowHandle, "ReceiptId")); int iCCId = Convert.ToInt32(grdViewReceipt.GetRowCellValue(grdViewReceipt.FocusedRowHandle, "CostCentreId")); string sFlatNo = grdViewReceipt.GetRowCellValue(grdViewReceipt.FocusedRowHandle, "FlatNo").ToString(); string sAns = ReceiptDetailBL.GetReceiptPrint(sFlatNo, iCCId, p_RecpId); ReportDocument cryRpt = new ReportDocument(); string strReportPath = Application.StartupPath + "\\CRMReceiptPrePrint.Rpt"; cryRpt.Load(strReportPath); string s = "{ReceiptRegister.ReceiptId}=" + p_RecpId + " "; string[] DataFiles = new string[] { BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName, BsfGlobal.g_sWorkFlowDBName, BsfGlobal.g_sWorkFlowDBName, BsfGlobal.g_sWorkFlowDBName, BsfGlobal.g_sCRMDBName, BsfGlobal.g_sWorkFlowDBName, BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName }; frmReport objReport = new frmReport(); objReport.ReportConvert(cryRpt, DataFiles); if (s.Length > 0) { cryRpt.RecordSelectionFormula = s; } objReport.rptViewer.ReportSource = null; objReport.rptViewer.SelectionFormula = s; objReport.rptViewer.ReportSource = cryRpt; cryRpt.DataDefinition.FormulaFields["Decimal"].Text = string.Format(CommFun.g_iCurrencyDigit.ToString()); cryRpt.DataDefinition.FormulaFields["Payment"].Text = "'" + string.Format(sAns.ToString()) + "'";// string.Format(sAns.ToString()); objReport.WindowState = FormWindowState.Maximized; objReport.rptViewer.Refresh(); objReport.Show(); Cursor.Current = Cursors.Default; }
private void PopulateGrid() { DataTable dt = new DataTable(); dt = ReceiptDetailBL.GetQualifierAccount(m_sBussinessType); grdAcct.DataSource = dt; grdViewAcct.PopulateColumns(); grdViewAcct.Columns["QualifierId"].Visible = false; grdViewAcct.Columns["AccountId"].Caption = "Account Name"; DataTable dtAccount = new DataTable(); dtAccount = ProgBillBL.GetQualAcct(); DataRow dr = dtAccount.NewRow(); dr["AccountId"] = 0; dr["AccountName"] = "None"; dtAccount.Rows.InsertAt(dr, 0); RepositoryItemLookUpEdit cboAccount = new RepositoryItemLookUpEdit(); cboAccount.DataSource = dtAccount; cboAccount.ValueMember = "AccountId"; cboAccount.DisplayMember = "AccountName"; cboAccount.PopulateColumns(); cboAccount.Columns["AccountId"].Visible = false; cboAccount.ShowFooter = false; cboAccount.ShowHeader = false; grdViewAcct.Columns["AccountId"].ColumnEdit = cboAccount; grdViewAcct.Appearance.HeaderPanel.Font = new Font(grdViewAcct.Appearance.HeaderPanel.Font, FontStyle.Bold); grdViewAcct.Appearance.FocusedCell.BackColor = Color.Teal; grdViewAcct.Appearance.FocusedCell.ForeColor = Color.White; grdViewAcct.Appearance.FocusedRow.ForeColor = Color.White; grdViewAcct.Appearance.FocusedRow.BackColor = Color.Teal; grdViewAcct.OptionsSelection.EnableAppearanceHideSelection = false; }
private void PopulateOtherCost() { try { DataTable dt = new DataTable(); dt = ReceiptDetailBL.GetOtherCost(); lookUpEdit1.Properties.DataSource = CommFun.AddSelectToDataTable(dt); lookUpEdit1.Properties.ValueMember = "OtherCostId"; lookUpEdit1.Properties.DisplayMember = "OtherCostName"; lookUpEdit1.Properties.ForceInitialize(); lookUpEdit1.Properties.PopulateColumns(); lookUpEdit1.Properties.Columns["OtherCostId"].Visible = false; lookUpEdit1.Properties.ShowFooter = false; lookUpEdit1.Properties.ShowHeader = false; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public AjaxResult Get(Guid id) { var ajaxResult = new AjaxResult(); try { using (ReceiptDetailBL receiptDetailBL = new ReceiptDetailBL()) { ajaxResult.Data = receiptDetailBL.GetReceiptDetailByReceiptID(id); ajaxResult.Success = true; ajaxResult.Message = Resources.Success; } } catch (Exception ex) { ajaxResult.Success = false; ajaxResult.Data = ex; ajaxResult.Message = Resources.Error; } return(ajaxResult); }
public void FillData() { m_bLayOut = false; grdReceipt.DataSource = null; dt = new DataTable(); dt = ReceiptDetailBL.GetReceiptRegister(); if (dt == null) { return; } Cursor.Current = Cursors.WaitCursor; grdReceipt.DataSource = dt; grdReceipt.ForceInitialize(); grdViewReceipt.PopulateColumns(); grdViewReceipt.Columns["ReceiptId"].Visible = false; grdViewReceipt.Columns["ReceiptId"].OptionsColumn.ShowInCustomizationForm = false; grdViewReceipt.Columns["Narration"].Visible = false; grdViewReceipt.Columns["ReceiptDate"].Width = 50; grdViewReceipt.Columns["ReceiptDate"].Caption = "Ref. Date"; grdViewReceipt.Columns["ReceiptDate"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; grdViewReceipt.Columns["ReceiptDate"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; grdViewReceipt.Columns["ReceiptNo"].Width = 60; grdViewReceipt.Columns["ReceiptNo"].Caption = "Ref. No"; grdViewReceipt.Columns["ReceiptNo"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; grdViewReceipt.Columns["ReceiptNo"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; grdViewReceipt.Columns["CostCentreId"].Visible = false; grdViewReceipt.Columns["CostCentreId"].OptionsColumn.ShowInCustomizationForm = false; grdViewReceipt.Columns["BuyerName"].Width = 150; grdViewReceipt.Columns["BuyerName"].Caption = "Buyer"; grdViewReceipt.Columns["BuyerName"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; grdViewReceipt.Columns["BuyerName"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; grdViewReceipt.Columns["FlatNo"].Width = 80; grdViewReceipt.Columns["FlatNo"].Caption = CommFun.m_sFuncName + " No"; grdViewReceipt.Columns["FlatNo"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; grdViewReceipt.Columns["FlatNo"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; grdViewReceipt.Columns["CostCentreName"].Width = 170; grdViewReceipt.Columns["CostCentreName"].Caption = "Project"; grdViewReceipt.Columns["CostCentreName"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; grdViewReceipt.Columns["CostCentreName"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; grdViewReceipt.Columns["Amount"].Width = 70; grdViewReceipt.Columns["Amount"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; grdViewReceipt.Columns["Amount"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; grdViewReceipt.Columns["Amount"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum; grdViewReceipt.Columns["Amount"].SummaryItem.DisplayFormat = BsfGlobal.g_sDigitFormatS; grdViewReceipt.Columns["Amount"].DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric; grdViewReceipt.Columns["Amount"].DisplayFormat.FormatString = BsfGlobal.g_sDigitFormat; grdViewReceipt.Columns["PaymentAgainst"].Width = 100; grdViewReceipt.Columns["PaymentAgainst"].Caption = "Pay Type"; grdViewReceipt.Columns["PaymentAgainst"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; grdViewReceipt.Columns["PaymentAgainst"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; grdViewReceipt.Columns["Approve"].Width = 80; grdViewReceipt.Columns["Approve"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; grdViewReceipt.Columns["Approve"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; grdViewReceipt.Columns["ChequeDisbursement"].Width = 100; grdViewReceipt.Columns["ChequeDisbursement"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; grdViewReceipt.Columns["ChequeDisbursement"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; grdViewReceipt.OptionsBehavior.AllowIncrementalSearch = true; grdViewReceipt.OptionsView.ShowAutoFilterRow = true; grdViewReceipt.FocusedRowHandle = 0; grdViewReceipt.FocusedColumn = grdViewReceipt.VisibleColumns[0]; grdViewReceipt.OptionsSelection.InvertSelection = true; grdViewReceipt.OptionsSelection.EnableAppearanceHideSelection = false; grdViewReceipt.Appearance.FocusedRow.BackColor = Color.Teal; grdViewReceipt.Appearance.FocusedRow.ForeColor = Color.White; BsfGlobal.RestoreLayout("CRMReceiptRegister", grdViewReceipt); m_bLayOut = true; Cursor.Current = Cursors.Default; }
public frmPMSReceiptEntry() { oRptBL = new ReceiptDetailBL(); InitializeComponent(); }
void txtTax_DoubleClick(object sender, EventArgs e) { int iReceiptId = Convert.ToInt32(grdViewReceipt.GetRowCellValue(grdViewReceipt.FocusedRowHandle, "ReceiptTypeId")); int iOthId = Convert.ToInt32(grdViewReceipt.GetRowCellValue(grdViewReceipt.FocusedRowHandle, "OtherCostId")); DataView dv = new DataView(m_tQdT); dv.RowFilter = "FlatId = " + m_iFlatId + " And PaymentSchId = " + m_iPayShId + " And ReceiptTypeId = " + iReceiptId + " And OtherCostId = " + iOthId; DataTable dtQ = new DataTable(); dtQ = dv.ToTable(); DataTable dtTQ = new DataTable(); if (dtQ.Rows.Count > 0) { dtTQ = dtQ.GetChanges().Copy(); } else { dtTQ = dtQ.Clone(); } Collection QualVBC = new Collection(); if (dtQ.Rows.Count > 0) { for (int i = 0; i <= dtQ.Rows.Count - 1; i++) { cRateQualR RAQual = new cRateQualR(); RAQual.RateID = Convert.ToInt32(CommFun.IsNullCheck(dtQ.Rows[i]["QualifierId"], CommFun.datatypes.vartypenumeric)); RAQual.ExpPer = Convert.ToDecimal(CommFun.IsNullCheck(dtQ.Rows[i]["ExpPer"], CommFun.datatypes.vartypenumeric)); RAQual.NetPer = Convert.ToDecimal(CommFun.IsNullCheck(dtQ.Rows[i]["NetPer"], CommFun.datatypes.vartypenumeric)); RAQual.SurPer = Convert.ToDecimal(CommFun.IsNullCheck(dtQ.Rows[i]["SurCharge"], CommFun.datatypes.vartypenumeric)); RAQual.EDPer = Convert.ToDecimal(CommFun.IsNullCheck(dtQ.Rows[i]["EDCess"], CommFun.datatypes.vartypenumeric)); RAQual.HEDPer = Convert.ToDecimal(CommFun.IsNullCheck(dtQ.Rows[i]["HEDPer"], CommFun.datatypes.vartypenumeric)); RAQual.TaxablePer = Convert.ToDecimal(CommFun.IsNullCheck(dtQ.Rows[i]["TaxablePer"], CommFun.datatypes.vartypenumeric)); RAQual.Add_Less_Flag = dtQ.Rows[i]["Add_Less_Flag"].ToString(); RAQual.Amount = Convert.ToDecimal(CommFun.IsNullCheck(dtQ.Rows[i]["Amount"], CommFun.datatypes.vartypenumeric)); RAQual.Expression = dtQ.Rows[i]["Expression"].ToString(); QualVBC.Add(RAQual, RAQual.RateID.ToString(), null, null); } } else { for (int k = 0; k < dtQ.Rows.Count; k++) { bool bService = Convert.ToBoolean(CommFun.IsNullCheck(dtQ.Rows[k]["Service"], CommFun.datatypes.varTypeBoolean)); int iQualId = Convert.ToInt32(CommFun.IsNullCheck(dtQ.Rows[k]["QualifierId"], CommFun.datatypes.vartypenumeric)); DataTable dtTDS = new DataTable(); if (Convert.ToInt32(CommFun.IsNullCheck(dtQ.Rows[k]["QualTypeId"], CommFun.datatypes.vartypenumeric)) == 2) { if (bService == true) { dtTDS = ReceiptDetailBL.GetSTSettings("G", m_dDate); } else { dtTDS = ReceiptDetailBL.GetSTSettings("F", m_dDate); } } else { dtTDS = ReceiptDetailBL.GetQual(iQualId, m_dDate); } cRateQualR RAQual = new cRateQualR(); if (dtTDS.Rows.Count > 0) { RAQual.RateID = iQualId; RAQual.ExpPer = Convert.ToDecimal(CommFun.IsNullCheck(dtTDS.Rows[0]["ExpPer"], CommFun.datatypes.vartypenumeric)); RAQual.NetPer = Convert.ToDecimal(CommFun.IsNullCheck(dtTDS.Rows[0]["Net"], CommFun.datatypes.vartypenumeric)); RAQual.SurPer = Convert.ToDecimal(CommFun.IsNullCheck(dtTDS.Rows[0]["SurCharge"], CommFun.datatypes.vartypenumeric)); RAQual.EDPer = Convert.ToDecimal(CommFun.IsNullCheck(dtTDS.Rows[0]["EDCess"], CommFun.datatypes.vartypenumeric)); RAQual.HEDPer = Convert.ToDecimal(CommFun.IsNullCheck(dtTDS.Rows[0]["HEDCess"], CommFun.datatypes.vartypenumeric)); RAQual.TaxablePer = Convert.ToDecimal(CommFun.IsNullCheck(dtTDS.Rows[0]["Taxable"], CommFun.datatypes.vartypenumeric)); } DataTable dtQ1 = new DataTable(); dtQ1 = CRM.DataLayer.PaymentScheduleDL.GetQual(Convert.ToInt32(iQualId), m_dDate, "B"); //dtQ1 = ReceiptDetailBL.QualifierSelect(iQualId, "B", m_dDate); if (dtQ1.Rows.Count > 0) { RAQual.Add_Less_Flag = dtQ1.Rows[0]["Add_Less_Flag"].ToString(); RAQual.Amount = 0; RAQual.Expression = dtQ1.Rows[0]["Expression"].ToString(); } QualVBC.Add(RAQual, RAQual.RateID.ToString(), null, null); } } decimal dQNetAmt = 0; decimal dTaxAmt = 0; decimal dVATAmt = 0; decimal dQBaseAmt = Convert.ToDecimal(CommFun.IsNullCheck(grdViewReceipt.GetRowCellValue(grdViewReceipt.FocusedRowHandle, "PaidGrossAmount"), CommFun.datatypes.vartypenumeric)); Qualifier.frmQualifier qul = new Qualifier.frmQualifier(); if (qul.Execute("B", ref dQBaseAmt, ref QualVBC, ref dQNetAmt, true, "", true, ref dTaxAmt, m_dDate, ref dVATAmt) == true) { int i = 0; while (i < m_tQdT.Rows.Count) { DataRow dr = m_tQdT.Rows[i]; if (Convert.ToInt32(dr["FlatId"]) == m_iFlatId && Convert.ToInt32(dr["PaymentSchId"]) == m_iPayShId && Convert.ToInt32(dr["ReceiptTypeId"]) == iReceiptId && Convert.ToInt32(dr["OtherCostId"]) == iOthId) { m_tQdT.Rows.Remove(dr); } else { i++; } } foreach (Qualifier.cRateQualR d in QualVBC) { DataRow dr1 = m_tQdT.NewRow(); dr1["FlatId"] = m_iFlatId; dr1["PaymentSchId"] = m_iPayShId; dr1["QualifierId"] = d.RateID; DataView dv1 = new DataView(dtTQ); dv1.RowFilter = "QualifierId=" + d.RateID + ""; if (dv1.ToTable().Rows.Count > 0) { dr1["QualTypeId"] = dv1.ToTable().Rows[0]["QualTypeId"]; dr1["Service"] = dv1.ToTable().Rows[0]["Service"]; } dr1["Expression"] = d.Expression; dr1["ExpPer"] = d.ExpPer; dr1["NetPer"] = d.NetPer; dr1["Add_Less_Flag"] = d.Add_Less_Flag; dr1["SurCharge"] = d.SurPer; dr1["EDCess"] = d.EDPer; dr1["HEDPer"] = d.HEDPer; dr1["ExpValue"] = d.ExpValue; dr1["ExpPerValue"] = d.ExpPerValue; dr1["SurValue"] = d.SurValue; dr1["EDValue"] = d.EDValue; dr1["Amount"] = d.Amount; dr1["ReceiptTypeId"] = iReceiptId; dr1["OtherCostId"] = iOthId; dr1["TaxablePer"] = d.TaxablePer; dr1["TaxableValue"] = d.TaxableValue; m_tQdT.Rows.Add(dr1); } grdViewReceipt.SetRowCellValue(grdViewReceipt.FocusedRowHandle, "PaidTaxAmount", dTaxAmt); grdViewReceipt.SetRowCellValue(grdViewReceipt.FocusedRowHandle, "PaidNetAmount", dQNetAmt); } }
void txtGross_EditValueChanged(object sender, EventArgs e) { TextEdit editor = (TextEdit)sender; DataTable dtQ = new DataTable(); DataTable dtTQ = new DataTable(); bool bService = false; int iQualId = 0; decimal dGross = Convert.ToDecimal(CommFun.IsNullCheck(grdViewReceipt.GetRowCellValue(grdViewReceipt.FocusedRowHandle, "GrossAmount"), CommFun.datatypes.vartypenumeric)); decimal dAmt = dGross - Convert.ToDecimal(CommFun.IsNullCheck(grdViewReceipt.GetRowCellValue(grdViewReceipt.FocusedRowHandle, "PaidAmount"), CommFun.datatypes.vartypenumeric)); //decimal dNetAmt = Convert.ToDecimal(CommFun.IsNullCheck(grdViewReceipt.GetRowCellValue(grdViewReceipt.FocusedRowHandle, "NetAmount"), CommFun.datatypes.vartypenumeric)) - Convert.ToDecimal(CommFun.IsNullCheck(grdViewReceipt.GetRowCellValue(grdViewReceipt.FocusedRowHandle, "HPaidNetAmount"), CommFun.datatypes.vartypenumeric)); if (Convert.ToDecimal(CommFun.IsNullCheck(editor.EditValue, CommFun.datatypes.vartypenumeric)) > dAmt) { MessageBox.Show("Invalid Amount"); editor.EditValue = dAmt; } cRateQualR RAQual = new cRateQualR(); Collection QualVBC = new Collection(); //dtQualifier.Columns.Add("FlatId", typeof(int)); //dtQualifier.Columns.Add("PaymentSchId", typeof(int)); int iReceiptId = Convert.ToInt32(grdViewReceipt.GetRowCellValue(grdViewReceipt.FocusedRowHandle, "ReceiptTypeId")); int iOthId = Convert.ToInt32(grdViewReceipt.GetRowCellValue(grdViewReceipt.FocusedRowHandle, "OtherCostId")); DataView dv = new DataView(m_tQdT); dv.RowFilter = "FlatId = " + m_iFlatId + " and PaymentSchId = " + m_iPayShId + " and ReceiptTypeId = " + iReceiptId + " and OtherCostId = " + iOthId; dtQ = dv.ToTable(); if (dtQ.Rows.Count > 0) { dtTQ = dtQ.GetChanges().Copy(); } else { dtTQ = dtQ.Clone(); } for (int k = 0; k < dtQ.Rows.Count; k++) { DataTable dtTDS = new DataTable(); DataTable dtQ1 = new DataTable(); bService = Convert.ToBoolean(dtQ.Rows[k]["Service"]); iQualId = Convert.ToInt32(dtQ.Rows[k]["QualifierId"]); RAQual = new cRateQualR(); if (Convert.ToInt32(dtQ.Rows[k]["QualTypeId"]) == 2) { if (bService == true) { dtTDS = ReceiptDetailBL.GetSTSettings("G", m_dDate); } else { dtTDS = ReceiptDetailBL.GetSTSettings("F", m_dDate); } } else { dtTDS = ReceiptDetailBL.GetQual(iQualId, m_dDate); } dtQ1 = ReceiptDetailBL.QualifierSelect(iQualId, "B", m_dDate); if (dtTDS.Rows.Count > 0) { RAQual.RateID = iQualId; RAQual.ExpPer = Convert.ToDecimal(CommFun.IsNullCheck(dtTDS.Rows[0]["ExpPer"], CommFun.datatypes.vartypenumeric)); RAQual.NetPer = Convert.ToDecimal(CommFun.IsNullCheck(dtTDS.Rows[0]["Net"], CommFun.datatypes.vartypenumeric)); RAQual.SurPer = Convert.ToDecimal(CommFun.IsNullCheck(dtTDS.Rows[0]["SurCharge"], CommFun.datatypes.vartypenumeric)); RAQual.EDPer = Convert.ToDecimal(CommFun.IsNullCheck(dtTDS.Rows[0]["EDCess"], CommFun.datatypes.vartypenumeric)); RAQual.HEDPer = Convert.ToDecimal(CommFun.IsNullCheck(dtTDS.Rows[0]["HEDCess"], CommFun.datatypes.vartypenumeric)); RAQual.HEDValue = 0; RAQual.TaxablePer = Convert.ToDecimal(CommFun.IsNullCheck(dtTDS.Rows[0]["Taxable"], CommFun.datatypes.vartypenumeric)); } if (dtQ1.Rows.Count > 0) { RAQual.Add_Less_Flag = dtQ1.Rows[0]["Add_Less_Flag"].ToString(); RAQual.Amount = 0; RAQual.Expression = dtQ1.Rows[0]["Expression"].ToString(); } //if (dtQ.Rows.Count > 0) //{ // RAQual.Add_Less_Flag = dtQ.Rows[0]["Add_Less_Flag"].ToString(); // RAQual.Amount = 0; // RAQual.Expression = dtQ.Rows[0]["Expression"].ToString(); // RAQual.RateID = Convert.ToInt32(dtQ.Rows[0]["QualifierId"].ToString()); // RAQual.ExpPer = Convert.ToDecimal(CommFun.IsNullCheck(dtQ.Rows[0]["ExpPer"], CommFun.datatypes.vartypenumeric)); // RAQual.NetPer = Convert.ToDecimal(CommFun.IsNullCheck(dtQ.Rows[0]["NetPer"], CommFun.datatypes.vartypenumeric)); // RAQual.SurPer = Convert.ToDecimal(CommFun.IsNullCheck(dtQ.Rows[0]["SurCharge"], CommFun.datatypes.vartypenumeric)); // RAQual.EDPer = Convert.ToDecimal(CommFun.IsNullCheck(dtQ.Rows[0]["EDCess"], CommFun.datatypes.vartypenumeric)); // RAQual.HEDPer = Convert.ToDecimal(CommFun.IsNullCheck(dtQ.Rows[0]["HEDPer"], CommFun.datatypes.vartypenumeric)); // RAQual.HEDValue = 0; // RAQual.TaxablePer = Convert.ToDecimal(CommFun.IsNullCheck(dtQ.Rows[0]["TaxablePer"], CommFun.datatypes.vartypenumeric)); //} QualVBC.Add(RAQual, RAQual.RateID.ToString(), null, null); } Qualifier.frmQualifier qul = new Qualifier.frmQualifier(); decimal dQNetAmt = 0; decimal dTaxAmt = 0; decimal dQBaseAmt = Convert.ToDecimal(CommFun.IsNullCheck(editor.EditValue, CommFun.datatypes.vartypenumeric)); DataRow dr1; decimal dTax = 0; decimal dVATAmt = 0; if (qul.Execute("B", ref dQBaseAmt, ref QualVBC, ref dQNetAmt, false, "", true, ref dTaxAmt, m_dDate, ref dVATAmt) == true) { int i = 0; DataRow dr; while (i < m_tQdT.Rows.Count) { dr = m_tQdT.Rows[i]; if (Convert.ToInt32(dr["FlatId"]) == m_iFlatId && Convert.ToInt32(dr["PaymentSchId"]) == m_iPayShId && Convert.ToInt32(dr["ReceiptTypeId"]) == iReceiptId && Convert.ToInt32(dr["OtherCostId"]) == iOthId) { m_tQdT.Rows.Remove(dr); } else { i++; } } foreach (Qualifier.cRateQualR d in QualVBC) { dr1 = m_tQdT.NewRow(); dr1["FlatId"] = m_iFlatId; dr1["PaymentSchId"] = m_iPayShId; dr1["QualifierId"] = d.RateID; DataView dv1 = new DataView(dtTQ); dv1.RowFilter = "QualifierId=" + d.RateID + ""; dr1["QualTypeId"] = dv1.ToTable().Rows[0]["QualTypeId"]; dr1["Service"] = dv1.ToTable().Rows[0]["Service"]; dr1["Expression"] = d.Expression; dr1["ExpPer"] = d.ExpPer; dr1["NetPer"] = d.NetPer; dTax = d.NetPer; dr1["Add_Less_Flag"] = d.Add_Less_Flag; dr1["SurCharge"] = d.SurPer; dr1["EDCess"] = d.EDPer; dr1["HEDPer"] = d.HEDPer; dr1["ExpValue"] = d.ExpValue; dr1["ExpPerValue"] = d.ExpPerValue; dr1["SurValue"] = d.SurValue; dr1["EDValue"] = d.EDValue; dr1["Amount"] = d.Amount; dr1["ReceiptTypeId"] = iReceiptId; dr1["OtherCostId"] = iOthId; dr1["TaxablePer"] = d.TaxablePer; dr1["TaxableValue"] = d.TaxableValue; m_tQdT.Rows.Add(dr1); } } grdViewReceipt.SetRowCellValue(grdViewReceipt.FocusedRowHandle, "PaidTaxAmount", dTaxAmt); grdViewReceipt.SetRowCellValue(grdViewReceipt.FocusedRowHandle, "PaidNetAmount", dQNetAmt); }