Ejemplo n.º 1
0
        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("删除成功!");
        }
Ejemplo n.º 2
0
        public string Query()
        {
            string text  = base.Request.Form["Title"];
            string text2 = base.Request.Form["Address"];
            string text3 = base.Request.Form["typeid"];
            string text4 = base.Request.Form["sidx"];
            string text5 = base.Request.Form["sord"];

            RoadFlow.Platform.Dictionary dictionary = new RoadFlow.Platform.Dictionary();
            RoadFlow.Platform.AppLibrary appLibrary = new RoadFlow.Platform.AppLibrary();
            string type       = MyExtensions.IsGuid(text3) ? appLibrary.GetAllChildsIDString(MyExtensions.ToGuid(text3)) : "";
            int    pageSize   = Tools.GetPageSize();
            int    pageNumber = Tools.GetPageNumber();
            string order      = (MyExtensions.IsNullOrEmpty(text4) ? "Title" : text4) + " " + (MyExtensions.IsNullOrEmpty(text5) ? "asc" : text5);
            long   count;
            List <RoadFlow.Data.Model.AppLibrary> pagerData = appLibrary.GetPagerData(out count, pageSize, pageNumber, MyExtensions.Trim1(text), type, MyExtensions.Trim1(text2), order);
            JsonData jsonData = new JsonData();

            foreach (RoadFlow.Data.Model.AppLibrary item in pagerData)
            {
                string empty = string.Empty;
                empty = ((!MyExtensions.IsFontIco(item.Ico)) ? ("<img src=\"" + MyExtensions.Trim1(item.Ico) + "\" style=\"vertical-align:middle;\" />") : ("<i class=\"fa " + MyExtensions.Trim1(item.Ico) + "\" style=\"font-size:14px;vertical-align:middle;" + (MyExtensions.IsNullOrEmpty(item.Color) ? "" : ("color:" + item.Color + ";")) + "\"></i>"));
                JsonData jsonData2 = new JsonData();
                jsonData2["id"]        = item.ID.ToString();
                jsonData2["Title"]     = empty + "<span style=\"vertical-align:middle;margin-left:4px;\">" + item.Title + "</span>";
                jsonData2["Address"]   = item.Address;
                jsonData2["TypeTitle"] = dictionary.GetTitle(item.Type);
                jsonData2["Opation"]   = "<a class=\"editlink\" href=\"javascript:void(0);\" onclick=\"edit('" + item.ID.ToString() + "');return false;\" style=\"margin-right:6px;\">编辑</a><a class=\"editlink\" href=\"javascript:void(0);\" onclick=\"editsubpage('" + item.ID.ToString() + "');return false;\">子页面</a>";
                jsonData.Add(jsonData2);
            }
            return("{\"userdata\":{\"total\":" + count + ",\"pagesize\":" + pageSize + ",\"pagenumber\":" + pageNumber + "},\"rows\":" + jsonData.ToJson() + "}");
        }
Ejemplo n.º 3
0
        private ActionResult query(string title1, string address)
        {
            string pager;
            string appid  = Request.QueryString["appid"];
            string tabid  = Request.QueryString["tabid"];
            string typeid = Request.QueryString["typeid"];

            RoadFlow.Platform.Dictionary bdict = new RoadFlow.Platform.Dictionary();
            RoadFlow.Platform.AppLibrary bapp  = new RoadFlow.Platform.AppLibrary();
            string typeidstring = typeid.IsGuid() ? bapp.GetAllChildsIDString(typeid.ToGuid()) : "";
            string query        = string.Format("&appid={0}&tabid={1}&title1={2}&typeid={3}&address={4}",
                                                Request.QueryString["appid"],
                                                Request.QueryString["tabid"],
                                                title1.UrlEncode(), typeid, address.UrlEncode()
                                                );
            string query1 = string.Format("{0}&pagesize={1}&pagenumber={2}", query, Request.QueryString["pagesize"], Request.QueryString["pagenumber"]);
            List <RoadFlow.Data.Model.AppLibrary> appList = bapp.GetPagerData(out pager, query, title1, typeidstring, address);

            ViewBag.Pager   = pager;
            ViewBag.AppID   = appid;
            ViewBag.TabID   = tabid;
            ViewBag.TypeID  = typeid;
            ViewBag.Title1  = title1;
            ViewBag.Address = address;
            ViewBag.Query1  = query1;
            return(View(appList));
        }
Ejemplo n.º 4
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("删除成功!");
        }
Ejemplo n.º 5
0
        public ActionResult Body()
        {
            RoadFlow.Platform.AppLibrary bappLibrary = new RoadFlow.Platform.AppLibrary();
            RoadFlow.Platform.RoleApp    broleApp    = new RoadFlow.Platform.RoleApp();
            RoadFlow.Data.Model.RoleApp  roleApp     = null;
            string id = Request.QueryString["id"];

            string name    = string.Empty;
            string type    = string.Empty;
            string appid   = string.Empty;
            string params1 = string.Empty;
            string ico     = string.Empty;

            Guid appID;

            if (id.IsGuid(out appID))
            {
                roleApp = broleApp.Get(appID);
                if (roleApp != null)
                {
                    name    = roleApp.Title;
                    type    = roleApp.AppID.HasValue ? bappLibrary.GetTypeByID(roleApp.AppID.Value) : "";
                    appid   = roleApp.AppID.ToString();
                    params1 = roleApp.Params;
                    ico     = roleApp.Ico;
                }
            }
            if (roleApp == null)
            {
                roleApp = new RoadFlow.Data.Model.RoleApp();
            }
            ViewBag.AppID           = appid;
            ViewBag.AppTypesOptions = bappLibrary.GetTypeOptions(type);
            return(View(roleApp));
        }
        public string QueryCompletedList()
        {
            RoadFlow.Platform.WorkFlowTask workFlowTask = new RoadFlow.Platform.WorkFlowTask();
            RoadFlow.Platform.WorkFlow     workFlow     = new RoadFlow.Platform.WorkFlow();
            RoadFlow.Platform.AppLibrary   appLibrary   = new RoadFlow.Platform.AppLibrary();
            string text       = base.Request.Form["title"];
            string flowid     = base.Request.Form["flowid"];
            string sender     = base.Request.Form["sender"];
            string date       = base.Request.Form["date1"];
            string date2      = base.Request.Form["date2"];
            string text2      = base.Request.Form["sidx"];
            string text3      = base.Request.Form["sord"];
            string text4      = "";
            int    pageSize   = RoadFlow.Utility.Tools.GetPageSize();
            int    pageNumber = RoadFlow.Utility.Tools.GetPageNumber();
            string order      = (MyExtensions.IsNullOrEmpty(text2) ? "CompletedTime1" : text2) + " " + (MyExtensions.IsNullOrEmpty(text3) ? "asc" : text3);
            long   count;
            List <RoadFlow.Data.Model.WorkFlowTask> tasks = workFlowTask.GetTasks(MyController.CurrentUserID, out count, pageSize, pageNumber, MyExtensions.Trim1(text), flowid, sender, date, date2, 1, order);
            JsonData jsonData = new JsonData();

            foreach (RoadFlow.Data.Model.WorkFlowTask item in tasks)
            {
                bool isHasten = false;
                RoadFlow.Data.Model.AppLibrary byCode = appLibrary.GetByCode(item.FlowID.ToString());
                int num  = 0;
                int num2 = 1000;
                int num3 = 500;
                if (byCode != null)
                {
                    num  = byCode.OpenMode;
                    num2 = (byCode.Width.HasValue ? byCode.Width.Value : 1000);
                    num3 = (byCode.Height.HasValue ? byCode.Height.Value : 500);
                }
                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.Append("<a class=\"viewlink\" href=\"javascript:void(0);\" onclick=\"detail('" + item.FlowID + "','" + item.GroupID + "','" + item.ID + "');return false;\">查看</a>");
                if (item.Status == 2 && workFlowTask.HasWithdraw(item.ID, out isHasten))
                {
                    stringBuilder.Append("<a style=\"background:url(" + base.Url.Content("~/Images/ico/back.gif") + ") no-repeat left center; padding-left:18px;margin-left:5px;\" href=\"javascript:void(0);\" onclick=\"withdraw('" + item.ID + "');\">收回</a>");
                }
                if (isHasten)
                {
                    stringBuilder.Append("<a style=\"background:url(" + base.Url.Content("~/Images/ico/comment_reply.png") + ") no-repeat left center; padding-left:18px;margin-left:5px;\" href=\"javascript:void(0);\" onclick=\"hasten('" + item.ID + "');\">催办</a>");
                }
                JsonData jsonData2 = new JsonData();
                jsonData2["id"]            = item.ID.ToString();
                jsonData2["FlowName"]      = workFlow.GetFlowName(item.FlowID);
                jsonData2["Note"]          = item.Note;
                jsonData2["ReceiveTime"]   = MyExtensions.ToDateTimeString(item.ReceiveTime);
                jsonData2["CompletedTime"] = (item.CompletedTime1.HasValue ? MyExtensions.ToDateTimeString(item.CompletedTime1.Value) : "");
                jsonData2["SenderName"]    = item.SenderName;
                jsonData2["StepName"]      = item.StepName;
                jsonData2["Title"]         = "<a href=\"javascript:void(0);\" onclick=\"openTask('/WorkFlowRun/Index?" + $"flowid={item.FlowID}&stepid={item.StepID}&instanceid={item.InstanceID}&taskid={item.ID}&groupid={item.GroupID}&appid={text4}&display=1" + "','" + MyExtensions.UrlEncode(MyExtensions.RemoveHTML(item.Title)) + "','" + item.ID + "'," + num + "," + num2 + "," + num3 + ");return false;\">" + MyExtensions.HtmlEncode(item.Title) + "</a>";
                jsonData2["Opation"]       = stringBuilder.ToString();
                jsonData.Add(jsonData2);
            }
            return("{\"userdata\":{\"total\":" + count + ",\"pagesize\":" + pageSize + ",\"pagenumber\":" + pageNumber + "},\"rows\":" + jsonData.ToJson() + "}");
        }
