public void ShowScope()
        {
            Sys_DepartmentBLL depbll = new Sys_DepartmentBLL();
            Sys_Notice        sn     = snBll.Get(p => p.NoticeID == hid_Id.Value);
            string            val    = sn.Notice_Scope;

            if (val != null)
            {
                hid_DepId.Value = val;
                string   str = "";
                string[] spl = val.Split(',');

                foreach (string item in spl)
                {
                    Sys_Department depmode = depbll.Get(p => p.Department_Code == item);
                    if (depmode != null)
                    {
                        str += depmode.Department_Name + ",";
                    }
                }
                if (!str.IsNullOrEmpty())
                {
                    str = str.Substring(0, str.Length - 1);
                }

                UCDepartmentTreeText1.Text = str;
            }
        }
Exemple #2
0
        /// <summary>
        /// 新增
        /// </summary>
        public string Add(HttpContext context)
        {
            string name  = context.Request.QueryString["name"];
            string pcode = context.Request.QueryString["pcode"];

            string sort         = context.Request.QueryString["sort"];
            string content      = context.Request.QueryString["content"];
            string type         = context.Request.QueryString["type"];
            string depClass     = context.Request.QueryString["depClass"];
            string personCharge = context.Request.QueryString["personCharge"];
            string teachers     = context.Request.QueryString["teachers"];
            string students     = context.Request.QueryString["students"];

            //组织单位对象
            Sys_Department depmodel = new Sys_Department();

            depmodel.DepartmentID          = Guid.NewGuid().ToString();
            depmodel.Department_ParentCode = pcode;
            depmodel.Department_Name       = name;
            depmodel.Department_Level      = (bll.Get(p => p.Department_Code == pcode).Department_Level + 1);;

            depmodel.Department_Respon   = content;
            depmodel.Department_Sequence = int.Parse(sort);
            depmodel.Department_Code     = bll.GetCode(pcode, "son");
            depmodel.Department_AddTime  = DateTime.Now;
            depmodel.Department_Type     = type;
            //depmodel.Department_Class = depClass;
            //depmodel.Department_PersonCharge = personCharge;
            depmodel.Department_IsDel = "0";

            //新增组织机构
            bool abl = bll.Add(depmodel);

            if (abl)
            {
                return("1");
            }
            else
            {
                return("0");
            }
        }
Exemple #3
0
        /// <summary>
        /// /
        /// </summary>
        public void show()
        {
            Sys_DepartmentBLL depbll = new Sys_DepartmentBLL();

            if (!string.IsNullOrEmpty(id))
            {
                Sys_PostBLL bllPost = new Sys_PostBLL();

                modelGwxx = bllPost.Get(p => p.PostID == id);
                if (modelGwxx != null)
                {
                    this.txtGwName.Text = modelGwxx.Post_Name;
                    this.txtpx.Text     = modelGwxx.Post_Sort.ToString();
                    depmodel            = depbll.Get(p => p.Department_Code == modelGwxx.Post_DepCode);
                    if (depmodel != null)
                    {
                        this.txt_depName.Text = depmodel.Department_Name;
                    }
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(hid_DepCode))
                {
                    depmodel = depbll.Get(p => p.Department_Code == hid_DepCode);
                    if (depmodel != null)
                    {
                        this.txt_depName.Text = depmodel.Department_Name;
                    }
                }
                else
                {
                    depmodel = depbll.Get(p => p.Department_Code == "001");
                    if (depmodel != null)
                    {
                        this.txt_depName.Text = depmodel.Department_Name;
                    }
                }
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType    = "text/plain";
            context.Request.ContentEncoding = Encoding.GetEncoding("UTF-8");
            StringBuilder sb       = new StringBuilder();
            string        parentId = string.Empty;

            if (!string.IsNullOrEmpty(context.Request.QueryString["id"]))
            {
                parentId = context.Request.QueryString["id"];
            }
            if (!string.IsNullOrEmpty(parentId))
            {
                Sys_UserInfo entity = bll.Get(p => p.UserInfoID == parentId);
                if (entity != null)
                {
                    string            post     = "";
                    string            postN    = "";
                    string            name     = entity.UserInfo_FullName;
                    string            ment     = entity.UserInfo_DepCode;
                    Sys_DepartmentBLL mentsbll = new Sys_DepartmentBLL();
                    Sys_Department    ments    = mentsbll.Get(p => p.Department_Code == ment);
                    post = entity.UserInfo_Post;
                    Sys_Post po = pobll.Get(p => p.PostID == post);
                    if (po != null)
                    {
                        postN = po.Post_Name;
                    }
                    string mentss = ments.Department_Name;


                    var    Data       = new { name = name, mentss = mentss, post = post, postN = postN };
                    string jsonPerson = JsonConvert.SerializeObject(Data);
                    context.Response.Write(jsonPerson);
                }
            }
            else
            {
                context.Response.Write("{\"data\":\"error\"}");
            }
        }
Exemple #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //this.UCEasyUIDataGrid.AddClick += new UserControls.UCGrid.AddClickEventHandler(btn_AddClick);
            //this.UCEasyUIDataGrid.ModifyClick += new UserControls.UCGrid.ModifyClickEventHandler(btn_ModifyClick);
            //this.UCEasyUIDataGrid.DeleteClick += new UserControls.UCGrid.DeleteClickEventHandler(DelInfo);
            //this.UCGrid.CheckAllDeleteClick += new UserControls.UCGrid.CheckAllDeleteClickEventHandler(DelCheckBoxInfo);
            hid_DepCode = base.RequstStr("depCode") == "" ? "0" : base.RequstStr("depCode");
            Sys_Department deptModel = depdll.Get(p => p.Department_Code == (hid_DepCode == "0" ? "001" : hid_DepCode));
            string         str       = hid_DepCode == "0" ? "001" : hid_DepCode;

            //List<Sys_Department> deptModel = depdll.FindWhere(p => p.Department_Code==str);
            //if (deptModel.Count>0)
            //{
            //    foreach (Sys_Department item in deptModel)
            ////    {
            //    txt_depName.Value = deptModel.Department_Name;
            //    }

            // }

            InitGrid();
        }