コード例 #1
0
        public ActionResult WorkGroup(FormCollection collection)
        {
            string id = Request.QueryString["id"];
            Guid   wid;

            BizProcess.Platform.WorkGroup   bwg = new BizProcess.Platform.WorkGroup();
            BizProcess.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;
                BizProcess.Platform.Log.Add("修改了工作组", "修改了工作组", BizProcess.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;
                BizProcess.Platform.Log.Add("删除了工作组", oldxml, BizProcess.Platform.Log.Types.组织机构);
                ViewBag.Script = "parent.frames[0].treecng('1');alert('删除成功!');window.location = 'Empty' + '" + query + "';";
            }
            return(View(wg));
        }
コード例 #2
0
        public ActionResult WorkGroupAdd(FormCollection collection)
        {
            BizProcess.Platform.WorkGroup bwg = new BizProcess.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"];

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