示例#1
0
文件: DirAdd.aspx.cs 项目: PGIMES/MES
        protected void LinkButton2_Click(object sender, EventArgs e)
        {
            if (docDir == null)
            {
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('栏目为空!');window.location='List.aspx" + Request.Url.Query + "';", true);
                return;
            }
            if (docDir.ParentID == Guid.Empty)
            {
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('不能删除根栏目!');window.location=window.location;", true);
                return;
            }
            var childIdString = DocDir.GetAllChildIdString(docDir.ID);

            RoadFlow.Platform.Documents Doc = new RoadFlow.Platform.Documents();
            foreach (string id in childIdString.Split(','))
            {
                DocDir.Delete(id.ToGuid());
                Doc.DeleteByDirectoryID(id.ToGuid());
                DocDir.ClearDirUsersCache(id.ToGuid());
            }
            DocDir.ClearCache();
            RoadFlow.Platform.Log.Add("删除的文档栏目及其所有下级栏目", childIdString, RoadFlow.Platform.Log.Types.文档中心);
            Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "parent.frames[0].reLoad('" + docDir.ParentID + "');alert('删除成功!');window.location='List.aspx" + Request.Url.Query + "';", true);
        }
        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());
        }