Example #1
0
        private void frmFinalization_Load(object sender, EventArgs e)
        {
            bool bCheckBill = PaymentScheduleBL.CheckBillPassed(m_iFlatId);

            if (bCheckBill == true)
            {
                btnOk.Enabled = false;
            }

            FillBrokerDet();
            FillExec();

            if ((m_iFlatId != 0) && (m_sMode == "E"))
            {
                bedit = true;
                EditFinalization();
                bedit = false;
            }
        }
Example #2
0
        private void PopulatePaySchFlat()
        {
            dtPaySchFlat = new DataTable();
            dtPaySchFlat = PaymentScheduleBL.GetPaymentScheduleFlat(m_iCCId, m_iFlatId);

            grdPayFlat.DataSource = null;
            grdViewPayFlat.Columns.Clear();

            grdPayFlat.DataSource = dtPaySchFlat;
            grdViewPayFlat.PopulateColumns();

            grdViewPayFlat.Columns["PaymentSchId"].Visible     = false;
            grdViewPayFlat.Columns["SchType"].Visible          = false;
            grdViewPayFlat.Columns["TemplateId"].Visible       = false;
            grdViewPayFlat.Columns["LevelName"].Visible        = false;
            grdViewPayFlat.Columns["BlockName"].Visible        = false;
            grdViewPayFlat.Columns["NetAmount"].Visible        = false;
            grdViewPayFlat.Columns["CumulativeAmount"].Visible = false;

            grdViewPayFlat.Columns["SchPercent"].Caption = "%";

            grdViewPayFlat.Columns["Description"].OptionsColumn.AllowEdit = false;
            grdViewPayFlat.Columns["Amount"].OptionsColumn.AllowEdit      = false;
            grdViewPayFlat.Columns["SchDate"].OptionsColumn.AllowEdit     = true;

            bool bCheckBill = PaymentScheduleBL.CheckBillPassed(m_iFlatId);

            if (bCheckBill == true)
            {
                grdViewPayFlat.Columns["SchPercent"].OptionsColumn.AllowEdit = false;
                btnOK.Enabled = false;
            }
            else
            {
                grdViewPayFlat.Columns["SchPercent"].OptionsColumn.AllowEdit = true;
                btnOK.Enabled = true;
            }

            RepositoryItemButtonEdit txtDEdit = new RepositoryItemButtonEdit()
            {
                TextEditStyle = TextEditStyles.DisableTextEditor
            };

            txtDEdit.DisplayFormat.FormatType            = DevExpress.Utils.FormatType.DateTime;
            txtDEdit.DisplayFormat.FormatString          = "dd/MM/yyyy";
            grdViewPayFlat.Columns["SchDate"].ColumnEdit = txtDEdit;
            txtDEdit.DoubleClick += txtDEdit_DoubleClick;

            RepositoryItemTextEdit txtSchPer = new RepositoryItemTextEdit();

            grdViewPayFlat.Columns["SchPercent"].ColumnEdit = txtSchPer;
            txtSchPer.Mask.EditMask = BsfGlobal.g_sDigitFormat;
            grdViewPayFlat.Columns["SchPercent"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Custom;
            txtSchPer.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
            txtSchPer.Mask.UseMaskAsDisplayFormat = true;
            txtSchPer.EditValueChanged           += txtSchPer_EditValueChanged;

            RepositoryItemTextEdit txtAmt = new RepositoryItemTextEdit();

            grdViewPayFlat.Columns["Amount"].ColumnEdit = txtAmt;
            txtAmt.Mask.EditMask = BsfGlobal.g_sDigitFormat;
            grdViewPayFlat.Columns["Amount"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Custom;
            txtAmt.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
            txtAmt.Mask.UseMaskAsDisplayFormat = true;

            RepositoryItemButtonEdit txtAmtEdit = new RepositoryItemButtonEdit();

            txtAmtEdit.TextEditStyle = TextEditStyles.DisableTextEditor;
            grdViewPayFlat.Columns["NetAmount"].ColumnEdit = txtAmtEdit;
            txtAmtEdit.Mask.EditMask = BsfGlobal.g_sDigitFormat;
            txtAmtEdit.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
            txtAmtEdit.DoubleClick  += txtAmtEdit_DoubleClick;
            //txtAmtEdit.EditValueChanged += txtPerEdit_EditValueChanged;

            grdViewPayFlat.Columns["Description"].Width = 300;
            grdViewPayFlat.Columns["SchDate"].Width     = 100;
            grdViewPayFlat.Columns["SchPercent"].Width  = 60;
            grdViewPayFlat.Columns["Amount"].Width      = 100;
            grdViewPayFlat.Columns["NetAmount"].Width   = 100;

            grdViewPayFlat.Columns["SchPercent"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
            grdViewPayFlat.Columns["SchPercent"].SummaryItem.SummaryType   = DevExpress.Data.SummaryItemType.Sum;
            grdViewPayFlat.Columns["SchPercent"].SummaryItem.DisplayFormat = BsfGlobal.g_sDigitFormatS;

            grdViewPayFlat.Columns["Amount"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
            grdViewPayFlat.Columns["Amount"].SummaryItem.SummaryType   = DevExpress.Data.SummaryItemType.Sum;
            grdViewPayFlat.Columns["Amount"].SummaryItem.DisplayFormat = BsfGlobal.g_sDigitFormatS;

            grdViewPayFlat.Columns["NetAmount"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
            grdViewPayFlat.Columns["NetAmount"].SummaryItem.SummaryType   = DevExpress.Data.SummaryItemType.Sum;
            grdViewPayFlat.Columns["NetAmount"].SummaryItem.DisplayFormat = BsfGlobal.g_sDigitFormatS;

            grdViewPayFlat.OptionsCustomization.AllowFilter       = false;
            grdViewPayFlat.OptionsBehavior.AllowIncrementalSearch = true;
            grdViewPayFlat.OptionsView.ShowFooter      = true;
            grdViewPayFlat.OptionsView.ColumnAutoWidth = true;
            grdViewPayFlat.FocusedRowHandle            = 0;
            grdViewPayFlat.FocusedColumn = grdViewPayFlat.VisibleColumns[0];

            grdViewPayFlat.OptionsSelection.InvertSelection = true;
            grdViewPayFlat.OptionsSelection.EnableAppearanceHideSelection = false;
            grdViewPayFlat.Appearance.FocusedRow.BackColor = Color.Teal;
            grdViewPayFlat.Appearance.FocusedRow.ForeColor = Color.White;
            //grdViewPayFlat.BestFitColumns();
        }