public string Delete()
        {
            RoadFlow.Platform.AppLibrary appLibrary = new RoadFlow.Platform.AppLibrary();
            string        text          = base.Request.Form["ids"];
            StringBuilder stringBuilder = new StringBuilder();

            using (TransactionScope transactionScope = new TransactionScope())
            {
                string[] array = text.Split(',');
                for (int i = 0; i < array.Length; i++)
                {
                    Guid id = default(Guid);
                    if (MyExtensions.IsGuid(array[i], out id))
                    {
                        RoadFlow.Data.Model.AppLibrary appLibrary2 = appLibrary.Get(id);
                        if (appLibrary2 != null)
                        {
                            stringBuilder.Append(MyExtensions.Serialize(appLibrary2));
                            appLibrary.Delete(id);
                            new RoadFlow.Platform.AppLibraryButtons1().DeleteByAppID(id);
                            new RoadFlow.Platform.AppLibrarySubPages().DeleteByAppID(id);
                        }
                    }
                }
                new RoadFlow.Platform.Menu().ClearAllDataTableCache();
                new RoadFlow.Platform.AppLibraryButtons1().ClearCache();
                new RoadFlow.Platform.AppLibrarySubPages().ClearCache();
                RoadFlow.Platform.Log.Add("删除了一批应用程序库", stringBuilder.ToString(), RoadFlow.Platform.Log.Types.菜单权限);
                transactionScope.Complete();
            }
            return("删除成功!");
        }
Beispiel #2
0
        public string Delete()
        {
            RoadFlow.Platform.AppLibrary appLibrary1 = new RoadFlow.Platform.AppLibrary();
            string        str1          = this.Request.Form["ids"];
            StringBuilder stringBuilder = new StringBuilder();

            using (TransactionScope transactionScope = new TransactionScope())
            {
                string str2    = str1;
                char[] chArray = new char[1] {
                    ','
                };
                foreach (string str3 in str2.Split(chArray))
                {
                    Guid test;
                    if (str3.IsGuid(out test))
                    {
                        RoadFlow.Data.Model.AppLibrary appLibrary2 = appLibrary1.Get(test, false);
                        if (appLibrary2 != null)
                        {
                            stringBuilder.Append(appLibrary2.Serialize());
                            appLibrary1.Delete(test);
                            new RoadFlow.Platform.AppLibraryButtons1().DeleteByAppID(test);
                            new RoadFlow.Platform.AppLibrarySubPages().DeleteByAppID(test);
                        }
                    }
                }
                new RoadFlow.Platform.Menu().ClearAllDataTableCache();
                new RoadFlow.Platform.AppLibraryButtons1().ClearCache();
                new RoadFlow.Platform.AppLibrarySubPages().ClearCache();
                RoadFlow.Platform.Log.Add("删除了一批应用程序库", stringBuilder.ToString(), RoadFlow.Platform.Log.Types.菜单权限, "", "", (RoadFlow.Data.Model.Users)null);
                transactionScope.Complete();
            }
            return("删除成功!");
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string pager;
            string appid   = Request.QueryString["appid"];
            string tabid   = Request.QueryString["tabid"];
            string typeid  = Request.QueryString["typeid"];
            string title1  = Request.QueryString["title1"];
            string address = Request.QueryString["address"];

            RoadFlow.Platform.AppLibrary bapp = new RoadFlow.Platform.AppLibrary();
            if (IsPostBack)
            {
                title1  = Request.Form["Title1"];
                address = Request.Form["Address"];
                //删除
                if (!Request.Form["Button1"].IsNullOrEmpty())
                {
                    string deleteID = Request.Form["checkbox_app"];
                    System.Text.StringBuilder delxml = new System.Text.StringBuilder();
                    foreach (string id in deleteID.Split(','))
                    {
                        Guid gid;
                        if (id.IsGuid(out gid))
                        {
                            var app = bapp.Get(gid);
                            if (app != null)
                            {
                                delxml.Append(app.Serialize());
                                bapp.Delete(gid);
                            }
                        }
                    }
                    RoadFlow.Platform.Log.Add("删除了一批应用程序库", delxml.ToString(), RoadFlow.Platform.Log.Types.角色应用);
                }
            }

            RoadFlow.Platform.Dictionary bdict = new RoadFlow.Platform.Dictionary();

            string typeidstring = typeid.IsGuid() ? bapp.GetAllChildsIDString(typeid.ToGuid()) : "";

            Query = string.Format("&appid={0}&tabid={1}&title1={2}&typeid={3}&address={4}",
                                  Request.QueryString["appid"],
                                  Request.QueryString["tabid"],
                                  title1.UrlEncode(), typeid, address.UrlEncode()
                                  );
            Query1 = string.Format("{0}&pagesize={1}&pagenumber={2}", Query, Request.QueryString["pagesize"], Request.QueryString["pagenumber"]);

            AppList         = bapp.GetPagerData(out pager, Query, title1, typeidstring, address);
            this.Pager.Text = pager;
        }
Beispiel #4
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string id   = context.Request.Form["id"];
            string type = context.Request.Form["type"];

            RoadFlow.Platform.WorkFlow bworkFlow = new RoadFlow.Platform.WorkFlow();
            var flow = bworkFlow.Get(id.ToGuid());

            if (flow == null)
            {
                context.Response.Write("该流程还未保存!");
                context.Response.End();
            }
            else
            {
                if ("0" == type)
                {
                    flow.Status = 3;
                    bworkFlow.Update(flow);
                    bworkFlow.RefreshWrokFlowCache(flow.ID);
                    RoadFlow.Platform.Log.Add("卸载了流程", flow.Serialize(), RoadFlow.Platform.Log.Types.流程相关);
                    context.Response.Write("1");
                    context.Response.End();
                }
                else if ("1" == type)
                {
                    flow.Status = 4;
                    bworkFlow.Update(flow);
                    //bworkFlow.ClearWorkFlowCache(flow.ID);
                    RoadFlow.Platform.AppLibrary APP = new RoadFlow.Platform.AppLibrary();
                    var app = APP.GetByCode(flow.ID.ToString());
                    if (app != null)
                    {
                        APP.Delete(app.ID);
                        new RoadFlow.Platform.RoleApp().DeleteByAppID(app.ID);
                    }
                    RoadFlow.Platform.Log.Add("删除了流程", flow.Serialize(), RoadFlow.Platform.Log.Types.流程相关);

                    context.Response.Write("1");
                    context.Response.End();
                }
            }
        }
Beispiel #5
0
        public RedirectToRouteResult Delete()
        {
            RoadFlow.Platform.AppLibrary bappLibrary = new RoadFlow.Platform.AppLibrary();
            string deleteID = Request.Form["checkbox_app"];

            System.Text.StringBuilder delxml = new System.Text.StringBuilder();
            foreach (string id in deleteID.Split(','))
            {
                Guid gid;
                if (id.IsGuid(out gid))
                {
                    var app = bappLibrary.Get(gid);
                    if (app != null)
                    {
                        delxml.Append(app.Serialize());
                        bappLibrary.Delete(gid);
                    }
                }
            }
            RoadFlow.Platform.Log.Add("删除了一批应用程序库", delxml.ToString(), RoadFlow.Platform.Log.Types.角色应用);
            return(RedirectToAction("List", Common.Tools.GetRouteValueDictionary()));
        }