예제 #1
0
파일: DirAdd.aspx.cs 프로젝트: PGIMES/MES
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            string Name         = Request.Form["Name"];
            string ReadUsers    = Request.Form["ReadUsers"];
            string PublishUsers = Request.Form["PublishUsers"];
            string ManageUsers  = Request.Form["ManageUsers"];
            string Sort         = Request.Form["Sort"];

            bool   isAdd  = false;
            string oldxml = string.Empty;

            if (docDir == null)
            {
                isAdd           = true;
                docDir          = new RoadFlow.Data.Model.DocumentDirectory();
                docDir.ID       = Guid.NewGuid();
                docDir.ParentID = DirID.ToGuid();
            }
            else
            {
                oldxml = docDir.Serialize();
            }
            docDir.ManageUsers  = ManageUsers;
            docDir.Name         = Name.Trim1();
            docDir.PublishUsers = PublishUsers;
            docDir.ReadUsers    = ReadUsers;
            docDir.Sort         = Sort.ToInt();

            if (isAdd)
            {
                DocDir.Add(docDir);
                RoadFlow.Platform.Log.Add("添加了栏目", docDir.Serialize(), RoadFlow.Platform.Log.Types.文档中心);
            }
            else
            {
                DocDir.Update(docDir);
                RoadFlow.Platform.Log.Add("修改了栏目", docDir.Serialize(), RoadFlow.Platform.Log.Types.文档中心, oldxml, docDir.Serialize());
            }
            DocDir.ClearDirUsersCache(docDir.ID);
            DocDir.ClearCache();
            Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "parent.frames[0].reLoad('" + DirID + "');alert('保存成功!');window.location='List.aspx" + Request.Url.Query + "';", true);
        }
예제 #2
0
        public ActionResult DirDelete(FormCollection collection)
        {
            string str1 = this.Request.QueryString["DirID"];
            string str2 = this.Request.QueryString["currentDirID"];

            RoadFlow.Platform.DocumentDirectory   documentDirectory1 = new RoadFlow.Platform.DocumentDirectory();
            RoadFlow.Data.Model.DocumentDirectory documentDirectory2 = (RoadFlow.Data.Model.DocumentDirectory)null;
            if (str2.IsGuid())
            {
                documentDirectory2 = documentDirectory1.Get(str2.ToGuid());
            }
            if (documentDirectory2 == null)
            {
                // ISSUE: reference to a compiler-generated field
                if (DocumentsController.\u003C\u003Eo__8.\u003C\u003Ep__0 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    DocumentsController.\u003C\u003Eo__8.\u003C\u003Ep__0 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "script", typeof(DocumentsController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                    {
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null)
                    }));
                }
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                object obj = DocumentsController.\u003C\u003Eo__8.\u003C\u003Ep__0.Target((CallSite)DocumentsController.\u003C\u003Eo__8.\u003C\u003Ep__0, this.ViewBag, "alert('栏目为空!');window.location='List" + this.Request.Url.Query + "';");
                return((ActionResult)this.View());
            }
            if (documentDirectory2.ParentID == Guid.Empty)
            {
                // ISSUE: reference to a compiler-generated field
                if (DocumentsController.\u003C\u003Eo__8.\u003C\u003Ep__1 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    DocumentsController.\u003C\u003Eo__8.\u003C\u003Ep__1 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "script", typeof(DocumentsController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                    {
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, (string)null)
                    }));
                }
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                object obj = DocumentsController.\u003C\u003Eo__8.\u003C\u003Ep__1.Target((CallSite)DocumentsController.\u003C\u003Eo__8.\u003C\u003Ep__1, this.ViewBag, "alert('根栏目不能删除根栏目!');window.location=window.location;");
                return((ActionResult)this.View());
            }
            string allChildIdString = documentDirectory1.GetAllChildIdString(documentDirectory2.ID);

            RoadFlow.Platform.Documents documents = new RoadFlow.Platform.Documents();
            string str3 = allChildIdString;

            char[] chArray = new char[1] {
                ','
            };
            foreach (string str4 in str3.Split(chArray))
            {
                documentDirectory1.Delete(str4.ToGuid());
                documents.DeleteByDirectoryID(str4.ToGuid());
                documentDirectory1.ClearDirUsersCache(str4.ToGuid());
            }
            documentDirectory1.ClearCache();
            RoadFlow.Platform.Log.Add("删除的文档栏目及其所有下级栏目", allChildIdString, RoadFlow.Platform.Log.Types.文档中心, "", "", (RoadFlow.Data.Model.Users)null);
            // ISSUE: reference to a compiler-generated field
            if (DocumentsController.\u003C\u003Eo__8.\u003C\u003Ep__2 == null)
            {
                // ISSUE: reference to a compiler-generated field
                DocumentsController.\u003C\u003Eo__8.\u003C\u003Ep__2 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "script", typeof(DocumentsController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                {
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null)
                }));
            }
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            object obj1 = DocumentsController.\u003C\u003Eo__8.\u003C\u003Ep__2.Target((CallSite)DocumentsController.\u003C\u003Eo__8.\u003C\u003Ep__2, this.ViewBag, "parent.frames[0].reLoad('" + (object)documentDirectory2.ParentID + "');alert('删除成功!');window.location='List" + this.Request.Url.Query + "';");

            return((ActionResult)this.View());
        }