Ejemplo n.º 7
0
        public ActionResult AddApp(FormCollection collection)
        {
            RoadFlow.Platform.AppLibrary bappLibrary = new RoadFlow.Platform.AppLibrary();
            RoadFlow.Platform.UsersApp   busersApp   = new RoadFlow.Platform.UsersApp();
            RoadFlow.Platform.RoleApp    broleApp    = new RoadFlow.Platform.RoleApp();
            RoadFlow.Data.Model.UsersApp usersApp    = null;

            string id     = Request.QueryString["id"];
            string userID = Request.QueryString["userid"];
            string roleID = Request.QueryString["roleid"];

            if (collection != null && id.IsGuid() && userID.IsGuid())
            {
                usersApp = busersApp.Get(id.ToGuid());
                if (!Request.Form["Save"].IsNullOrEmpty())
                {
                    string name    = Request.Form["Name"];
                    string type    = Request.Form["Type"];
                    string appid   = Request.Form["AppID"];
                    string params1 = Request.Form["Params"];
                    string ico     = Request.Form["Ico"];

                    RoadFlow.Data.Model.UsersApp usersApp1 = new RoadFlow.Data.Model.UsersApp();

                    usersApp1.ID       = Guid.NewGuid();
                    usersApp1.ParentID = id.ToGuid();
                    usersApp1.Title    = name.Trim();
                    usersApp1.Sort     = broleApp.GetMaxSort(id.ToGuid());
                    usersApp1.UserID   = userID.ToGuid();
                    usersApp1.RoleID   = roleID.IsGuid() ? roleID.ToGuid() : Guid.Empty;
                    if (appid.IsGuid())
                    {
                        usersApp1.AppID = appid.ToGuid();
                    }
                    else
                    {
                        usersApp1.AppID = null;
                    }
                    usersApp1.Params = params1.IsNullOrEmpty() ? null : params1.Trim();
                    if (!ico.IsNullOrEmpty())
                    {
                        usersApp1.Ico = ico;
                    }

                    busersApp.Add(usersApp1);
                    busersApp.ClearCache();
                    RoadFlow.Platform.Log.Add("添加了个人应用", busersApp.Serialize(), RoadFlow.Platform.Log.Types.角色应用);
                    string refreshID = id;
                    ViewBag.Script = "alert('添加成功!'); parent.frames[0].reLoad('" + refreshID + "')";
                }
            }

            ViewBag.AppTypesOptions = bappLibrary.GetTypeOptions();
            return(View());
        }
Ejemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            RoadFlow.Platform.AppLibrary bappLibrary = new RoadFlow.Platform.AppLibrary();
            RoadFlow.Platform.UsersApp   busersApp   = new RoadFlow.Platform.UsersApp();
            RoadFlow.Platform.RoleApp    broleApp    = new RoadFlow.Platform.RoleApp();
            RoadFlow.Data.Model.UsersApp usersApp    = null;

            string id     = Request.QueryString["id"];
            string userID = Request.QueryString["userid"];
            string roleID = Request.QueryString["roleid"];

            if (IsPostBack && id.IsGuid() && userID.IsGuid())
            {
                usersApp = busersApp.Get(id.ToGuid());
                if (!Request.Form["Save"].IsNullOrEmpty())
                {
                    string name    = Request.Form["Name"];
                    string type    = Request.Form["Type"];
                    string appid   = Request.Form["AppID"];
                    string params1 = Request.Form["Params"];
                    string ico     = Request.Form["Ico"];

                    RoadFlow.Data.Model.UsersApp usersApp1 = new RoadFlow.Data.Model.UsersApp();

                    usersApp1.ID       = Guid.NewGuid();
                    usersApp1.ParentID = id.ToGuid();
                    usersApp1.Title    = name.Trim();
                    usersApp1.Sort     = broleApp.GetMaxSort(id.ToGuid());
                    usersApp1.UserID   = userID.ToGuid();
                    usersApp1.RoleID   = roleID.IsGuid() ? roleID.ToGuid() : Guid.Empty;
                    if (appid.IsGuid())
                    {
                        usersApp1.AppID = appid.ToGuid();
                    }
                    else
                    {
                        usersApp1.AppID = null;
                    }
                    usersApp1.Params = params1.IsNullOrEmpty() ? null : params1.Trim();
                    if (!ico.IsNullOrEmpty())
                    {
                        usersApp1.Ico = ico;
                    }

                    busersApp.Add(usersApp1);
                    busersApp.ClearCache();
                    RoadFlow.Platform.Log.Add("添加了个人应用", busersApp.Serialize(), RoadFlow.Platform.Log.Types.角色应用);
                    string refreshID = id;
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('添加成功!'); parent.frames[0].reLoad('" + refreshID + "')", true);
                }
            }

            AppTypesOptions = bappLibrary.GetTypeOptions();
        }
Ejemplo n.º 9
0
        public ActionResult AddApp(FormCollection collection)
        {
            RoadFlow.Platform.AppLibrary bappLibrary = new RoadFlow.Platform.AppLibrary();
            RoadFlow.Platform.RoleApp    broleApp    = new RoadFlow.Platform.RoleApp();
            RoadFlow.Data.Model.RoleApp  roleApp     = null;

            string id = Request.QueryString["id"];

            if (collection != null)
            {
                roleApp = broleApp.Get(id.ToGuid());
                if (!Request.Form["Save"].IsNullOrEmpty())
                {
                    string name    = Request.Form["Name"];
                    string type    = Request.Form["Type"];
                    string appid   = Request.Form["AppID"];
                    string params1 = Request.Form["Params"];
                    string ico     = Request.Form["Ico"];

                    RoadFlow.Data.Model.RoleApp roleApp1 = new RoadFlow.Data.Model.RoleApp();

                    roleApp1.ID       = Guid.NewGuid();
                    roleApp1.ParentID = id.ToGuid();
                    roleApp1.RoleID   = roleApp.RoleID;
                    roleApp1.Title    = name.Trim();
                    roleApp1.ParentID = roleApp.ID;
                    roleApp1.Sort     = broleApp.GetMaxSort(roleApp.ID);
                    roleApp1.Type     = 0;
                    if (appid.IsGuid())
                    {
                        roleApp1.AppID = appid.ToGuid();
                    }
                    else
                    {
                        roleApp1.AppID = null;
                    }
                    roleApp1.Params = params1.IsNullOrEmpty() ? null : params1.Trim();
                    if (!ico.IsNullOrEmpty())
                    {
                        roleApp1.Ico = ico;
                    }

                    broleApp.Add(roleApp1);
                    broleApp.ClearAllDataTableCache();
                    RoadFlow.Platform.Log.Add("添加了应用模板", roleApp1.Serialize(), RoadFlow.Platform.Log.Types.角色应用);
                    string refreshID = id;
                    ViewBag.Script = "alert('添加成功');parent.frames[0].reLoad('" + refreshID + "');";
                }
            }

            ViewBag.AppTypesOptions = bappLibrary.GetTypeOptions();
            return(View());
        }
Ejemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            RoadFlow.Platform.AppLibrary bappLibrary = new RoadFlow.Platform.AppLibrary();
            RoadFlow.Platform.RoleApp    broleApp    = new RoadFlow.Platform.RoleApp();
            RoadFlow.Data.Model.RoleApp  roleApp     = null;

            string id = Request.QueryString["id"];

            if (IsPostBack)
            {
                roleApp = broleApp.Get(id.ToGuid());
                if (!Request.Form["Save"].IsNullOrEmpty())
                {
                    string name    = Request.Form["Name"];
                    string type    = Request.Form["Type"];
                    string appid   = Request.Form["AppID"];
                    string params1 = Request.Form["Params"];
                    string ico     = Request.Form["Ico"];

                    RoadFlow.Data.Model.RoleApp roleApp1 = new RoadFlow.Data.Model.RoleApp();

                    roleApp1.ID       = Guid.NewGuid();
                    roleApp1.ParentID = id.ToGuid();
                    roleApp1.RoleID   = roleApp.RoleID;
                    roleApp1.Title    = name.Trim();
                    roleApp1.ParentID = roleApp.ID;
                    roleApp1.Sort     = broleApp.GetMaxSort(roleApp.ID);
                    roleApp1.Type     = 0;
                    if (appid.IsGuid())
                    {
                        roleApp1.AppID = appid.ToGuid();
                    }
                    else
                    {
                        roleApp1.AppID = null;
                    }
                    roleApp1.Params = params1.IsNullOrEmpty() ? null : params1.Trim();
                    if (!ico.IsNullOrEmpty())
                    {
                        roleApp1.Ico = ico;
                    }

                    broleApp.Add(roleApp1);
                    broleApp.ClearAllDataTableCache();
                    RoadFlow.Platform.Log.Add("添加了应用模板", roleApp1.Serialize(), RoadFlow.Platform.Log.Types.角色应用);
                    string refreshID = id;
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('添加成功');parent.frames[0].reLoad('" + refreshID + "');", true);
                }
            }
            this.AppTypesOptions.Text = bappLibrary.GetTypeOptions();
        }
Ejemplo n.º 11
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;
        }
Ejemplo n.º 12
0
 public ActionResult Body(FormCollection collection)
 {
     RoadFlow.Platform.AppLibrary appLibrary1 = new RoadFlow.Platform.AppLibrary();
     RoadFlow.Platform.Menu       menu        = new RoadFlow.Platform.Menu();
     RoadFlow.Data.Model.Menu     model       = (RoadFlow.Data.Model.Menu)null;
     string   str1   = this.Request.QueryString["id"];
     string   empty1 = string.Empty;
     string   empty2 = string.Empty;
     string   empty3 = string.Empty;
     string   empty4 = string.Empty;
     string   empty5 = string.Empty;
     string   empty6 = string.Empty;
     Guid     id1;
     ref Guid local = ref id1;
Ejemplo n.º 13
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();
                }
            }
        }
