コード例 #1
0
        /// <summary>
        /// this is a overloaded method of 'loadSubBusinessEntity' to refresh the drop downl list
        /// </summary>
        /// <param name="sub"></param>
        protected void loadSubBusinessEntity(subBusinessEntity sub)
        {
            ListItem ltSub = new ListItem();

            ltSub.Text  = sub.getSubEntityName();
            ltSub.Value = sub.getSubEntityId();
            DropDownList1.Items.Add(ltSub);
        }
コード例 #2
0
        protected void populateGrid()
        {
            Dictionary <String, subBusinessEntity> subEntDict = BackEndObjects.MainBusinessEntity.
                                                                getSubEntitiesforMainEntitybyIdDB(Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString());

            DataTable dt = new DataTable();

            dt.Columns.Add("ChainName");
            dt.Columns.Add("ContactNo");
            dt.Columns.Add("ContactName");
            dt.Columns.Add("EmailId");
            dt.Columns.Add("WebSite");
            dt.Columns.Add("RegstrNo");
            dt.Columns.Add("BaseCurr");
            dt.Columns.Add("ChainId");

            int counter = 0;

            foreach (KeyValuePair <String, subBusinessEntity> kvp in subEntDict)
            {
                subBusinessEntity subEntObj = (subBusinessEntity)kvp.Value;
                dt.Rows.Add();

                dt.Rows[counter]["ChainName"]   = subEntObj.getSubEntityName();
                dt.Rows[counter]["ContactNo"]   = subEntObj.getSubPhNo();
                dt.Rows[counter]["ContactName"] = subEntObj.getContactName();
                dt.Rows[counter]["EmailId"]     = subEntObj.getSubEmailId();
                dt.Rows[counter]["WebSite"]     = subEntObj.getSubWebSite();
                dt.Rows[counter]["RegstrNo"]    = subEntObj.getSubRegstrNo();
                dt.Rows[counter]["BaseCurr"]    = BackEndObjects.Currency.getCurrencybyIdDB(subEntObj.getBaseCurrencyId()).getCurrencyName();
                dt.Rows[counter]["ChainId"]     = subEntObj.getSubEntityId();
                //dt.Rows[counter]["dlList"] = dl;
                counter++;
            }

            GridView1.DataSource = dt;
            GridView1.DataBind();
            GridView1.Columns[10].Visible = false;


            Session[SessionFactory.ADMIN_PREF_CHAIN_MGMT_DATA_GRID] = dt;
        }