Пример #1
0
        /// <summary>
        /// 线路区域初始化
        /// </summary>
        /// <param name="selectValue"></param>
        protected void DdlAreaInit(string selectValue)
        {
            //清空下拉框值
            this.ddlLineArea.Items.Clear();
            //添加默认行
            this.ddlLineArea.Items.Add(new ListItem("--请选择--", "0"));
            //获得线路区域集合
            IList <EyouSoft.Model.CompanyStructure.Area> areaList = new EyouSoft.BLL.CompanyStructure.Area(SiteUserInfo).GetAreas();

            if (areaList != null && areaList.Count > 0)
            {
                //将数据添加至下拉框
                for (int i = 0; i < areaList.Count; i++)
                {
                    ListItem item = new ListItem();
                    item.Value = areaList[i].Id.ToString();
                    item.Text  = areaList[i].AreaName;
                    this.ddlLineArea.Items.Add(item);
                }
                //设置选中行
                if (selectValue != "")
                {
                    this.ddlLineArea.SelectedValue = selectValue;
                }
            }
        }
Пример #2
0
        protected void GetSettleByArea(int areaId, string selectVal)
        {
            //声明bll对象
            EyouSoft.Model.CompanyStructure.Area             model = new EyouSoft.BLL.CompanyStructure.Area().GetModel(areaId);
            IList <EyouSoft.Model.CompanyStructure.UserArea> list  = null;

            if (model != null)
            {
                list = model.AreaUserList;
            }
            this.ddlSeller.Items.Clear();
            this.ddlSeller.Items.Add(new ListItem("--请选择--", "-1"));
            if (list != null && list.Count > 0)
            {
                for (int i = 0; i < list.Count; i++)
                {
                    ListItem item = new ListItem();
                    item.Value = list[i].UserId.ToString();
                    item.Text  = list[i].ContactName;
                    this.ddlSeller.Items.Add(item);
                }
            }

            if (selectVal.Trim() != "")
            {
                this.ddlSeller.SelectedValue = selectVal;
            }
        }
Пример #3
0
        /// <summary>
        /// 绑定区域
        /// </summary>
        void BindArea()
        {
            //List<Area> list = new List<Area>();
            //list.Add(new Area(-1, "请选择区域"));
            //for (int i = 1; i < 10; i++)
            //{
            //    list.Add(new Area(i, "线路" + i.ToString()));
            //}
            //ddl_area.DataSource = list;
            //ddl_area.DataTextField = "AreaName";
            //ddl_area.DataValueField = "AreaId";
            //ddl_area.DataBind();
            //ddl_area.Items.FindByValue("-1").Selected = true;
            //list = null;

            EyouSoft.BLL.CompanyStructure.Area area = new EyouSoft.BLL.CompanyStructure.Area(SiteUserInfo);
            int userid = SiteUserInfo.ID;
            IList <EyouSoft.Model.CompanyStructure.Area> list = new List <EyouSoft.Model.CompanyStructure.Area>();

            if (Request.QueryString["act"] == "update")
            {
                list = area.GetAreas();
            }
            else
            {
                list = area.GetAreaList(userid);
            }
            ddl_area.Items.Add(new ListItem("-请选择-", "-1"));
            ddl_area.Items.FindByValue("-1").Selected = true;
            foreach (var v in list)
            {
                ddl_area.Items.Add(new ListItem(v.AreaName, v.Id.ToString()));
            }
        }
Пример #4
0
        /// <summary>
        /// 绑定区域
        /// </summary>
        void BindArea()
        {
            EyouSoft.BLL.CompanyStructure.Area area = new EyouSoft.BLL.CompanyStructure.Area(SiteUserInfo);
            int userid = SiteUserInfo.ID;
            IList <EyouSoft.Model.CompanyStructure.Area> list = new List <EyouSoft.Model.CompanyStructure.Area>();

            if (Request.QueryString["act"] == "update")
            {
                list = area.GetAreas();
            }
            else
            {
                list = area.GetAreaList(userid);
            }
            ddl_area.Items.Add(new ListItem("-请选择-", "-1"));
            ddl_area.Items.FindByValue("-1").Selected = true;
            foreach (var v in list)
            {
                ddl_area.Items.Add(new ListItem(v.AreaName, v.Id.ToString()));
            }
        }