Ejemplo n.º 14
0
        public string Query()
        {
            string str1 = this.Request.Form["Title"];
            string str2 = this.Request.Form["Address"];
            string str3 = this.Request.Form["typeid"];
            string str4 = this.Request.Form["sidx"];
            string str5 = this.Request.Form["sord"];

            RoadFlow.Platform.Dictionary dictionary  = new RoadFlow.Platform.Dictionary();
            RoadFlow.Platform.AppLibrary appLibrary1 = new RoadFlow.Platform.AppLibrary();
            string type       = str3.IsGuid() ? appLibrary1.GetAllChildsIDString(str3.ToGuid(), true) : "";
            int    pageSize   = Tools.GetPageSize();
            int    pageNumber = Tools.GetPageNumber();
            string order      = (str4.IsNullOrEmpty() ? "Title" : str4) + " " + (str5.IsNullOrEmpty() ? "asc" : str5);
            long   count;
            List <RoadFlow.Data.Model.AppLibrary> pagerData = appLibrary1.GetPagerData(out count, pageSize, pageNumber, str1.Trim1(), type, str2.Trim1(), order);
            JsonData jsonData = new JsonData();

            foreach (RoadFlow.Data.Model.AppLibrary appLibrary2 in pagerData)
            {
                string empty = string.Empty;
                string str6;
                if (appLibrary2.Ico.IsFontIco())
                {
                    str6 = "<i class=\"fa " + appLibrary2.Ico.Trim1() + "\" style=\"font-size:14px;vertical-align:middle;" + (appLibrary2.Color.IsNullOrEmpty() ? "" : "color:" + appLibrary2.Color + ";") + "\"></i>";
                }
                else
                {
                    str6 = "<img src=\"" + appLibrary2.Ico.Trim1() + "\" style=\"vertical-align:middle;\" />";
                }
                jsonData.Add((object)new JsonData()
                {
                    ["id"]        = (JsonData)appLibrary2.ID.ToString(),
                    ["Title"]     = (JsonData)(str6 + "<span style=\"vertical-align:middle;margin-left:4px;\">" + appLibrary2.Title + "</span>"),
                    ["Address"]   = (JsonData)appLibrary2.Address,
                    ["TypeTitle"] = (JsonData)dictionary.GetTitle(appLibrary2.Type),
                    ["Opation"]   = (JsonData)("<a class=\"editlink\" href=\"javascript:void(0);\" onclick=\"edit('" + appLibrary2.ID.ToString() + "');return false;\" style=\"margin-right:6px;\">编辑</a><a class=\"editlink\" href=\"javascript:void(0);\" onclick=\"editsubpage('" + appLibrary2.ID.ToString() + "');return false;\">子页面</a>")
                });
            }
            return("{\"userdata\":{\"total\":" + (object)count + ",\"pagesize\":" + (object)pageSize + ",\"pagenumber\":" + (object)pageNumber + "},\"rows\":" + jsonData.ToJson(true) + "}");
        }
Ejemplo n.º 15
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()));
        }
Ejemplo n.º 16
0
        public string GetTitles()
        {
            string msg;

            if (!WebMvc.Common.Tools.CheckLogin(out msg) && !RoadFlow.Platform.WeiXin.Organize.CheckLogin())
            {
                return("");
            }
            string str1 = this.Request.QueryString["values"];
            string str2 = this.Request.QueryString["titlefield"];
            string str3 = this.Request.QueryString["pkfield"];

            RoadFlow.Data.Model.AppLibrary appLibrary = new RoadFlow.Platform.AppLibrary().Get(this.Request.QueryString["applibaryid"].ToGuid(), false);
            if (appLibrary == null)
            {
                return(str1);
            }
            RoadFlow.Data.Model.ProgramBuilder programBuilder = new RoadFlow.Platform.ProgramBuilder().Get(appLibrary.Code.ToGuid());
            if (programBuilder == null)
            {
                return(str1);
            }
            RoadFlow.Data.Model.DBConnection dbconn = new RoadFlow.Platform.DBConnection().Get(programBuilder.DBConnID, true);
            if (dbconn == null)
            {
                return(str1);
            }
            string        sql           = "select " + str2 + " from (" + programBuilder.SQL.ReplaceSelectSql().FilterWildcard(RoadFlow.Platform.Users.CurrentUserID.ToString()) + ") gettitletemptable where " + str3 + " in(" + RoadFlow.Utility.Tools.GetSqlInString(str1, true, ",") + ")";
            DataTable     dataTable     = new RoadFlow.Platform.DBConnection().GetDataTable(dbconn, sql, (IDataParameter[])null);
            StringBuilder stringBuilder = new StringBuilder();

            foreach (DataRow row in (InternalDataCollectionBase)dataTable.Rows)
            {
                stringBuilder.Append(row[0]);
                stringBuilder.Append(",");
            }
            return(stringBuilder.ToString().TrimEnd(','));
        }
Ejemplo n.º 17
0
        public ActionResult Body(FormCollection collection)
        {
            RoadFlow.Platform.AppLibrary bappLibrary = new RoadFlow.Platform.AppLibrary();
            RoadFlow.Platform.RoleApp    broleApp    = new RoadFlow.Platform.RoleApp();
            RoadFlow.Data.Model.RoleApp  roleApp     = null;
            string id      = Request.QueryString["id"];
            string name    = string.Empty;
            string type    = string.Empty;
            string appid   = string.Empty;
            string params1 = string.Empty;
            string ico     = string.Empty;
            Guid   appID;

            if (id.IsGuid(out appID))
            {
                roleApp = broleApp.Get(appID);
            }

            if (!Request.Form["Save"].IsNullOrEmpty())
            {
                name    = Request.Form["Name"];
                type    = Request.Form["Type"];
                appid   = Request.Form["AppID"];
                params1 = Request.Form["Params"];
                ico     = Request.Form["Ico"];

                string oldXML = roleApp.Serialize();
                roleApp.Title = name.Trim();
                if (appid.IsGuid())
                {
                    roleApp.AppID = appid.ToGuid();
                }
                else
                {
                    roleApp.AppID = null;
                }
                roleApp.Params = params1.IsNullOrEmpty() ? null : params1.Trim();
                if (!ico.IsNullOrEmpty())
                {
                    roleApp.Ico = ico;
                }
                else
                {
                    roleApp.Ico = null;
                }

                broleApp.Update(roleApp);
                broleApp.ClearAllDataTableCache();
                RoadFlow.Platform.Log.Add("修改了应用模板", "", RoadFlow.Platform.Log.Types.角色应用, oldXML, roleApp.Serialize());
                string refreshID = roleApp.ParentID == Guid.Empty ? roleApp.ID.ToString() : roleApp.ParentID.ToString();
                ViewBag.Script = "parent.frames[0].reLoad('" + refreshID + "');alert('保存成功!');";
            }

            if (!Request.Form["Delete"].IsNullOrEmpty())
            {
                int i = broleApp.DeleteAndAllChilds(roleApp.ID);
                broleApp.ClearAllDataTableCache();
                RoadFlow.Platform.Log.Add("删除了模板及其所有下级共" + i.ToString() + "项", roleApp.Serialize(), RoadFlow.Platform.Log.Types.角色应用);
                string refreshID = roleApp.ParentID == Guid.Empty ? roleApp.ID.ToString() : roleApp.ParentID.ToString();
                ViewBag.Script = "parent.frames[0].reLoad('" + refreshID + "');window.location='Body?id=" + refreshID + "&appid=" + Request.QueryString["appid"] + "&tabid=" + Request.QueryString["tabid"] + "';";
            }
            if (roleApp != null && roleApp.AppID.HasValue)
            {
                var app = new RoadFlow.Platform.AppLibrary().Get(roleApp.AppID.Value);
                if (app != null)
                {
                    type = app.Type.ToString();
                }
            }
            ViewBag.AppTypesOptions = bappLibrary.GetTypeOptions(type);
            ViewBag.AppID           = roleApp.AppID.ToString();
            return(View(roleApp));
        }
Ejemplo n.º 18
0
        public ActionResult Edit(FormCollection collection)
        {
            string editID = Request.QueryString["id"];
            string type   = Request.QueryString["typeid"];

            RoadFlow.Platform.AppLibrary   bappLibrary = new RoadFlow.Platform.AppLibrary();
            RoadFlow.Data.Model.AppLibrary appLibrary  = null;
            if (editID.IsGuid())
            {
                appLibrary = bappLibrary.Get(editID.ToGuid());
            }
            bool   isAdd  = !editID.IsGuid();
            string oldXML = string.Empty;

            if (appLibrary == null)
            {
                appLibrary          = new RoadFlow.Data.Model.AppLibrary();
                appLibrary.ID       = Guid.NewGuid();
                ViewBag.TypeOptions = new RoadFlow.Platform.AppLibrary().GetTypeOptions(type);
                ViewBag.OpenOptions = new RoadFlow.Platform.Dictionary().GetOptionsByCode("appopenmodel", value: "");
            }
            else
            {
                oldXML = appLibrary.Serialize();
                ViewBag.TypeOptions = new RoadFlow.Platform.AppLibrary().GetTypeOptions(appLibrary.Type.ToString());
                ViewBag.OpenOptions = new RoadFlow.Platform.Dictionary().GetOptionsByCode("appopenmodel", value: appLibrary.OpenMode.ToString());
            }

            if (collection != null)
            {
                string title     = collection["title"];
                string address   = collection["address"];
                string openModel = collection["openModel"];
                string width     = collection["width"];
                string height    = collection["height"];
                string params1   = collection["Params"];
                string note      = collection["note"];
                string useMember = collection["UseMember"];
                type = collection["type"];

                appLibrary.Address  = address.Trim();
                appLibrary.Height   = height.ToIntOrNull();
                appLibrary.Note     = note;
                appLibrary.OpenMode = openModel.ToInt();
                appLibrary.Params   = params1;
                appLibrary.Title    = title;
                appLibrary.Type     = type.ToGuid();
                appLibrary.Width    = width.ToIntOrNull();

                if (!useMember.IsNullOrEmpty())
                {
                    appLibrary.UseMember = useMember;
                }
                else
                {
                    appLibrary.UseMember = null;
                }

                if (isAdd)
                {
                    bappLibrary.Add(appLibrary);
                    RoadFlow.Platform.Log.Add("添加了应用程序库", appLibrary.Serialize(), RoadFlow.Platform.Log.Types.角色应用);
                    ViewBag.Script = "alert('添加成功!');new RoadUI.Window().reloadOpener();new RoadUI.Window().close();";
                }
                else
                {
                    bappLibrary.Update(appLibrary);
                    RoadFlow.Platform.Log.Add("修改了应用程序库", "", RoadFlow.Platform.Log.Types.角色应用, oldXML, appLibrary.Serialize());
                    ViewBag.Script = "alert('修改成功!');new RoadUI.Window().reloadOpener();new RoadUI.Window().close();";
                }
                bappLibrary.UpdateUseMemberCache(appLibrary.ID);
                bappLibrary.ClearCache();
                new RoadFlow.Platform.RoleApp().ClearAllDataTableCache();
            }
            return(View(appLibrary));
        }
