Ejemplo n.º 1
0
        private void FillGrid()
        {
            try
            {
                if (m_sBuyerId == "")
                {
                    grdDemand.DataSource = null; return;
                }
                DataTable dtBind = new DataTable();
                dtBuyer = new DataTable();
                DataTable dt = new DataTable();
                DataSet   ds = new DataSet();
                ds      = ProgBillBL.GetDemandAge(m_iFromDays, m_iToDays, m_iCCId);
                dt      = ds.Tables[0];
                dtBuyer = ds.Tables[1];
                dtBind  = ds.Tables[2];

                DataView dv = new DataView(dtBind);
                dv.RowFilter         = "LeadId In(" + m_sBuyerId.TrimEnd(',') + ")";
                dtBind               = dv.ToTable();
                grdDemand.DataSource = null;
                //grdDemand.DataSource = dtBind;
                grdDemand.DataSource = dtBuyer;

                grdViewDemand.PopulateColumns();
                grdDemand.ForceInitialize();

                grdViewDemand.Columns["PBillId"].Visible      = false;
                grdViewDemand.Columns["CostCentreId"].Visible = false;
                grdViewDemand.Columns["FlatId"].Visible       = false;
                grdViewDemand.Columns["PaySchId"].Visible     = false;
                grdViewDemand.Columns["Count"].Visible        = false;
                grdViewDemand.Columns["LeadId"].Visible       = false;
                grdViewDemand.Columns["NoOfDays"].Visible     = false;
                grdViewDemand.Columns["SortOrder"].Visible    = false;

                grdViewDemand.Columns["BillNo"].Width      = 50;
                grdViewDemand.Columns["FlatNo"].Width      = 50;
                grdViewDemand.Columns["BuyerName"].Width   = 100;
                grdViewDemand.Columns["Description"].Width = 200;
                //grdViewDemand.Columns["Count"].Width = 25;
                grdViewDemand.Columns["Sel"].Width      = 50;
                grdViewDemand.Columns["FlatNo"].Caption = CommFun.m_sFuncName + " No";

                grdViewDemand.Columns["NoOfDays"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
                grdViewDemand.Columns["Sel"].AppearanceCell.TextOptions.HAlignment        = DevExpress.Utils.HorzAlignment.Center;
                grdViewDemand.Columns["Sel"].AppearanceHeader.TextOptions.HAlignment      = DevExpress.Utils.HorzAlignment.Center;

                grdViewDemand.OptionsSelection.InvertSelection = true;
                grdViewDemand.OptionsSelection.EnableAppearanceHideSelection = false;
                grdViewDemand.Appearance.FocusedRow.BackColor = Color.Teal;
                grdViewDemand.Appearance.FocusedRow.ForeColor = Color.White;
                //grdViewDemand.BestFitColumns();
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
        }
Ejemplo n.º 2
0
        private string GetBuyer()
        {
            DataSet ds = new DataSet();

            ds      = ProgBillBL.GetDemandAge(m_iFromDays, m_iToDays, m_iCCId);
            dtBuyer = ds.Tables[1];

            m_sBuyerId = "";
            if (dtBuyer.Rows.Count > 0)
            {
                for (int i = 0; i < dtBuyer.Rows.Count; i++)
                {
                    m_sBuyerId = String.Format("{0}{1},", m_sBuyerId, dtBuyer.Rows[i]["LeadId"]);
                }
            }

            return(m_sBuyerId);
        }