Ejemplo n.º 1
0
        private void InitialDataBind()
        {
            DataSet ds;

            #region 绑定用户下拉列表
            string[] str = new string[3] {
                "AA", "AG", "PG"
            };

            User user = new User();

            for (int i = 0; i < str.Length; i++)
            {
                ds = new DataSet();
                ds = user.GetUsersByType(str[i].ToString(), "");

                for (int j = 0; j < ds.Tables[0].Rows.Count; j++)
                {
                    string userID   = ds.Tables[0].Rows[j]["UserID"].ToString();
                    string userName = ds.Tables[0].Rows[j]["UserName"].ToString();

                    ListItem li = new ListItem(userName, userID);
                    this.ddlUser.Items.Add(li);
                }

                ds.Dispose();
            }
            #endregion

            #region 绑定代理商列表

            string strWhere = "";
            MmyeeAd.BLL.ADManage.AdAgent bll = new MmyeeAd.BLL.ADManage.AdAgent();

            ds = new DataSet();
            ds = bll.GetList(strWhere);

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                string agentID   = ds.Tables[0].Rows[i]["AgentID"].ToString();
                string agentName = ds.Tables[0].Rows[i]["AgentName"].ToString();

                ListItem li = new ListItem(agentName, agentID);
                this.AllAgentList.Items.Add(li);
            }

            ds.Dispose();

            #endregion
        }
Ejemplo n.º 2
0
        private void InitialDataBind()
        {
            DataSet ds;

            #region 绑定用户下拉列表
            string[] str = new string[3] { "AA", "AG", "PG" };

            User user = new User();

            for (int i = 0; i < str.Length;i++ )
            {
                ds = new DataSet();
                ds = user.GetUsersByType(str[i].ToString(),"");

                for (int j = 0; j < ds.Tables[0].Rows.Count;j++ )
                {
                    string userID = ds.Tables[0].Rows[j]["UserID"].ToString();
                    string userName = ds.Tables[0].Rows[j]["UserName"].ToString();

                    ListItem li = new ListItem(userName,userID);
                    this.ddlUser.Items.Add(li);
                }

                ds.Dispose();
            }
            #endregion

            #region 绑定代理商列表

            string strWhere = "";
            MmyeeAd.BLL.ADManage.AdAgent bll = new MmyeeAd.BLL.ADManage.AdAgent();

            ds = new DataSet();
            ds = bll.GetList(strWhere);

            for (int i = 0; i < ds.Tables[0].Rows.Count;i++ )
            {
                string agentID = ds.Tables[0].Rows[i]["AgentID"].ToString();
                string agentName = ds.Tables[0].Rows[i]["AgentName"].ToString();

                ListItem li = new ListItem(agentName, agentID);
                this.AllAgentList.Items.Add(li);
            }

            ds.Dispose();

            #endregion
        }