Esempio n. 1
0
        public ActionResult WorkGroup(FormCollection collection)
        {
            string id = Request.QueryString["id"];
            Guid   wid;

            MyCreek.Platform.WorkGroup   bwg = new MyCreek.Platform.WorkGroup();
            MyCreek.Data.Model.WorkGroup wg  = null;
            string name    = string.Empty;
            string members = string.Empty;
            string note    = string.Empty;
            string 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() && collection != null && 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;
                MyCreek.Platform.Log.Add("修改了工作组", "修改了工作组", MyCreek.Platform.Log.Types.组织机构, oldxml, wg.Serialize());

                ViewBag.Script = "alert('保存成功!');";
            }

            //删除
            if (!Request.Form["DeleteBut"].IsNullOrEmpty() && collection != null && wg != null)
            {
                string oldxml = wg.Serialize();
                bwg.Delete(wg.ID);
                string query = Request.Url.Query;
                MyCreek.Platform.Log.Add("删除了工作组", oldxml, MyCreek.Platform.Log.Types.组织机构);
                ViewBag.Script = "parent.frames[0].treecng('1');alert('删除成功!');window.location = 'Empty' + '" + query + "';";
            }
            return(View(wg));
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string id = Request.QueryString["id"];
            Guid   wid;

            MyCreek.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;
                MyCreek.Platform.Log.Add("修改了工作组", "修改了工作组", MyCreek.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;
                MyCreek.Platform.Log.Add("删除了工作组", oldxml, MyCreek.Platform.Log.Types.组织机构);
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "OK", "parent.frames[0].treecng('1');alert('删除成功!');window.location = 'Empty.aspx' + '" + query + "';", true);
            }
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MyCreek.Platform.WorkGroup bwg = new MyCreek.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"];

                MyCreek.Data.Model.WorkGroup wg = new MyCreek.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;
                MyCreek.Platform.Log.Add("添加了工作组", wg.Serialize(), MyCreek.Platform.Log.Types.组织机构);
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "parent.frames[0].treecng('1');alert('添加成功!');window.location = 'WorkGroup.aspx' + '" + query + "';", true);
            }
        }
Esempio n. 4
0
        public ActionResult WorkGroupAdd(FormCollection collection)
        {
            MyCreek.Platform.WorkGroup bwg = new MyCreek.Platform.WorkGroup();
            string name    = string.Empty;
            string members = string.Empty;
            string note    = string.Empty;

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

                MyCreek.Data.Model.WorkGroup wg = new MyCreek.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;
                MyCreek.Platform.Log.Add("添加了工作组", wg.Serialize(), MyCreek.Platform.Log.Types.组织机构);
                ViewBag.Script = "parent.frames[0].treecng('1');alert('添加成功!');window.location = 'WorkGroup' + '" + query + "';";
            }
            return(View());
        }