예제 #3
0
        public ActionResult DirAdd(FormCollection collection)
        {
            string str1 = this.Request.QueryString["DirID"];
            string str2 = this.Request.QueryString["currentDirID"];

            RoadFlow.Platform.DocumentDirectory   documentDirectory = new RoadFlow.Platform.DocumentDirectory();
            RoadFlow.Data.Model.DocumentDirectory model             = (RoadFlow.Data.Model.DocumentDirectory)null;
            if (str2.IsGuid())
            {
                model = documentDirectory.Get(str2.ToGuid());
            }
            if (collection != null)
            {
                string str3   = this.Request.Form["Name"];
                string str4   = this.Request.Form["ReadUsers"];
                string str5   = this.Request.Form["PublishUsers"];
                string str6   = this.Request.Form["ManageUsers"];
                string str7   = this.Request.Form["Sort"];
                bool   flag   = false;
                string oldXML = string.Empty;
                if (model == null)
                {
                    flag           = true;
                    model          = new RoadFlow.Data.Model.DocumentDirectory();
                    model.ID       = Guid.NewGuid();
                    model.ParentID = str1.ToGuid();
                }
                else
                {
                    oldXML = model.Serialize();
                }
                model.ManageUsers  = str6;
                model.Name         = str3.Trim1();
                model.PublishUsers = str5;
                model.ReadUsers    = str4;
                model.Sort         = str7.ToInt();
                if (flag)
                {
                    documentDirectory.Add(model);
                    RoadFlow.Platform.Log.Add("添加了栏目", model.Serialize(), RoadFlow.Platform.Log.Types.文档中心, "", "", (RoadFlow.Data.Model.Users)null);
                }
                else
                {
                    documentDirectory.Update(model);
                    RoadFlow.Platform.Log.Add("修改了栏目", model.Serialize(), RoadFlow.Platform.Log.Types.文档中心, oldXML, model.Serialize(), (RoadFlow.Data.Model.Users)null);
                }
                documentDirectory.ClearDirUsersCache(model.ID);
                documentDirectory.ClearCache();
                // ISSUE: reference to a compiler-generated field
                if (DocumentsController.\u003C\u003Eo__7.\u003C\u003Ep__0 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    DocumentsController.\u003C\u003Eo__7.\u003C\u003Ep__0 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "script", typeof(DocumentsController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                    {
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null)
                    }));
                }
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                object obj = DocumentsController.\u003C\u003Eo__7.\u003C\u003Ep__0.Target((CallSite)DocumentsController.\u003C\u003Eo__7.\u003C\u003Ep__0, this.ViewBag, "parent.frames[0].reLoad('" + (object)model.ParentID + "');alert('保存成功!');window.location='List" + this.Request.Url.Query + "';");
            }
            if (model == null)
            {
                model          = new RoadFlow.Data.Model.DocumentDirectory();
                model.Sort     = documentDirectory.GetMaxSort(str1.ToGuid());
                model.ParentID = str1.ToGuid();
            }
            return((ActionResult)this.View((object)model));
        }