Пример #1
0
        /// <summary>
        /// 返回部门显示
        /// </summary>
        /// <param name="departid">部门的id值</param>
        public string ShowDepart(string departid)
        {
            string result = "";
            int    id     = int.Parse(departid);

            EtNet_Models.DepartmentInfo model = EtNet_BLL.DepartmentInfoManager.getDepartmentInfoById(id);
            if (model != null)
            {
                result = model.Departcname;
            }
            return(result);
        }
Пример #2
0
 /// <summary>
 /// 根据部门名称得到部门ID
 /// </summary>
 /// <param name="departid">部门的id值</param>
 public int getDepartid(string departname)
 {
     EtNet_Models.DepartmentInfo model = EtNet_BLL.DepartmentInfoManager.getDepartmentInfoBydepartcname(departname);
     if (model != null)
     {
         return(model.Departid);
     }
     else
     {
         return(-1);
     }
 }
Пример #3
0
        /// <summary>
        /// 加载部门列表数据
        /// </summary>
        private void LoadDepartList()
        {
            IList <EtNet_Models.DepartmentInfo> list = EtNet_BLL.DepartmentInfoManager.getDepartmentInfoAll();

            EtNet_Models.DepartmentInfo model = new EtNet_Models.DepartmentInfo();
            model.Departid    = 0;
            model.Departcname = "——请选择——";
            list.Insert(0, model);
            this.ddldepart.DataTextField  = "departcname";
            this.ddldepart.DataValueField = "departid";
            this.ddldepart.DataSource     = list;
            this.ddldepart.DataBind();
        }