Ejemplo n.º 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            query = "&id=" + Request.QueryString["id"] + "&appid=" + Request.QueryString["appid"] + "&roleid=" + Request.QueryString["roleid"] + "&userid=" + Request.QueryString["userid"];
            RoadFlow.Platform.AppLibrary bappLibrary = new RoadFlow.Platform.AppLibrary();
            RoadFlow.Platform.RoleApp    broleApp    = new RoadFlow.Platform.RoleApp();
            RoadFlow.Platform.UsersApp   buserApp    = new RoadFlow.Platform.UsersApp();
            RoadFlow.Data.Model.UsersApp usersApp    = null;

            string id = Request.QueryString["id"];

            Guid appID;

            if (id.IsGuid(out appID))
            {
                usersApp = buserApp.Get(appID);
                if (usersApp != null)
                {
                    name     = usersApp.Title;
                    type     = usersApp.AppID.HasValue ? bappLibrary.GetTypeByID(usersApp.AppID.Value) : "";
                    appid    = usersApp.AppID.ToString();
                    params1  = usersApp.Params;
                    ico      = usersApp.Ico;
                    ParentID = usersApp.ParentID;
                }
            }


            if (IsPostBack && usersApp != null)
            {
                if (!Request.Form["Save"].IsNullOrEmpty())
                {
                    name    = Request.Form["Name"];
                    type    = Request.Form["Type"];
                    appid   = Request.Form["AppID"];
                    params1 = Request.Form["Params"];
                    ico     = Request.Form["Ico"];

                    string oldXML = usersApp.Serialize();
                    usersApp.Title = name.Trim();
                    if (appid.IsGuid())
                    {
                        usersApp.AppID = appid.ToGuid();
                    }
                    else
                    {
                        usersApp.AppID = null;
                    }
                    usersApp.Params = params1.IsNullOrEmpty() ? null : params1.Trim();
                    if (!ico.IsNullOrEmpty())
                    {
                        usersApp.Ico = ico;
                    }
                    else
                    {
                        usersApp.Ico = null;
                    }

                    buserApp.Update(usersApp);
                    buserApp.ClearCache();
                    RoadFlow.Platform.Log.Add("修改了个人应用", "", RoadFlow.Platform.Log.Types.角色应用, oldXML, usersApp.Serialize());
                    string refreshID = usersApp.ParentID.ToString();
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('保存成功!'); parent.frames[0].reLoad('" + refreshID + "')", true);
                }

                if (!Request.Form["Delete"].IsNullOrEmpty())
                {
                    int i = buserApp.DeleteAndAllChilds(usersApp.ID);
                    buserApp.ClearCache();
                    RoadFlow.Platform.Log.Add("删除了个人应用", usersApp.Serialize(), RoadFlow.Platform.Log.Types.角色应用);
                    string refreshID = usersApp.ParentID.ToString();
                    var    parent    = buserApp.Get(usersApp.ParentID);
                    string page      = parent == null ? "Body.aspx" : "Body1.aspx";
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "parent.frames[0].reLoad('" + refreshID + "');window.location='" + page + "?id=" + refreshID + "&appid=" + Request.QueryString["appid"] + "&tabid=" + Request.QueryString["tabid"] + "&userid=" + Request.QueryString["userid"] + "';", true);
                }
            }
            AppID           = appid;
            AppTypesOptions = bappLibrary.GetTypeOptions(type);
        }
        public string Publish()
        {
            string html = Request["html"];
            string name = Request["name"];
            string att  = Request["att"];
            string id   = Request["id"];

            Guid gid;

            if (!id.IsGuid(out gid) || name.IsNullOrEmpty() || att.IsNullOrEmpty() || html.IsNullOrEmpty())
            {
                return("参数错误!");
            }
            RoadFlow.Platform.WorkFlowForm WFF = new RoadFlow.Platform.WorkFlowForm();

            RoadFlow.Data.Model.WorkFlowForm wff = WFF.Get(gid);
            if (wff == null)
            {
                return("未找到表单!");
            }

            string fileName = id + ".cshtml";

            System.Text.StringBuilder serverScript = new System.Text.StringBuilder("@{\r\n");
            var attrJSON = LitJson.JsonMapper.ToObject(att);

            serverScript.Append("\tstring FlowID = Request.QueryString[\"flowid\"];\r\n");
            serverScript.Append("\tstring StepID = Request.QueryString[\"stepid\"];\r\n");
            serverScript.Append("\tstring GroupID = Request.QueryString[\"groupid\"];\r\n");
            serverScript.Append("\tstring TaskID = Request.QueryString[\"taskid\"];\r\n");
            serverScript.Append("\tstring InstanceID = Request.QueryString[\"instanceid\"];\r\n");
            serverScript.Append("\tstring DisplayModel = Request.QueryString[\"display\"] ?? \"0\";\r\n");
            serverScript.AppendFormat("\tstring DBConnID = \"{0}\";\r\n", attrJSON["dbconn"].ToString());
            serverScript.AppendFormat("\tstring DBTable = \"{0}\";\r\n", attrJSON["dbtable"].ToString());
            serverScript.AppendFormat("\tstring DBTablePK = \"{0}\";\r\n", attrJSON["dbtablepk"].ToString());
            serverScript.AppendFormat("\tstring DBTableTitle = \"{0}\";\r\n", attrJSON["dbtabletitle"].ToString());
            serverScript.Append("if(InstanceID.IsNullOrEmpty()){InstanceID = Request.QueryString[\"instanceid1\"];}");

            serverScript.Append("\tRoadFlow.Platform.Dictionary BDictionary = new RoadFlow.Platform.Dictionary();\r\n");
            serverScript.Append("\tRoadFlow.Platform.WorkFlow BWorkFlow = new RoadFlow.Platform.WorkFlow();\r\n");
            serverScript.Append("\tRoadFlow.Platform.WorkFlowTask BWorkFlowTask = new RoadFlow.Platform.WorkFlowTask();\r\n");
            serverScript.Append("\tstring fieldStatus = BWorkFlow.GetFieldStatus(FlowID, StepID);\r\n");
            serverScript.Append("\tLitJson.JsonData initData = BWorkFlow.GetFormData(DBConnID, DBTable, DBTablePK, InstanceID, fieldStatus);\r\n");
            serverScript.Append("\tstring TaskTitle = BWorkFlow.GetFromFieldData(initData, DBTable, DBTableTitle);\r\n");

            serverScript.Append("}\r\n");
            serverScript.Append("<link href=\"~/Scripts/FlowRun/Forms/flowform.css\" rel=\"stylesheet\" type=\"text/css\" />\r\n");
            serverScript.Append("<script src=\"~/Scripts/FlowRun/Forms/common.js\" type=\"text/javascript\" ></script>\r\n");

            if (attrJSON.ContainsKey("hasEditor") && "1" == attrJSON["hasEditor"].ToString())
            {
                serverScript.Append("<script src=\"~/Scripts/Ueditor/ueditor.config.js\" type=\"text/javascript\" ></script>\r\n");
                serverScript.Append("<script src=\"~/Scripts/Ueditor/ueditor.all.min.js\" type=\"text/javascript\" ></script>\r\n");
                serverScript.Append("<script src=\"~/Scripts/Ueditor/lang/zh-cn/zh-cn.js\" type=\"text/javascript\" ></script>\r\n");
                serverScript.Append("<input type=\"hidden\" id=\"Form_HasUEditor\" name=\"Form_HasUEditor\" value=\"1\" />\r\n");
            }
            string validatePropType = attrJSON.ContainsKey("validatealerttype") ? attrJSON["validatealerttype"].ToString() : "2";

            serverScript.Append("<input type=\"hidden\" id=\"Form_ValidateAlertType\" name=\"Form_ValidateAlertType\" value=\"" + validatePropType + "\" />\r\n");
            if (attrJSON.ContainsKey("autotitle") && attrJSON["autotitle"].ToString().ToLower() == "true")
            {
                serverScript.AppendFormat("<input type=\"hidden\" id=\"{0}\" name=\"{0}\" value=\"{1}\" />\r\n",
                                          string.Concat(attrJSON["dbtable"].ToString(), ".", attrJSON["dbtabletitle"].ToString()),
                                          "@(TaskTitle.IsNullOrEmpty() ? BWorkFlow.GetAutoTaskTitle(FlowID, StepID, Request.QueryString[\"groupid\"]) : TaskTitle)"
                                          );
            }
            serverScript.AppendFormat("<input type=\"hidden\" id=\"Form_TitleField\" name=\"Form_TitleField\" value=\"{0}\" />\r\n", string.Concat(attrJSON["dbtable"].ToString(), ".", attrJSON["dbtabletitle"].ToString()));
            //serverScript.AppendFormat("<input type=\"hidden\" id=\"Form_Name\" name=\"Form_Name\" value=\"{0}\" />\r\n", attrJSON["name"].ToString());
            serverScript.AppendFormat("<input type=\"hidden\" id=\"Form_DBConnID\" name=\"Form_DBConnID\" value=\"{0}\" />\r\n", attrJSON["dbconn"].ToString());
            serverScript.AppendFormat("<input type=\"hidden\" id=\"Form_DBTable\" name=\"Form_DBTable\" value=\"{0}\" />\r\n", attrJSON["dbtable"].ToString());
            serverScript.AppendFormat("<input type=\"hidden\" id=\"Form_DBTablePk\" name=\"Form_DBTablePk\" value=\"{0}\" />\r\n", attrJSON["dbtablepk"].ToString());
            serverScript.AppendFormat("<input type=\"hidden\" id=\"Form_DBTableTitle\" name=\"Form_DBTableTitle\" value=\"{0}\" />\r\n", attrJSON["dbtabletitle"].ToString());
            serverScript.AppendFormat("<input type=\"hidden\" id=\"Form_AutoSaveData\" name=\"Form_AutoSaveData\" value=\"{0}\" />\r\n", "1");
            serverScript.Append("<script type=\"text/javascript\">\r\n");
            serverScript.Append("\tvar initData = @Html.Raw(BWorkFlow.GetFormDataJsonString(initData));\r\n");
            serverScript.Append("\tvar fieldStatus = \"1\"==\"@Request.QueryString[\"isreadonly\"]\" ? {} : @Html.Raw(fieldStatus);\r\n");
            serverScript.Append("\tvar displayModel = '@DisplayModel';\r\n");
            serverScript.Append("\t$(window).load(function (){\r\n");
            serverScript.AppendFormat("\t\tformrun.initData(initData, \"{0}\", fieldStatus, displayModel);\r\n", attrJSON["dbtable"].ToString());
            serverScript.Append("\t});\r\n");
            serverScript.Append("</script>\r\n");


            string file = Server.MapPath("~/Views/WorkFlowFormDesigner/Forms/" + fileName);

            System.IO.Stream stream = System.IO.File.Open(file, FileMode.OpenOrCreate, FileAccess.Write, FileShare.None);
            stream.SetLength(0);

            StreamWriter sw = new StreamWriter(stream, System.Text.Encoding.UTF8);

            sw.Write(serverScript.ToString());
            sw.Write(Server.HtmlDecode(html));

            sw.Close();
            stream.Close();


            string attr    = wff.Attribute;
            string appType = LitJson.JsonMapper.ToObject(attr)["apptype"].ToString();

            RoadFlow.Platform.AppLibrary App = new RoadFlow.Platform.AppLibrary();
            var  app   = App.GetByCode(id);
            bool isAdd = false;

            if (app == null)
            {
                app      = new RoadFlow.Data.Model.AppLibrary();
                app.ID   = Guid.NewGuid();
                app.Code = id;
                isAdd    = true;
            }
            app.Address  = "/Views/WorkFlowFormDesigner/Forms/" + fileName;
            app.Note     = "流程表单";
            app.OpenMode = 0;
            app.Params   = "";
            app.Title    = name.Trim();
            app.Type     = appType.IsGuid() ? appType.ToGuid() : new RoadFlow.Platform.Dictionary().GetIDByCode("FormTypes");
            if (isAdd)
            {
                App.Add(app);
            }
            else
            {
                App.Update(app);
            }

            RoadFlow.Platform.Log.Add("发布了流程表单", app.Serialize() + "内容:" + html, RoadFlow.Platform.Log.Types.流程相关);
            wff.Status = 1;
            WFF.Update(wff);
            return("发布成功!");
        }
