Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string id = Request.QueryString["id"];
            Guid   wid;

            FoWoSoft.Data.Model.WorkGroup wg = null;
            name    = string.Empty;
            members = string.Empty;
            note    = string.Empty;
            users   = string.Empty;

            if (!id.IsGuid(out wid) || wid == Guid.Empty)
            {
                Response.End();
            }

            wg = bwg.Get(wid);
            if (wg != null)
            {
                name    = wg.Name;
                members = wg.Members;
                note    = wg.Note;
                users   = bwg.GetUsersNames(wg.Members, '、');
            }

            if (!Request.Form["Save"].IsNullOrEmpty() && IsPostBack && wg != null)
            {
                string oldxml = wg.Serialize();
                name       = Request.Form["Name"];
                members    = Request.Form["Members"];
                note       = Request.Form["Note"];
                wg.Name    = name.Trim();
                wg.Members = members;
                if (!note.IsNullOrEmpty())
                {
                    wg.Note = note;
                }

                bwg.Update(wg);
                users = bwg.GetUsersNames(wg.Members, '、');
                string query = Request.Url.Query;
                FoWoSoft.Platform.Log.Add("修改了工作组", "修改了工作组", FoWoSoft.Platform.Log.Types.组织机构, oldxml, wg.Serialize());
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "OK", "alert('保存成功!');", true);
            }

            //删除
            if (!Request.Form["DeleteBut"].IsNullOrEmpty() && IsPostBack && wg != null)
            {
                string oldxml = wg.Serialize();
                bwg.Delete(wg.ID);
                string query = Request.Url.Query;
                FoWoSoft.Platform.Log.Add("删除了工作组", oldxml, FoWoSoft.Platform.Log.Types.组织机构);
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "OK", "parent.frames[0].treecng('1');alert('删除成功!');window.location = 'Empty.aspx' + '" + query + "';", true);
            }
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            FoWoSoft.Platform.WorkGroup bwg = new FoWoSoft.Platform.WorkGroup();
            string name    = string.Empty;
            string members = string.Empty;
            string note    = string.Empty;

            if (IsPostBack)
            {
                name    = Request.Form["Name"];
                members = Request.Form["Members"];
                note    = Request.Form["Note"];

                FoWoSoft.Data.Model.WorkGroup wg = new FoWoSoft.Data.Model.WorkGroup();
                wg.ID      = Guid.NewGuid();
                wg.Name    = name.Trim();
                wg.Members = members;
                if (!note.IsNullOrEmpty())
                {
                    wg.Note = note;
                }
                bwg.Add(wg);
                string query = Request.Url.Query;
                FoWoSoft.Platform.Log.Add("添加了工作组", wg.Serialize(), FoWoSoft.Platform.Log.Types.组织机构);
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "parent.frames[0].treecng('1');alert('添加成功!');window.location = 'WorkGroup.aspx' + '" + query + "';", true);
            }
        }