protected void btnSave_Click(object sender, EventArgs e)
        {
            UserInfo userInfo = GetModel();

            UserInfoBll bll = new UserInfoBll();

            if (UserId == 0)
            {
                DepartmentBll departmentBll = new DepartmentBll();
                DepartmentInfo departmentInfo = departmentBll.GetDepartmentById(DepartmentId);
                if (departmentInfo != null && departmentInfo.DepartmentId > 0)
                {
                    userInfo.DepartmentCode = departmentInfo.DepartmentCode;
                }
                bll.AddUserInfo(userInfo);

            }
            else
            {
                userInfo.UserId = UserId;
                bll.Update(userInfo);
            }

            Page.RegisterClientScriptBlock("", "<script>alert('保存成功');CloseWin();</script>");
        }
        private void InitDepartment()
        {
            DepartmentBll departmentBll = new DepartmentBll();

            DataSet ds = departmentBll.GetAllDepartment();

            ddlDepartment.DataSource = ds;
            ddlDepartment.DataTextField = "DepartmentName";
            ddlDepartment.DataValueField = "DepartmentId";
            ddlDepartment.DataBind();

            ddlDepartment.Items.Insert(0, new ListItem("--请选择--", "0"));
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            DepartmentInfo departmentInfo = GetModel();

            DepartmentBll departmentBll = new DepartmentBll();

            if (DepartmentId == 0)
            {
                departmentBll.AddDepartment(departmentInfo);
            }
            else
            {
                departmentInfo.DepartmentId = DepartmentId;
                departmentBll.Update(departmentInfo);
            }

            Page.RegisterClientScriptBlock("", "<script>alert('保存成功');CloseWin();</script>");
        }
 private void InitData()
 {
     DepartmentBll departmentBll = new DepartmentBll();
        DepartmentInfo departmentInfo = departmentBll.GetDepartmentById(DepartmentId);
     if (departmentInfo != null)
     {
         txtDepartmentCode.Text = departmentInfo.DepartmentCode;
         txtDepartmentName.Text = departmentInfo.DepartmentName;
     }
 }
Esempio n. 5
0
        public DepartmentInfo GetDepartmentByDepartmetCode(string departmentCode)
        {
            DepartmentBll departmentBll = new DepartmentBll();

            return departmentBll.GetDepartmentInfoByDepartmentCode(departmentCode);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     DepartmentBll departmentBll = new DepartmentBll();
     TreeJsonStr = departmentBll.GetDTreeJsonStr();
 }