Ejemplo n.º 21
0
        public ActionResult Body1(FormCollection collection)
        {
            RoadFlow.Platform.AppLibrary bappLibrary = new RoadFlow.Platform.AppLibrary();
            RoadFlow.Platform.RoleApp    broleApp    = new RoadFlow.Platform.RoleApp();
            RoadFlow.Platform.UsersApp   buserApp    = new RoadFlow.Platform.UsersApp();
            RoadFlow.Data.Model.UsersApp usersApp    = null;

            string id = Request.QueryString["id"];

            string name    = string.Empty;
            string type    = string.Empty;
            string appid   = string.Empty;
            string params1 = string.Empty;
            string ico     = string.Empty;

            Guid appID;

            if (id.IsGuid(out appID))
            {
                usersApp = buserApp.Get(appID);
                if (usersApp != null)
                {
                    name    = usersApp.Title;
                    type    = usersApp.AppID.HasValue ? bappLibrary.GetTypeByID(usersApp.AppID.Value) : "";
                    appid   = usersApp.AppID.ToString();
                    params1 = usersApp.Params;
                    ico     = usersApp.Ico;
                }
            }


            if (collection != null && usersApp != null)
            {
                if (!Request.Form["Save"].IsNullOrEmpty())
                {
                    name    = Request.Form["Name"];
                    type    = Request.Form["Type"];
                    appid   = Request.Form["AppID"];
                    params1 = Request.Form["Params"];
                    ico     = Request.Form["Ico"];

                    string oldXML = usersApp.Serialize();
                    usersApp.Title = name.Trim();
                    if (appid.IsGuid())
                    {
                        usersApp.AppID = appid.ToGuid();
                    }
                    else
                    {
                        usersApp.AppID = null;
                    }
                    usersApp.Params = params1.IsNullOrEmpty() ? null : params1.Trim();
                    if (!ico.IsNullOrEmpty())
                    {
                        usersApp.Ico = ico;
                    }
                    else
                    {
                        usersApp.Ico = null;
                    }

                    buserApp.Update(usersApp);
                    buserApp.ClearCache();
                    RoadFlow.Platform.Log.Add("修改了个人应用", "", RoadFlow.Platform.Log.Types.角色应用, oldXML, usersApp.Serialize());
                    string refreshID = usersApp.ParentID.ToString();
                    ViewBag.Script = "alert('保存成功!'); parent.frames[0].reLoad('" + refreshID + "')";
                }

                if (!Request.Form["Delete"].IsNullOrEmpty())
                {
                    int i = buserApp.DeleteAndAllChilds(usersApp.ID);
                    buserApp.ClearCache();
                    RoadFlow.Platform.Log.Add("删除了个人应用", usersApp.Serialize(), RoadFlow.Platform.Log.Types.角色应用);
                    string refreshID = usersApp.ParentID.ToString();
                    var    parent    = buserApp.Get(usersApp.ParentID);
                    string page      = parent == null ? "Body" : "Body1";
                    ViewBag.Script = "parent.frames[0].reLoad('" + refreshID + "');window.location='" + page + "?id=" + refreshID + "&appid=" + Request.QueryString["appid"] + "&tabid=" + Request.QueryString["tabid"] + "&userid=" + Request.QueryString["userid"] + "';";
                }
            }
            ViewBag.AppID           = appid;
            ViewBag.AppTypesOptions = bappLibrary.GetTypeOptions(type);
            return(View(usersApp == null ? new RoadFlow.Data.Model.UsersApp() : usersApp));
        }
Ejemplo n.º 22
0
        public ActionResult Edit(FormCollection collection)
        {
            string text  = base.Request.QueryString["id"];
            string value = base.Request.QueryString["typeid"];

            RoadFlow.Platform.AppLibrary   appLibrary  = new RoadFlow.Platform.AppLibrary();
            RoadFlow.Data.Model.AppLibrary appLibrary2 = null;
            if (MyExtensions.IsGuid(text))
            {
                appLibrary2 = appLibrary.Get(MyExtensions.ToGuid(text));
            }
            bool   flag   = !MyExtensions.IsGuid(text);
            string oldXML = string.Empty;

            if (appLibrary2 == null)
            {
                appLibrary2              = new RoadFlow.Data.Model.AppLibrary();
                appLibrary2.ID           = Guid.NewGuid();
                base.ViewBag.TypeOptions = new RoadFlow.Platform.AppLibrary().GetTypeOptions(value);
                base.ViewBag.OpenOptions = new RoadFlow.Platform.Dictionary().GetOptionsByCode("appopenmodel");
            }
            else
            {
                oldXML = MyExtensions.Serialize((object)appLibrary2);
                base.ViewBag.TypeOptions = new RoadFlow.Platform.AppLibrary().GetTypeOptions(appLibrary2.Type.ToString());
                base.ViewBag.OpenOptions = new RoadFlow.Platform.Dictionary().GetOptionsByCode("appopenmodel", RoadFlow.Platform.Dictionary.OptionValueField.Value, appLibrary2.OpenMode.ToString());
            }
            if (collection != null)
            {
                string title   = collection["title"];
                string text2   = collection["address"];
                string text3   = collection["openModel"];
                string text4   = collection["width"];
                string text5   = collection["height"];
                string @params = collection["Params"];
                string note    = collection["Note"];
                string text6   = collection["Ico"];
                string text7   = collection["IcoColor"];
                value = collection["type"];
                appLibrary2.Address  = text2.Trim();
                appLibrary2.Height   = MyExtensions.ToIntOrNull(text5);
                appLibrary2.Note     = note;
                appLibrary2.OpenMode = MyExtensions.ToInt(text3);
                appLibrary2.Params   = @params;
                appLibrary2.Title    = title;
                appLibrary2.Type     = MyExtensions.ToGuid(value);
                appLibrary2.Width    = MyExtensions.ToIntOrNull(text4);
                if (!MyExtensions.IsNullOrEmpty(text6))
                {
                    appLibrary2.Ico = text6;
                }
                else
                {
                    appLibrary2.Ico = null;
                }
                if (!MyExtensions.IsNullOrEmpty(text7))
                {
                    appLibrary2.Color = text7.Trim();
                }
                else
                {
                    appLibrary2.Color = null;
                }
                string text8 = base.Request.QueryString["pagesize"];
                string text9 = base.Request.QueryString["pagenumber"];
                using (TransactionScope transactionScope = new TransactionScope())
                {
                    if (flag)
                    {
                        appLibrary.Add(appLibrary2);
                        RoadFlow.Platform.Log.Add("添加了应用程序库", MyExtensions.Serialize((object)appLibrary2), RoadFlow.Platform.Log.Types.菜单权限);
                        base.ViewBag.Script = "alert('添加成功!');new RoadUI.Window().reloadOpener(undefined,undefined,\"query('" + text8 + "','" + text9 + "')\");new RoadUI.Window().close();";
                    }
                    else
                    {
                        appLibrary.Update(appLibrary2);
                        RoadFlow.Platform.Log.Add("修改了应用程序库", "", RoadFlow.Platform.Log.Types.菜单权限, oldXML, MyExtensions.Serialize((object)appLibrary2));
                        base.ViewBag.Script = "alert('修改成功!');new RoadUI.Window().reloadOpener(undefined,undefined,\"query('" + text8 + "','" + text9 + "')\");new RoadUI.Window().close();";
                    }
                    RoadFlow.Platform.AppLibraryButtons1 appLibraryButtons = new RoadFlow.Platform.AppLibraryButtons1();
                    string obj = base.Request.Form["buttonindex"] ?? "";
                    List <RoadFlow.Data.Model.AppLibraryButtons1> allByAppID = appLibraryButtons.GetAllByAppID(appLibrary2.ID);
                    List <RoadFlow.Data.Model.AppLibraryButtons1> list       = new List <RoadFlow.Data.Model.AppLibraryButtons1>();
                    string[] array = obj.Split(',');
                    foreach (string index in array)
                    {
                        string text10 = base.Request.Form["button_" + index];
                        string text11 = base.Request.Form["buttonname_" + index];
                        string text12 = base.Request.Form["buttonevents_" + index];
                        string ico    = base.Request.Form["buttonico_" + index];
                        string text13 = base.Request.Form["showtype_" + index];
                        string text14 = base.Request.Form["buttonsort_" + index];
                        if (!MyExtensions.IsNullOrEmpty(text11) && !MyExtensions.IsNullOrEmpty(text12))
                        {
                            RoadFlow.Data.Model.AppLibraryButtons1 appLibraryButtons2 = allByAppID.Find((RoadFlow.Data.Model.AppLibraryButtons1 p) => p.ID == MyExtensions.ToGuid(index));
                            bool flag2 = false;
                            if (appLibraryButtons2 == null)
                            {
                                flag2 = true;
                                appLibraryButtons2    = new RoadFlow.Data.Model.AppLibraryButtons1();
                                appLibraryButtons2.ID = Guid.NewGuid();
                            }
                            else
                            {
                                list.Add(appLibraryButtons2);
                            }
                            appLibraryButtons2.AppLibraryID = appLibrary2.ID;
                            if (MyExtensions.IsGuid(text10))
                            {
                                appLibraryButtons2.ButtonID = MyExtensions.ToGuid(text10);
                            }
                            appLibraryButtons2.Events   = text12;
                            appLibraryButtons2.Ico      = ico;
                            appLibraryButtons2.Name     = MyExtensions.Trim1(text11);
                            appLibraryButtons2.Sort     = MyExtensions.ToInt(text14, 0);
                            appLibraryButtons2.ShowType = MyExtensions.ToInt(text13, 0);
                            appLibraryButtons2.Type     = 0;
                            if (flag2)
                            {
                                appLibraryButtons.Add(appLibraryButtons2);
                            }
                            else
                            {
                                appLibraryButtons.Update(appLibraryButtons2);
                            }
                        }
                    }
                    foreach (RoadFlow.Data.Model.AppLibraryButtons1 item in allByAppID)
                    {
                        if (list.Find((RoadFlow.Data.Model.AppLibraryButtons1 p) => p.ID == item.ID) == null)
                        {
                            appLibraryButtons.Delete(item.ID);
                        }
                    }
                    transactionScope.Complete();
                    appLibraryButtons.ClearCache();
                }
                new RoadFlow.Platform.Menu().ClearAllDataTableCache();
                new RoadFlow.Platform.WorkFlow().ClearStartFlowsCache();
                appLibrary.ClearCache();
            }
            return(View(appLibrary2));
        }
