private void frmQualifier_Load(object sender, EventArgs e) { if (m_bPayTypewise == true) { DataTable dt = new DataTable(); dt = UnitDirBL.GetQualifier(m_iFlatId); grdQual.DataSource = dt; grdViewQual.PopulateColumns(); grdViewQual.Columns["QualifierName"].Width = 150; grdViewQual.Columns["Sign"].Width = 50; grdViewQual.Columns["Amount"].Width = 50; grdViewQual.Columns["Amount"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Custom; } else { DataTable dtTax = new DataTable(); dtTax = OtherCostBL.GetQualifierMaster("B", m_iFlatId, "Flat"); grdQual.DataSource = dtTax; grdViewQual.PopulateColumns(); grdViewQual.Columns["QualifierId"].Visible = false; grdViewQual.Columns["Amount"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum; grdViewQual.Columns["Amount"].SummaryItem.DisplayFormat = BsfGlobal.g_sDigitFormatS; RepositoryItemTextEdit txtAmt = new RepositoryItemTextEdit(); grdViewQual.Columns["Amount"].ColumnEdit = txtAmt; txtAmt.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric; txtAmt.Mask.EditMask = BsfGlobal.g_sDigitFormat; txtAmt.Mask.UseMaskAsDisplayFormat = true; grdViewQual.OptionsCustomization.AllowFilter = false; grdViewQual.OptionsBehavior.AllowIncrementalSearch = true; grdViewQual.OptionsView.ShowAutoFilterRow = false; grdViewQual.OptionsView.ShowViewCaption = false; grdViewQual.OptionsView.ShowFooter = true; grdViewQual.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect; grdViewQual.OptionsSelection.InvertSelection = false; grdViewQual.OptionsView.ColumnAutoWidth = true; grdViewQual.Appearance.HeaderPanel.Font = new Font(grdViewQual.Appearance.HeaderPanel.Font, FontStyle.Bold); grdViewQual.Appearance.FocusedCell.BackColor = Color.Teal; grdViewQual.Appearance.FocusedCell.ForeColor = Color.White; grdViewQual.Appearance.FocusedRow.ForeColor = Color.Black; grdViewQual.Appearance.FocusedRow.BackColor = Color.Teal; grdViewQual.OptionsSelection.EnableAppearanceHideSelection = false; } }
private void radioGroup1_SelectedIndexChanged(object sender, EventArgs e) { DataTable dt = new DataTable(); dt = OtherCostBL.GetOtherInfraAmount(m_iFlatTypeId, m_iFlatId); if (dt.Rows.Count > 0) { if (radioGroup1.SelectedIndex == 0) { txtAmt.EditValue = Convert.ToDecimal(dt.Rows[0]["BaseAmt"]); m_sAmountType = "B"; } else { txtAmt.EditValue = Convert.ToDecimal(dt.Rows[0]["NetAmt"]); m_sAmountType = "N"; } txtNetAmt.EditValue = decimal.Round(Convert.ToDecimal(txtAmt.EditValue) * Convert.ToDecimal(txtPer.EditValue) / 100, 0); } }
private void EditData() { DataTable dt = new DataTable(); if (dtRetn != null) { if (dtRetn.Rows.Count > 0) { DataView dv = new DataView(dtRetn); dv.RowFilter = "OtherCostId=" + m_iOCId + ""; dt = dv.ToTable(); if (dt.Rows.Count > 0) { txtArea.EditValue = Convert.ToDecimal(CommFun.IsNullCheck(dt.Rows[0]["Area"], CommFun.datatypes.vartypenumeric)); txtRate.EditValue = Convert.ToDecimal(CommFun.IsNullCheck(dt.Rows[0]["Rate"], CommFun.datatypes.vartypenumeric)); cboUnit.EditValue = Convert.ToInt32(CommFun.IsNullCheck(dt.Rows[0]["Unit"], CommFun.datatypes.vartypenumeric)); txtAmt.EditValue = Convert.ToDecimal(CommFun.IsNullCheck(dt.Rows[0]["Amount"], CommFun.datatypes.vartypenumeric)); } } } if (m_sType == "FlatType") { dt = OtherCostBL.GetFlatTypeOtherArea(m_iFlatTypeId, m_iOCId); if (dt.Rows.Count > 0) { txtArea.EditValue = Convert.ToDecimal(CommFun.IsNullCheck(dt.Rows[0]["Area"], CommFun.datatypes.vartypenumeric)); txtRate.EditValue = Convert.ToDecimal(CommFun.IsNullCheck(dt.Rows[0]["Rate"], CommFun.datatypes.vartypenumeric)); cboUnit.EditValue = Convert.ToInt32(CommFun.IsNullCheck(dt.Rows[0]["Unit"], CommFun.datatypes.vartypenumeric)); txtAmt.EditValue = Convert.ToDecimal(CommFun.IsNullCheck(dt.Rows[0]["Amount"], CommFun.datatypes.vartypenumeric)); } } else if (m_sType == "Flat" || m_sType == "GlobalRate") { dt = OtherCostBL.GetFlatOtherArea(m_iFlatId, m_iOCId); if (dt.Rows.Count > 0) { txtArea.EditValue = Convert.ToDecimal(CommFun.IsNullCheck(dt.Rows[0]["Area"], CommFun.datatypes.vartypenumeric)); txtRate.EditValue = Convert.ToDecimal(CommFun.IsNullCheck(dt.Rows[0]["Rate"], CommFun.datatypes.vartypenumeric)); cboUnit.EditValue = Convert.ToInt32(CommFun.IsNullCheck(dt.Rows[0]["Unit"], CommFun.datatypes.vartypenumeric)); txtAmt.EditValue = Convert.ToDecimal(CommFun.IsNullCheck(dt.Rows[0]["Amount"], CommFun.datatypes.vartypenumeric)); } } }
private void frmOtherInfra_Load(object sender, EventArgs e) { radioGroup1.SelectedIndex = 0; DataTable dt = new DataTable(); dt = OtherCostBL.GetOtherInfraAmount(m_iFlatTypeId, m_iFlatId); if (dt.Rows.Count > 0) { if (radioGroup1.SelectedIndex == 0) { txtAmt.EditValue = Convert.ToDecimal(dt.Rows[0]["BaseAmt"]); m_sAmountType = "B"; } else { txtAmt.EditValue = Convert.ToDecimal(dt.Rows[0]["NetAmt"]); m_sAmountType = "N"; } } PopulateEditData(); }
private void PopulateEditData() { DataTable dt = new DataTable(); if (dtRetn != null) { if (dtRetn.Rows.Count > 0) { DataView dv = new DataView(dtRetn); dv.RowFilter = "OtherCostId=" + m_iOCId + ""; dt = dv.ToTable(); if (dt.Rows.Count > 0) { if (CommFun.IsNullCheck(dt.Rows[0]["AmountType"], CommFun.datatypes.vartypestring).ToString() == "B") { radioGroup1.SelectedIndex = 0; } else { radioGroup1.SelectedIndex = 1; } txtPer.EditValue = Convert.ToDecimal(CommFun.IsNullCheck(dt.Rows[0]["Percent"], CommFun.datatypes.vartypenumeric)); txtNetAmt.EditValue = Convert.ToDecimal(CommFun.IsNullCheck(dt.Rows[0]["Amount"], CommFun.datatypes.vartypenumeric)); } } } if (m_sType == "FlatType") { dt = OtherCostBL.GetFlatTypeOtherInfra(m_iFlatTypeId, m_iOCId); if (dt.Rows.Count > 0) { if (CommFun.IsNullCheck(dt.Rows[0]["AmountType"], CommFun.datatypes.vartypestring).ToString() == "B") { radioGroup1.SelectedIndex = 0; } else { radioGroup1.SelectedIndex = 1; } txtPer.EditValue = Convert.ToDecimal(CommFun.IsNullCheck(dt.Rows[0]["Percent"], CommFun.datatypes.vartypenumeric)); txtNetAmt.EditValue = Convert.ToDecimal(CommFun.IsNullCheck(dt.Rows[0]["Amount"], CommFun.datatypes.vartypenumeric)); } } else if (m_sType == "Flat" || m_sType == "GlobalRate") { dt = OtherCostBL.GetFlatOtherInfra(m_iFlatId, m_iOCId); if (dt.Rows.Count > 0) { if (CommFun.IsNullCheck(dt.Rows[0]["AmountType"], CommFun.datatypes.vartypestring).ToString() == "B") { radioGroup1.SelectedIndex = 0; } else { radioGroup1.SelectedIndex = 1; } txtPer.EditValue = Convert.ToDecimal(CommFun.IsNullCheck(dt.Rows[0]["Percent"], CommFun.datatypes.vartypenumeric)); txtNetAmt.EditValue = Convert.ToDecimal(CommFun.IsNullCheck(dt.Rows[0]["Amount"], CommFun.datatypes.vartypenumeric)); } } }