Ejemplo n.º 23
0
        public string QueryWaitList()
        {
            RoadFlow.Platform.WorkFlowTask workFlowTask = new RoadFlow.Platform.WorkFlowTask();
            RoadFlow.Platform.WorkFlow     workFlow     = new RoadFlow.Platform.WorkFlow();
            RoadFlow.Platform.AppLibrary   appLibrary   = new RoadFlow.Platform.AppLibrary();
            string text       = base.Request.Form["title"];
            string flowid     = base.Request.Form["flowid"];
            string sender     = base.Request.Form["sender"];
            string date       = base.Request.Form["date1"];
            string date2      = base.Request.Form["date2"];
            string text2      = base.Request.Form["sidx"];
            string text3      = base.Request.Form["sord"];
            string text4      = "";
            int    pageSize   = RoadFlow.Utility.Tools.GetPageSize();
            int    pageNumber = RoadFlow.Utility.Tools.GetPageNumber();
            long   count;
            List <RoadFlow.Data.Model.WorkFlowTask> obj = workFlowTask.GetTasks(order: (MyExtensions.IsNullOrEmpty(text2) ? "ReceiveTime" : text2) + " " + (MyExtensions.IsNullOrEmpty(text3) ? "asc" : text3), userID: MyController.CurrentUserID, count: out count, size: pageSize, number: pageNumber, title: MyExtensions.Trim1(text), flowid: flowid, sender: sender, date1: date, date2: date2);
            JsonData jsonData      = new JsonData();
            Guid     currentUserID = MyController.CurrentUserID;

            foreach (RoadFlow.Data.Model.WorkFlowTask item in obj)
            {
                RoadFlow.Data.Model.AppLibrary byCode = appLibrary.GetByCode(item.FlowID.ToString());
                int num  = 0;
                int num2 = 1000;
                int num3 = 500;
                if (byCode != null)
                {
                    num  = byCode.OpenMode;
                    num2 = (byCode.Width.HasValue ? byCode.Width.Value : 1000);
                    num3 = (byCode.Height.HasValue ? byCode.Height.Value : 500);
                }
                WorkFlowInstalled workFlowRunModel = workFlow.GetWorkFlowRunModel(item.FlowID);
                JsonData          jsonData2        = new JsonData();
                jsonData2["id"]          = item.ID.ToString();
                jsonData2["FlowName"]    = workFlow.GetFlowName(item.FlowID);
                jsonData2["StepName"]    = item.StepName;
                jsonData2["Note"]        = item.Note;
                jsonData2["ReceiveTime"] = MyExtensions.ToDateTimeString(item.ReceiveTime);
                jsonData2["SenderName"]  = item.SenderName;
                if (item.CompletedTime.HasValue)
                {
                    if (item.CompletedTime.Value < DateTimeNew.get_Now())
                    {
                        jsonData2["StatusTitle"] = "<i title=\"已过期\" class=\"fa fa-bell\" style=\"color:red;font-weight:bold;\"><span title=\"要求完成时间:" + MyExtensions.ToDateTimeString(item.CompletedTime.Value) + "\">已过期</span></i>";
                    }
                    else if ((item.CompletedTime.Value - DateTimeNew.get_Now()).Days <= 3)
                    {
                        jsonData2["StatusTitle"] = "<i title=\"即将过期\" class=\"fa fa-bell\" style=\"color:#fd8a02;font-weight:bold;\"><span title=\"要求完成时间:" + MyExtensions.ToDateTimeString(item.CompletedTime.Value) + "\">即将到期</span></i>";
                    }
                    else
                    {
                        jsonData2["StatusTitle"] = "<i title=\"正常\" class=\"fa fa-bell\" style=\"color:#666;font-weight:bold;\"></i><span title=\"要求完成时间:" + MyExtensions.ToDateTimeString(item.CompletedTime.Value) + "\">正常</span></i>";
                    }
                }
                else
                {
                    jsonData2["StatusTitle"] = "<i title=\"正常\" class=\"fa fa-bell\" style=\"color:#666;font-weight:bold;\"></i><span title=\"要求完成时间:无时间要求\">正常</span></i>";
                }
                jsonData2["Title"] = "<a href=\"javascript:void(0);\" class=\"blue\" onclick=\"openTask('/WorkFlowRun/Index?" + $"flowid={item.FlowID}&stepid={item.StepID}&instanceid={item.InstanceID}&taskid={item.ID}&groupid={item.GroupID}&appid={text4}" + "','" + MyExtensions.UrlEncode(MyExtensions.RemoveHTML(item.Title)) + "','" + item.ID + "'," + num + "," + num2 + "," + num3 + ");return false;\">" + MyExtensions.HtmlEncode(item.Title) + "</a>";
                string text5 = "<a href=\"javascript:void(0);\" class=\"editlink\" onclick=\"openTask('/WorkFlowRun/Index?" + $"flowid={item.FlowID}&stepid={item.StepID}&instanceid={item.InstanceID}&taskid={item.ID}&groupid={item.GroupID}&appid={text4}" + "','" + MyExtensions.UrlEncode(MyExtensions.RemoveHTML(item.Title)) + "','" + item.ID + "'," + num + "," + num2 + "," + num3 + ");return false;\">处理</a>&nbsp;&nbsp;<a class=\"viewlink\" href=\"javascript:void(0);\" onclick=\"detail('" + item.FlowID + "','" + item.GroupID + "','" + item.ID + "');return false;\">查看</a>";
                if (workFlowRunModel != null && workFlowRunModel.FirstStepID == item.StepID && item.SenderID == currentUserID)
                {
                    text5 = text5 + "&nbsp;&nbsp;<a class=\"deletelink\" href=\"javascript:void(0);\" onclick=\"delTask('" + item.FlowID + "','" + item.GroupID + "','" + item.ID + "');return false;\">作废</a>";
                }
                jsonData2["Opation"] = text5;
                jsonData.Add(jsonData2);
            }
            return("{\"userdata\":{\"total\":" + count + ",\"pagesize\":" + pageSize + ",\"pagenumber\":" + pageNumber + "},\"rows\":" + jsonData.ToJson() + "}");
        }
Ejemplo n.º 24
0
        public ActionResult Edit(FormCollection collection)
        {
            string str1 = this.Request.QueryString["id"];
            string str2 = this.Request.QueryString["typeid"];

            RoadFlow.Platform.AppLibrary   appLibrary = new RoadFlow.Platform.AppLibrary();
            RoadFlow.Data.Model.AppLibrary model1     = (RoadFlow.Data.Model.AppLibrary)null;
            if (str1.IsGuid())
            {
                model1 = appLibrary.Get(str1.ToGuid(), false);
            }
            bool   flag1  = !str1.IsGuid();
            string oldXML = string.Empty;
            int    index1;

            if (model1 == null)
            {
                model1    = new RoadFlow.Data.Model.AppLibrary();
                model1.ID = Guid.NewGuid();
                // ISSUE: reference to a compiler-generated field
                if (AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__0 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__0 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "TypeOptions", typeof(AppLibraryController), (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 = AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__0.Target((CallSite)AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__0, this.ViewBag, new RoadFlow.Platform.AppLibrary().GetTypeOptions(str2));
                // ISSUE: reference to a compiler-generated field
                if (AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__1 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__1 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "OpenOptions", typeof(AppLibraryController), (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 obj2 = AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__1.Target((CallSite)AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__1, this.ViewBag, new RoadFlow.Platform.Dictionary().GetOptionsByCode("appopenmodel", RoadFlow.Platform.Dictionary.OptionValueField.Value, "", "", true));
            }
            else
            {
                oldXML = model1.Serialize();
                // ISSUE: reference to a compiler-generated field
                if (AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__2 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__2 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "TypeOptions", typeof(AppLibraryController), (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 = AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__2.Target((CallSite)AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__2, this.ViewBag, new RoadFlow.Platform.AppLibrary().GetTypeOptions(model1.Type.ToString()));
                // ISSUE: reference to a compiler-generated field
                if (AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__3 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__3 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "OpenOptions", typeof(AppLibraryController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                    {
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null)
                    }));
                }
                // ISSUE: reference to a compiler-generated field
                Func <CallSite, object, string, object> target = AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__3.Target;
                // ISSUE: reference to a compiler-generated field
                CallSite <Func <CallSite, object, string, object> > p3 = AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__3;
                object viewBag = this.ViewBag;
                RoadFlow.Platform.Dictionary dictionary = new RoadFlow.Platform.Dictionary();
                string code = "appopenmodel";
                int    num1 = 3;
                index1 = model1.OpenMode;
                string str3          = index1.ToString();
                string attr          = "";
                int    num2          = 1;
                string optionsByCode = dictionary.GetOptionsByCode(code, (RoadFlow.Platform.Dictionary.OptionValueField)num1, str3, attr, num2 != 0);
                object obj2          = target((CallSite)p3, viewBag, optionsByCode);
            }
            if (collection != null)
            {
                string str3  = collection["title"];
                string str4  = collection["address"];
                string str5  = collection["openModel"];
                string str6  = collection["width"];
                string str7  = collection["height"];
                string str8  = collection["Params"];
                string str9  = collection["Note"];
                string str10 = collection["Ico"];
                string str11 = collection["IcoColor"];
                string str12 = collection["type"];
                model1.Address  = str4.Trim();
                model1.Height   = str7.ToIntOrNull();
                model1.Note     = str9;
                model1.OpenMode = str5.ToInt();
                model1.Params   = str8;
                model1.Title    = str3;
                model1.Type     = str12.ToGuid();
                model1.Width    = str6.ToIntOrNull();
                model1.Ico      = str10.IsNullOrEmpty() ? (string)null : str10;
                model1.Color    = str11.IsNullOrEmpty() ? (string)null : str11.Trim();
                string str13 = this.Request.QueryString["pagesize"];
                string str14 = this.Request.QueryString["pagenumber"];
                using (TransactionScope transactionScope = new TransactionScope())
                {
                    if (flag1)
                    {
                        appLibrary.Add(model1);
                        RoadFlow.Platform.Log.Add("添加了应用程序库", model1.Serialize(), RoadFlow.Platform.Log.Types.菜单权限, "", "", (RoadFlow.Data.Model.Users)null);
                        // ISSUE: reference to a compiler-generated field
                        if (AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__4 == null)
                        {
                            // ISSUE: reference to a compiler-generated field
                            AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__4 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "Script", typeof(AppLibraryController), (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 = AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__4.Target((CallSite)AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__4, this.ViewBag, "alert('添加成功!');new RoadUI.Window().reloadOpener(undefined,undefined,\"query('" + str13 + "','" + str14 + "')\");new RoadUI.Window().close();");
                    }
                    else
                    {
                        appLibrary.Update(model1);
                        RoadFlow.Platform.Log.Add("修改了应用程序库", "", RoadFlow.Platform.Log.Types.菜单权限, oldXML, model1.Serialize(), (RoadFlow.Data.Model.Users)null);
                        // ISSUE: reference to a compiler-generated field
                        if (AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__5 == null)
                        {
                            // ISSUE: reference to a compiler-generated field
                            AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__5 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "Script", typeof(AppLibraryController), (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 = AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__5.Target((CallSite)AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__5, this.ViewBag, "alert('修改成功!');new RoadUI.Window().reloadOpener(undefined,undefined,\"query('" + str13 + "','" + str14 + "')\");new RoadUI.Window().close();");
                    }
                    RoadFlow.Platform.AppLibraryButtons1 appLibraryButtons1_1 = new RoadFlow.Platform.AppLibraryButtons1();
                    string str15 = this.Request.Form["buttonindex"] ?? "";
                    List <RoadFlow.Data.Model.AppLibraryButtons1> allByAppId             = appLibraryButtons1_1.GetAllByAppID(model1.ID);
                    List <RoadFlow.Data.Model.AppLibraryButtons1> appLibraryButtons1List = new List <RoadFlow.Data.Model.AppLibraryButtons1>();
                    char[] chArray = new char[1] {
                        ','
                    };
                    string[] strArray = str15.Split(chArray);
                    for (index1 = 0; index1 < strArray.Length; ++index1)
                    {
                        string index = strArray[index1];
                        string str16 = this.Request.Form["button_" + index];
                        string str17 = this.Request.Form["buttonname_" + index];
                        string str18 = this.Request.Form["buttonevents_" + index];
                        string str19 = this.Request.Form["buttonico_" + index];
                        string str20 = this.Request.Form["showtype_" + index];
                        string str21 = this.Request.Form["buttonsort_" + index];
                        if (!str17.IsNullOrEmpty() && !str18.IsNullOrEmpty())
                        {
                            RoadFlow.Data.Model.AppLibraryButtons1 model2 = allByAppId.Find((Predicate <RoadFlow.Data.Model.AppLibraryButtons1>)(p => p.ID == index.ToGuid()));
                            bool flag2 = false;
                            if (model2 == null)
                            {
                                flag2     = true;
                                model2    = new RoadFlow.Data.Model.AppLibraryButtons1();
                                model2.ID = Guid.NewGuid();
                            }
                            else
                            {
                                appLibraryButtons1List.Add(model2);
                            }
                            model2.AppLibraryID = model1.ID;
                            if (str16.IsGuid())
                            {
                                model2.ButtonID = new Guid?(str16.ToGuid());
                            }
                            model2.Events   = str18;
                            model2.Ico      = str19;
                            model2.Name     = str17.Trim1();
                            model2.Sort     = str21.ToInt(0);
                            model2.ShowType = str20.ToInt(0);
                            model2.Type     = 0;
                            if (flag2)
                            {
                                appLibraryButtons1_1.Add(model2);
                            }
                            else
                            {
                                appLibraryButtons1_1.Update(model2);
                            }
                        }
                    }
                    foreach (RoadFlow.Data.Model.AppLibraryButtons1 appLibraryButtons1_2 in allByAppId)
                    {
                        RoadFlow.Data.Model.AppLibraryButtons1 sub = appLibraryButtons1_2;
                        if (appLibraryButtons1List.Find((Predicate <RoadFlow.Data.Model.AppLibraryButtons1>)(p => p.ID == sub.ID)) == null)
                        {
                            appLibraryButtons1_1.Delete(sub.ID);
                        }
                    }
                    transactionScope.Complete();
                    appLibraryButtons1_1.ClearCache();
                }
                new RoadFlow.Platform.Menu().ClearAllDataTableCache();
                new RoadFlow.Platform.WorkFlow().ClearStartFlowsCache();
                appLibrary.ClearCache();
            }
            return((ActionResult)this.View((object)model1));
        }
Ejemplo n.º 25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            RoadFlow.Platform.AppLibrary bappLibrary = new RoadFlow.Platform.AppLibrary();
            RoadFlow.Platform.RoleApp    broleApp    = new RoadFlow.Platform.RoleApp();

            string id      = Request.QueryString["id"];
            string name    = string.Empty;
            string type    = string.Empty;
            string appid   = string.Empty;
            string params1 = string.Empty;
            string ico     = string.Empty;
            Guid   appID;

            if (id.IsGuid(out appID))
            {
                roleApp = broleApp.Get(appID);
            }

            if (IsPostBack)
            {
                if (!Request.Form["Save"].IsNullOrEmpty())
                {
                    name    = Request.Form["Name"];
                    type    = Request.Form["Type"];
                    appid   = Request.Form["AppID"];
                    params1 = Request.Form["Params"];
                    ico     = Request.Form["Ico"];

                    string oldXML = roleApp.Serialize();
                    roleApp.Title = name.Trim();
                    if (appid.IsGuid())
                    {
                        roleApp.AppID = appid.ToGuid();
                    }
                    else
                    {
                        roleApp.AppID = null;
                    }
                    roleApp.Params = params1.IsNullOrEmpty() ? null : params1.Trim();
                    if (!ico.IsNullOrEmpty())
                    {
                        roleApp.Ico = ico;
                    }
                    else
                    {
                        roleApp.Ico = null;
                    }

                    broleApp.Update(roleApp);
                    broleApp.ClearAllDataTableCache();
                    RoadFlow.Platform.Log.Add("修改了应用模板", "", RoadFlow.Platform.Log.Types.角色应用, oldXML, roleApp.Serialize());
                    string refreshID = roleApp.ParentID == Guid.Empty ? roleApp.ID.ToString() : roleApp.ParentID.ToString();
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "parent.frames[0].reLoad('" + refreshID + "');alert('保存成功!');", true);
                }

                if (!Request.Form["Delete"].IsNullOrEmpty())
                {
                    int i = broleApp.DeleteAndAllChilds(roleApp.ID);
                    broleApp.ClearAllDataTableCache();
                    RoadFlow.Platform.Log.Add("删除了模板及其所有下级共" + i.ToString() + "项", roleApp.Serialize(), RoadFlow.Platform.Log.Types.角色应用);
                    string refreshID = roleApp.ParentID == Guid.Empty ? roleApp.ID.ToString() : roleApp.ParentID.ToString();
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "parent.frames[0].reLoad('" + refreshID + "');window.location='Body.aspx?id=" + refreshID + "&appid=" + Request.QueryString["appid"] + "&tabid=" + Request.QueryString["tabid"] + "';", true);
                }
            }
            if (roleApp != null && roleApp.AppID.HasValue)
            {
                var app = new RoadFlow.Platform.AppLibrary().Get(roleApp.AppID.Value);
                if (app != null)
                {
                    type = app.Type.ToString();
                }
            }
            if (roleApp != null)
            {
                this.Name.Value   = roleApp.Title;
                this.Params.Value = roleApp.Params;
                this.Ico.Value    = roleApp.Ico;
            }
            this.AppTypesOptions.Text = bappLibrary.GetTypeOptions(type);
            AppID = roleApp.AppID.ToString();
        }
        public string Publish()
        {
            string s    = this.Request["html"];
            string str1 = this.Request["name"];
            string str2 = this.Request["att"];
            string str3 = this.Request["id"];
            string str4 = this.Request["formats"];
            Guid   test;

            if (!str3.IsGuid(out test) || str1.IsNullOrEmpty() || str2.IsNullOrEmpty())
            {
                return("参数错误!");
            }
            RoadFlow.Platform.WorkFlowForm   workFlowForm = new RoadFlow.Platform.WorkFlowForm();
            RoadFlow.Data.Model.WorkFlowForm model1       = workFlowForm.Get(test);
            if (model1 == null)
            {
                return("请先保存表单再发布!");
            }
            string        str5          = str3 + ".cshtml";
            StringBuilder stringBuilder = new StringBuilder("@{\r\n");
            JsonData      jsonData      = JsonMapper.ToObject(str2);

            stringBuilder.Append("\tstring FlowID = Request.QueryString[\"flowid\"];\r\n");
            stringBuilder.Append("\tstring StepID = Request.QueryString[\"stepid\"];\r\n");
            stringBuilder.Append("\tstring GroupID = Request.QueryString[\"groupid\"];\r\n");
            stringBuilder.Append("\tstring TaskID = Request.QueryString[\"taskid\"];\r\n");
            stringBuilder.Append("\tstring InstanceID = Request.QueryString[\"instanceid\"];\r\n");
            stringBuilder.Append("\tstring DisplayModel = Request.QueryString[\"display\"] ?? \"0\";\r\n");
            stringBuilder.AppendFormat("\tstring DBConnID = \"{0}\";\r\n", (object)jsonData["dbconn"].ToString());
            stringBuilder.AppendFormat("\tstring DBTable = \"{0}\";\r\n", (object)jsonData["dbtable"].ToString());
            stringBuilder.AppendFormat("\tstring DBTablePK = \"{0}\";\r\n", (object)jsonData["dbtablepk"].ToString());
            stringBuilder.AppendFormat("\tstring DBTableTitle = \"{0}\";\r\n", (object)jsonData["dbtabletitle"].ToString());
            stringBuilder.Append("\tif(InstanceID.IsNullOrEmpty()){InstanceID = Request.QueryString[\"instanceid1\"];}\r\n");
            stringBuilder.Append("\tRoadFlow.Platform.Dictionary BDictionary = new RoadFlow.Platform.Dictionary();\r\n");
            stringBuilder.Append("\tRoadFlow.Platform.WorkFlow BWorkFlow = new RoadFlow.Platform.WorkFlow();\r\n");
            stringBuilder.Append("\tRoadFlow.Platform.WorkFlowTask BWorkFlowTask = new RoadFlow.Platform.WorkFlowTask();\r\n");
            stringBuilder.Append("\tstring fieldStatus = BWorkFlow.GetFieldStatus(FlowID, StepID);\r\n");
            stringBuilder.Append("\tLitJson.JsonData initData = BWorkFlow.GetFormData(DBConnID, DBTable, DBTablePK, InstanceID, fieldStatus, \"" + str4 + "\");\r\n");
            stringBuilder.Append("\tstring TaskTitle = BWorkFlow.GetFromFieldData(initData, DBTable, DBTableTitle);\r\n");
            stringBuilder.Append("}\r\n");
            stringBuilder.Append("<link href=\"~/Scripts/FlowRun/Forms/flowform.css\" rel=\"stylesheet\" type=\"text/css\" />\r\n");
            stringBuilder.Append("<script src=\"~/Scripts/FlowRun/Forms/common.js\" type=\"text/javascript\" ></script>\r\n");
            if (jsonData.ContainsKey("hasEditor") && "1" == jsonData["hasEditor"].ToString())
            {
                stringBuilder.Append("<script src=\"~/Scripts/Ueditor/ueditor.config.js\" type=\"text/javascript\" ></script>\r\n");
                stringBuilder.Append("<script src=\"~/Scripts/Ueditor/ueditor.all.min.js\" type=\"text/javascript\" ></script>\r\n");
                stringBuilder.Append("<script src=\"~/Scripts/Ueditor/lang/zh-cn/zh-cn.js\" type=\"text/javascript\" ></script>\r\n");
                stringBuilder.Append("<input type=\"hidden\" id=\"Form_HasUEditor\" name=\"Form_HasUEditor\" value=\"1\" />\r\n");
            }
            string str6 = jsonData.ContainsKey("validatealerttype") ? jsonData["validatealerttype"].ToString() : "2";

            stringBuilder.Append("<input type=\"hidden\" id=\"Form_ValidateAlertType\" name=\"Form_ValidateAlertType\" value=\"" + str6 + "\" />\r\n");
            if (jsonData.ContainsKey("autotitle") && jsonData["autotitle"].ToString().ToLower() == "true")
            {
                stringBuilder.AppendFormat("<input type=\"hidden\" id=\"{0}\" name=\"{0}\" value=\"{1}\" />\r\n", (object)(jsonData["dbtable"].ToString() + "." + jsonData["dbtabletitle"].ToString()), (object)"@(TaskTitle.IsNullOrEmpty() ? BWorkFlow.GetAutoTaskTitle(FlowID, StepID, Request.QueryString[\"groupid\"]) : TaskTitle)");
            }
            stringBuilder.AppendFormat("<input type=\"hidden\" id=\"Form_TitleField\" name=\"Form_TitleField\" value=\"{0}\" />\r\n", (object)(jsonData["dbtable"].ToString() + "." + jsonData["dbtabletitle"].ToString()));
            stringBuilder.AppendFormat("<input type=\"hidden\" id=\"Form_DBConnID\" name=\"Form_DBConnID\" value=\"{0}\" />\r\n", (object)jsonData["dbconn"].ToString());
            stringBuilder.AppendFormat("<input type=\"hidden\" id=\"Form_DBTable\" name=\"Form_DBTable\" value=\"{0}\" />\r\n", (object)jsonData["dbtable"].ToString());
            stringBuilder.AppendFormat("<input type=\"hidden\" id=\"Form_DBTablePk\" name=\"Form_DBTablePk\" value=\"{0}\" />\r\n", (object)jsonData["dbtablepk"].ToString());
            stringBuilder.AppendFormat("<input type=\"hidden\" id=\"Form_DBTableTitle\" name=\"Form_DBTableTitle\" value=\"{0}\" />\r\n", (object)jsonData["dbtabletitle"].ToString());
            stringBuilder.AppendFormat("<input type=\"hidden\" id=\"Form_AutoSaveData\" name=\"Form_AutoSaveData\" value=\"{0}\" />\r\n", (object)"1");
            stringBuilder.AppendFormat("<textarea id=\"Form_DBTableTitleExpression\" name=\"Form_DBTableTitleExpression\" style=\"display:none;width:0;height:0;\">{0}</textarea>\r\n", jsonData.ContainsKey("dbtabletitle1") ? (object)jsonData["dbtabletitle1"].ToString() : (object)"");
            stringBuilder.Append("<script type=\"text/javascript\">\r\n");
            stringBuilder.Append("\tvar initData = @Html.Raw(BWorkFlow.GetFormDataJsonString(initData));\r\n");
            stringBuilder.Append("\tvar fieldStatus = \"1\"==\"@Request.QueryString[\"isreadonly\"]\" ? {} : @Html.Raw(fieldStatus);\r\n");
            stringBuilder.Append("\tvar displayModel = '@DisplayModel';\r\n");
            stringBuilder.Append("\t$(window).load(function (){\r\n");
            stringBuilder.AppendFormat("\t\tformrun.initData(initData, \"{0}\", fieldStatus, displayModel);\r\n", (object)jsonData["dbtable"].ToString());
            stringBuilder.Append("\t});\r\n");
            stringBuilder.Append("</script>\r\n");
            FileStream fileStream = File.Open(this.Server.MapPath("~/Views/WorkFlowFormDesigner/Forms/" + str5), FileMode.OpenOrCreate, FileAccess.Write, FileShare.None);

            fileStream.SetLength(0L);
            StreamWriter streamWriter = new StreamWriter((Stream)fileStream, Encoding.UTF8);

            streamWriter.Write(stringBuilder.ToString());
            streamWriter.Write(this.Server.HtmlDecode(s));
            streamWriter.Close();
            fileStream.Close();
            string str7 = JsonMapper.ToObject(model1.Attribute)["apptype"].ToString();

            RoadFlow.Platform.AppLibrary   appLibrary = new RoadFlow.Platform.AppLibrary();
            RoadFlow.Data.Model.AppLibrary model2     = appLibrary.GetByCode(str3, true);
            bool flag = false;

            if (model2 == null)
            {
                model2      = new RoadFlow.Data.Model.AppLibrary();
                model2.ID   = Guid.NewGuid();
                model2.Code = str3;
                flag        = true;
            }
            model2.Address  = "/Views/WorkFlowFormDesigner/Forms/" + str5;
            model2.Note     = "流程表单";
            model2.OpenMode = 0;
            model2.Params   = "";
            model2.Title    = str1.Trim();
            model2.Type     = str7.IsGuid() ? str7.ToGuid() : new RoadFlow.Platform.Dictionary().GetIDByCode("FormTypes");
            if (flag)
            {
                appLibrary.Add(model2);
            }
            else
            {
                appLibrary.Update(model2);
            }
            RoadFlow.Platform.Log.Add("发布了流程表单", model2.Serialize() + "内容:" + s, RoadFlow.Platform.Log.Types.流程相关, "", "", (RoadFlow.Data.Model.Users)null);
            model1.Status = 1;
            workFlowForm.Update(model1);
            return("发布成功!");
        }