示例#1
0
        public string GetFlowRunAddress(RoadFlow.Data.Model.AppLibrary app, string query = "")
        {
            StringBuilder stringBuilder = new StringBuilder();

            if (app.Params.IsNullOrEmpty())
            {
                if (!app.Address.Contains("?"))
                {
                    stringBuilder.Append(app.Address);
                    stringBuilder.Append("?1=1");
                }
            }
            else if (app.Address.Contains("?"))
            {
                stringBuilder.Append(app.Address);
                stringBuilder.Append("&");
                stringBuilder.Append(app.Params.TrimStart('?').TrimStart('&'));
            }
            else
            {
                stringBuilder.Append(app.Address);
                stringBuilder.Append("?");
                stringBuilder.Append(app.Params.TrimStart('?').TrimStart('&'));
            }
            if (!query.IsNullOrEmpty())
            {
                stringBuilder.Append("&");
                stringBuilder.Append(query.TrimStart('?').TrimStart('&'));
            }
            return(stringBuilder.ToString());
        }
        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 test;
                    if (array[i].IsGuid(out test))
                    {
                        RoadFlow.Data.Model.AppLibrary appLibrary2 = appLibrary.Get(test);
                        if (appLibrary2 != null)
                        {
                            stringBuilder.Append(appLibrary2.Serialize());
                            appLibrary.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.菜单权限);
                transactionScope.Complete();
            }
            return("删除成功!");
        }
示例#3
0
 /// <summary>
 /// 删除一个应用
 /// </summary>
 /// <param name="appLibrary">应用实体</param>
 /// <returns></returns>
 public int Delete(Model.AppLibrary appLibrary)
 {
     ClearCache();
     using (var db = new DataContext())
     {
         db.Remove(appLibrary);
         return(db.SaveChanges());
     }
 }
示例#4
0
 public string GetTypeByID(Guid id)
 {
     RoadFlow.Data.Model.AppLibrary appLibrary = Get(id);
     if (appLibrary != null)
     {
         return(appLibrary.Type.ToString());
     }
     return("");
 }
        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 str        = 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 text       = base.Request.Form["sidx"];
            string text2      = base.Request.Form["sord"];
            string text3      = "";
            int    pageSize   = RoadFlow.Utility.Tools.GetPageSize();
            int    pageNumber = RoadFlow.Utility.Tools.GetPageNumber();
            string order      = (text.IsNullOrEmpty() ? "CompletedTime1" : text) + " " + (text2.IsNullOrEmpty() ? "asc" : text2);
            long   count;
            List <RoadFlow.Data.Model.WorkFlowTask> tasks = workFlowTask.GetTasks(MyController.CurrentUserID, out count, pageSize, pageNumber, str.Trim1(), 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"]   = item.ReceiveTime.ToDateTimeString();
                jsonData2["CompletedTime"] = (item.CompletedTime1.HasValue ? item.CompletedTime1.Value.ToDateTimeString() : "");
                jsonData2["SenderName"]    = item.SenderName;
                jsonData2["StepName"]      = item.StepName;
                jsonData2["Title"]         = "<a href=\"javascript:void(0);\" onclick=\"openTask('/WorkFlowRun/Index?" + string.Format("flowid={0}&stepid={1}&instanceid={2}&taskid={3}&groupid={4}&appid={5}&display=1", item.FlowID, item.StepID, item.InstanceID, item.ID, item.GroupID, text3) + "','" + item.Title.RemoveHTML().UrlEncode() + "','" + item.ID + "'," + num + "," + num2 + "," + num3 + ");return false;\">" + item.Title.HtmlEncode() + "</a>";
                jsonData2["Opation"]       = stringBuilder.ToString();
                jsonData.Add(jsonData2);
            }
            return("{\"userdata\":{\"total\":" + count + ",\"pagesize\":" + pageSize + ",\"pagenumber\":" + pageNumber + "},\"rows\":" + jsonData.ToJson() + "}");
        }
示例#6
0
 public RoadFlow.Data.Model.AppLibrary Get(Guid id, bool fromCache = false)
 {
     if (!fromCache)
     {
         return(dataAppLibrary.Get(id));
     }
     RoadFlow.Data.Model.AppLibrary appLibrary = GetAll(true).Find((RoadFlow.Data.Model.AppLibrary p) => p.ID == id);
     if (appLibrary != null)
     {
         return(appLibrary);
     }
     return(dataAppLibrary.Get(id));
 }
示例#7
0
        private List <RoadFlow.Data.Model.AppLibrary> DataReaderToList(OracleDataReader dataReader)
        {
            List <RoadFlow.Data.Model.AppLibrary> list = new List <RoadFlow.Data.Model.AppLibrary>();

            RoadFlow.Data.Model.AppLibrary appLibrary = null;
            while (((DbDataReader)dataReader).Read())
            {
                appLibrary          = new RoadFlow.Data.Model.AppLibrary();
                appLibrary.ID       = ((DbDataReader)dataReader).GetString(0).ToGuid();
                appLibrary.Title    = ((DbDataReader)dataReader).GetString(1);
                appLibrary.Address  = ((DbDataReader)dataReader).GetString(2);
                appLibrary.Type     = ((DbDataReader)dataReader).GetString(3).ToGuid();
                appLibrary.OpenMode = ((DbDataReader)dataReader).GetInt32(4);
                if (!((DbDataReader)dataReader).IsDBNull(5))
                {
                    appLibrary.Width = ((DbDataReader)dataReader).GetInt32(5);
                }
                if (!((DbDataReader)dataReader).IsDBNull(6))
                {
                    appLibrary.Height = ((DbDataReader)dataReader).GetInt32(6);
                }
                if (!((DbDataReader)dataReader).IsDBNull(7))
                {
                    appLibrary.Params = ((DbDataReader)dataReader).GetString(7);
                }
                if (!((DbDataReader)dataReader).IsDBNull(8))
                {
                    appLibrary.Manager = ((DbDataReader)dataReader).GetString(8);
                }
                if (!((DbDataReader)dataReader).IsDBNull(9))
                {
                    appLibrary.Note = ((DbDataReader)dataReader).GetString(9);
                }
                if (!((DbDataReader)dataReader).IsDBNull(10))
                {
                    appLibrary.Code = ((DbDataReader)dataReader).GetString(10);
                }
                if (!((DbDataReader)dataReader).IsDBNull(11))
                {
                    appLibrary.Ico = ((DbDataReader)dataReader).GetString(11);
                }
                if (!((DbDataReader)dataReader).IsDBNull(12))
                {
                    appLibrary.Color = ((DbDataReader)dataReader).GetString(12);
                }
                list.Add(appLibrary);
            }
            return(list);
        }
示例#8
0
        /// <summary>
        /// 安装流程
        /// </summary>
        /// <param name="flow">流程实体</param>
        /// <param name="appLibrary">应用程序库实体</param>
        public int Install(Model.Flow flow)
        {
            using (var db = new DataContext())
            {
                #region 加入到应用程序库
                AppLibrary appLibrary      = new AppLibrary();
                var        applibraryModel = appLibrary.GetAll().Find(p => p.Code.EqualsIgnoreCase(flow.Id.ToString()));
                bool       isAdd           = false;
                if (null == applibraryModel)
                {
                    isAdd           = true;
                    applibraryModel = new Model.AppLibrary
                    {
                        Id = Guid.NewGuid()
                    };
                }
                applibraryModel.Title    = flow.Name;
                applibraryModel.Address  = "/RoadFlowCore/FlowRun/Index?flowid=" + flow.Id.ToString();
                applibraryModel.Code     = flow.Id.ToString();
                applibraryModel.OpenMode = 0;
                applibraryModel.Type     = flow.FlowType;
                applibraryModel.Note     = flow.Note;

                //多语言设定流程名称(这里暂时设定一样,没有区分语言)
                applibraryModel.Title_en = flow.Name;
                applibraryModel.Title_zh = flow.Name;

                if (isAdd)
                {
                    db.Add(applibraryModel);
                }
                else
                {
                    db.Update(applibraryModel);
                }
                #endregion

                db.Update(flow);
                ClearCache();
                appLibrary.ClearCache();
                return(db.SaveChanges());
            }
        }
示例#9
0
 public RoadFlow.Data.Model.AppLibrary GetByCode(string code, bool formCache = true)
 {
     if (code.IsNullOrEmpty())
     {
         return(null);
     }
     if (formCache)
     {
         RoadFlow.Data.Model.AppLibrary appLibrary = GetAll(true).Find(delegate(RoadFlow.Data.Model.AppLibrary p)
         {
             if (!p.Code.IsNullOrEmpty())
             {
                 return(p.Code.Equals(code.Trim1(), StringComparison.CurrentCultureIgnoreCase));
             }
             return(false);
         });
         if (appLibrary == null)
         {
             return(dataAppLibrary.GetByCode(code.Trim1()));
         }
         return(appLibrary);
     }
     return(dataAppLibrary.GetByCode(code.Trim1()));
 }
示例#10
0
 /// <summary>
 /// 删除表单
 /// </summary>
 /// <param name="form">表单实体</param>
 /// <param name="appLibrary">应用程序库实体</param>
 /// <param name="delete">是否彻底删除 0不 1彻底删除</param>
 /// <returns></returns>
 public int Delete(Model.Form form, Model.AppLibrary appLibrary, int delete = 0)
 {
     using (var db = new DataContext())
     {
         if (null != form)
         {
             if (delete == 0)
             {
                 form.Status = 2;
                 db.Update(form);//只作删除标记,不物理删除
             }
             else
             {
                 db.Remove(form);//物理删除
             }
         }
         if (null != appLibrary)
         {
             db.Remove(appLibrary);
             new AppLibrary().ClearCache();
         }
         return(db.SaveChanges());
     }
 }
示例#11
0
        public int Update(RoadFlow.Data.Model.AppLibrary model)
        {
            //IL_001b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0020: Unknown result type (might be due to invalid IL or missing references)
            //IL_002c: Expected O, but got Unknown
            //IL_002d: Expected O, but got Unknown
            //IL_003b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0040: Unknown result type (might be due to invalid IL or missing references)
            //IL_004c: Expected O, but got Unknown
            //IL_004d: Expected O, but got Unknown
            //IL_0058: Unknown result type (might be due to invalid IL or missing references)
            //IL_005d: Unknown result type (might be due to invalid IL or missing references)
            //IL_006e: Expected O, but got Unknown
            //IL_006f: Expected O, but got Unknown
            //IL_0078: Unknown result type (might be due to invalid IL or missing references)
            //IL_007d: Unknown result type (might be due to invalid IL or missing references)
            //IL_008e: Expected O, but got Unknown
            //IL_008f: Expected O, but got Unknown
            //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ad: Unknown result type (might be due to invalid IL or missing references)
            //IL_00be: Expected O, but got Unknown
            //IL_00c7: Unknown result type (might be due to invalid IL or missing references)
            //IL_00cc: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d7: Expected O, but got Unknown
            //IL_00d8: Expected O, but got Unknown
            //IL_00f1: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f6: Unknown result type (might be due to invalid IL or missing references)
            //IL_0107: Expected O, but got Unknown
            //IL_0110: Unknown result type (might be due to invalid IL or missing references)
            //IL_0115: Unknown result type (might be due to invalid IL or missing references)
            //IL_0120: Expected O, but got Unknown
            //IL_0121: Expected O, but got Unknown
            //IL_0132: Unknown result type (might be due to invalid IL or missing references)
            //IL_0137: Unknown result type (might be due to invalid IL or missing references)
            //IL_0143: Expected O, but got Unknown
            //IL_014c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0151: Unknown result type (might be due to invalid IL or missing references)
            //IL_015c: Expected O, but got Unknown
            //IL_015d: Expected O, but got Unknown
            //IL_016e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0173: Unknown result type (might be due to invalid IL or missing references)
            //IL_017f: Expected O, but got Unknown
            //IL_0188: Unknown result type (might be due to invalid IL or missing references)
            //IL_018d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0198: Expected O, but got Unknown
            //IL_0199: Expected O, but got Unknown
            //IL_01aa: Unknown result type (might be due to invalid IL or missing references)
            //IL_01af: Unknown result type (might be due to invalid IL or missing references)
            //IL_01bb: Expected O, but got Unknown
            //IL_01c4: Unknown result type (might be due to invalid IL or missing references)
            //IL_01c9: Unknown result type (might be due to invalid IL or missing references)
            //IL_01d4: Expected O, but got Unknown
            //IL_01d5: Expected O, but got Unknown
            //IL_01e9: Unknown result type (might be due to invalid IL or missing references)
            //IL_01ee: Unknown result type (might be due to invalid IL or missing references)
            //IL_01fa: Expected O, but got Unknown
            //IL_0205: Unknown result type (might be due to invalid IL or missing references)
            //IL_020a: Unknown result type (might be due to invalid IL or missing references)
            //IL_0215: Expected O, but got Unknown
            //IL_0216: Expected O, but got Unknown
            //IL_0228: Unknown result type (might be due to invalid IL or missing references)
            //IL_022d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0239: Expected O, but got Unknown
            //IL_0242: Unknown result type (might be due to invalid IL or missing references)
            //IL_0247: Unknown result type (might be due to invalid IL or missing references)
            //IL_0252: Expected O, but got Unknown
            //IL_0253: Expected O, but got Unknown
            //IL_0265: Unknown result type (might be due to invalid IL or missing references)
            //IL_026a: Unknown result type (might be due to invalid IL or missing references)
            //IL_0276: Expected O, but got Unknown
            //IL_027f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0284: Unknown result type (might be due to invalid IL or missing references)
            //IL_028f: Expected O, but got Unknown
            //IL_0290: Expected O, but got Unknown
            //IL_029c: Unknown result type (might be due to invalid IL or missing references)
            //IL_02a1: Unknown result type (might be due to invalid IL or missing references)
            //IL_02b2: Expected O, but got Unknown
            //IL_02b3: Expected O, but got Unknown
            string sql = "UPDATE AppLibrary SET \r\n\t\t\t\tTitle=:Title,Address=:Address,Type=:Type,OpenMode=:OpenMode,Width=:Width,Height=:Height,Params=:Params,Manager=:Manager,Note=:Note,Code=:Code,Ico=:Ico,Color=:Color\r\n\t\t\t\tWHERE ID=:ID";

            OracleParameter[] obj = new OracleParameter[13];
            OracleParameter   val = new OracleParameter(":Title", 119, 510);

            ((DbParameter)val).Value = model.Title;
            obj[0] = val;
            OracleParameter val2 = new OracleParameter(":Address", 126, 200);

            ((DbParameter)val2).Value = model.Address;
            obj[1] = val2;
            OracleParameter val3 = new OracleParameter(":Type", 126, 40);

            ((DbParameter)val3).Value = model.Type;
            obj[2] = val3;
            OracleParameter val4 = new OracleParameter(":OpenMode", 112);

            ((DbParameter)val4).Value = model.OpenMode;
            obj[3] = val4;
            _003F val5;

            if (model.Width.HasValue)
            {
                val5 = new OracleParameter(":Width", 112);
                ((DbParameter)val5).Value = model.Width;
            }
            else
            {
                val5 = new OracleParameter(":Width", 112);
                ((DbParameter)val5).Value = DBNull.Value;
            }
            obj[4] = val5;
            _003F val6;

            if (model.Height.HasValue)
            {
                val6 = new OracleParameter(":Height", 112);
                ((DbParameter)val6).Value = model.Height;
            }
            else
            {
                val6 = new OracleParameter(":Height", 112);
                ((DbParameter)val6).Value = DBNull.Value;
            }
            obj[5] = val6;
            _003F val7;

            if (model.Params != null)
            {
                val7 = new OracleParameter(":Params", 105);
                ((DbParameter)val7).Value = model.Params;
            }
            else
            {
                val7 = new OracleParameter(":Params", 105);
                ((DbParameter)val7).Value = DBNull.Value;
            }
            obj[6] = val7;
            _003F val8;

            if (model.Manager != null)
            {
                val8 = new OracleParameter(":Manager", 105);
                ((DbParameter)val8).Value = model.Manager;
            }
            else
            {
                val8 = new OracleParameter(":Manager", 105);
                ((DbParameter)val8).Value = DBNull.Value;
            }
            obj[7] = val8;
            _003F val9;

            if (model.Note != null)
            {
                val9 = new OracleParameter(":Note", 105);
                ((DbParameter)val9).Value = model.Note;
            }
            else
            {
                val9 = new OracleParameter(":Note", 105);
                ((DbParameter)val9).Value = DBNull.Value;
            }
            obj[8] = val9;
            _003F val10;

            if (model.Code != null)
            {
                val10 = new OracleParameter(":Code", 126, 50);
                ((DbParameter)val10).Value = model.Code;
            }
            else
            {
                val10 = new OracleParameter(":Code", 126, 50);
                ((DbParameter)val10).Value = DBNull.Value;
            }
            obj[9] = val10;
            _003F val11;

            if (model.Ico != null)
            {
                val11 = new OracleParameter(":Ico", 126);
                ((DbParameter)val11).Value = model.Ico;
            }
            else
            {
                val11 = new OracleParameter(":Ico", 126);
                ((DbParameter)val11).Value = DBNull.Value;
            }
            obj[10] = val11;
            _003F val12;

            if (model.Color != null)
            {
                val12 = new OracleParameter(":Color", 126);
                ((DbParameter)val12).Value = model.Color;
            }
            else
            {
                val12 = new OracleParameter(":Color", 126);
                ((DbParameter)val12).Value = DBNull.Value;
            }
            obj[11] = val12;
            OracleParameter val13 = new OracleParameter(":ID", 126, 40);

            ((DbParameter)val13).Value = model.ID;
            obj[12] = val13;
            OracleParameter[] parameter = (OracleParameter[])obj;
            return(dbHelper.Execute(sql, parameter));
        }
示例#12
0
        public bool Publish(Guid id, bool isMvc = false)
        {
            RoadFlow.Data.Model.ProgramBuilder programBuilder = Get(id);
            if (programBuilder == null || programBuilder.Name.IsNullOrEmpty() || programBuilder.SQL.IsNullOrEmpty())
            {
                return(false);
            }
            AppLibrary appLibrary = new AppLibrary();

            RoadFlow.Data.Model.AppLibrary appLibrary2 = appLibrary.GetByCode(id.ToString());
            bool flag = false;

            using (TransactionScope transactionScope = new TransactionScope())
            {
                if (appLibrary2 == null)
                {
                    flag           = true;
                    appLibrary2    = new RoadFlow.Data.Model.AppLibrary();
                    appLibrary2.ID = Guid.NewGuid();
                }
                appLibrary2.Address  = ((!isMvc) ? ("/Platform/ProgramBuilder/Run.aspx?programid=" + id.ToString()) : ("/ProgramBuilder/Run?programid=" + id.ToString()));
                appLibrary2.Code     = id.ToString();
                appLibrary2.OpenMode = 0;
                appLibrary2.Title    = programBuilder.Name;
                appLibrary2.Type     = programBuilder.Type;
                if (flag)
                {
                    appLibrary.Add(appLibrary2);
                }
                else
                {
                    appLibrary.Update(appLibrary2);
                }
                programBuilder.Status = 1;
                Update(programBuilder);
                List <RoadFlow.Data.Model.ProgramBuilderButtons> all = new ProgramBuilderButtons().GetAll(programBuilder.ID);
                AppLibraryButtons1 appLibraryButtons = new AppLibraryButtons1();
                List <RoadFlow.Data.Model.AppLibraryButtons1> allByAppID = appLibraryButtons.GetAllByAppID(appLibrary2.ID);
                List <RoadFlow.Data.Model.AppLibraryButtons1> list       = new List <RoadFlow.Data.Model.AppLibraryButtons1>();
                foreach (RoadFlow.Data.Model.ProgramBuilderButtons item in all)
                {
                    RoadFlow.Data.Model.AppLibraryButtons1 appLibraryButtons2 = allByAppID.Find((RoadFlow.Data.Model.AppLibraryButtons1 p) => p.ID == item.ID);
                    bool flag2 = false;
                    if (appLibraryButtons2 == null)
                    {
                        appLibraryButtons2 = new RoadFlow.Data.Model.AppLibraryButtons1();
                        flag2 = true;
                    }
                    appLibraryButtons2.AppLibraryID   = appLibrary2.ID;
                    appLibraryButtons2.ButtonID       = item.ButtonID;
                    appLibraryButtons2.Events         = item.ClientScript;
                    appLibraryButtons2.Ico            = (item.Ico ?? "");
                    appLibraryButtons2.ID             = item.ID;
                    appLibraryButtons2.Name           = item.ButtonName;
                    appLibraryButtons2.ShowType       = item.ShowType;
                    appLibraryButtons2.Sort           = item.Sort;
                    appLibraryButtons2.Type           = 0;
                    appLibraryButtons2.IsValidateShow = item.IsValidateShow;
                    if (flag2)
                    {
                        appLibraryButtons.Add(appLibraryButtons2);
                    }
                    else
                    {
                        appLibraryButtons.Update(appLibraryButtons2);
                    }
                    list.Add(appLibraryButtons2);
                }
                foreach (RoadFlow.Data.Model.AppLibraryButtons1 item2 in allByAppID)
                {
                    if (list.Find((RoadFlow.Data.Model.AppLibraryButtons1 p) => p.ID == item2.ID) == null)
                    {
                        appLibraryButtons.Delete(item2.ID);
                    }
                }
                transactionScope.Complete();
            }
            new AppLibrary().ClearCache();
            new Menu().ClearAllDataTableCache();
            new AppLibraryButtons1().ClearCache();
            new AppLibrarySubPages().ClearCache();
            ProgramBuilderCache programBuilderCache = new ProgramBuilderCache();

            programBuilderCache.Program = programBuilder;
            programBuilderCache.Fields  = (from p in new ProgramBuilderFields().GetAll(programBuilder.ID)
                                           orderby p.Sort
                                           select p).ToList();
            programBuilderCache.Querys = (from p in new ProgramBuilderQuerys().GetAll(programBuilder.ID)
                                          orderby p.Sort
                                          select p).ToList();
            programBuilderCache.Buttons = (from p in new ProgramBuilderButtons().GetAll(id)
                                           orderby p.Sort
                                           select p).ToList();
            programBuilderCache.Validates = new ProgramBuilderValidates().GetAll(id);
            programBuilderCache.Export    = (from p in new ProgramBuilderExport().GetAll(id)
                                             orderby p.Sort
                                             select p).ToList();
            AddToCache(programBuilderCache);
            return(true);
        }
        public ActionResult Edit(FormCollection collection)
        {
            string str   = 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 (str.IsGuid())
            {
                appLibrary2 = appLibrary.Get(str.ToGuid());
            }
            bool   flag   = !str.IsGuid();
            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 = appLibrary2.Serialize();
                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 text    = collection["address"];
                string str2    = collection["openModel"];
                string str3    = collection["width"];
                string str4    = collection["height"];
                string @params = collection["Params"];
                string note    = collection["Note"];
                string text2   = collection["Ico"];
                string text3   = collection["IcoColor"];
                value = collection["type"];
                appLibrary2.Address  = text.Trim();
                appLibrary2.Height   = str4.ToIntOrNull();
                appLibrary2.Note     = note;
                appLibrary2.OpenMode = str2.ToInt();
                appLibrary2.Params   = @params;
                appLibrary2.Title    = title;
                appLibrary2.Type     = value.ToGuid();
                appLibrary2.Width    = str3.ToIntOrNull();
                if (!text2.IsNullOrEmpty())
                {
                    appLibrary2.Ico = text2;
                }
                else
                {
                    appLibrary2.Ico = null;
                }
                if (!text3.IsNullOrEmpty())
                {
                    appLibrary2.Color = text3.Trim();
                }
                else
                {
                    appLibrary2.Color = null;
                }
                string text4 = base.Request.QueryString["pagesize"];
                string text5 = base.Request.QueryString["pagenumber"];
                using (TransactionScope transactionScope = new TransactionScope())
                {
                    if (flag)
                    {
                        appLibrary.Add(appLibrary2);
                        RoadFlow.Platform.Log.Add("添加了应用程序库", appLibrary2.Serialize(), RoadFlow.Platform.Log.Types.菜单权限);
                        base.ViewBag.Script = "alert('添加成功!');new RoadUI.Window().reloadOpener(undefined,undefined,\"query('" + text4 + "','" + text5 + "')\");new RoadUI.Window().close();";
                    }
                    else
                    {
                        appLibrary.Update(appLibrary2);
                        RoadFlow.Platform.Log.Add("修改了应用程序库", "", RoadFlow.Platform.Log.Types.菜单权限, oldXML, appLibrary2.Serialize());
                        base.ViewBag.Script = "alert('修改成功!');new RoadUI.Window().reloadOpener(undefined,undefined,\"query('" + text4 + "','" + text5 + "')\");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 str5  = base.Request.Form["button_" + index];
                        string str6  = base.Request.Form["buttonname_" + index];
                        string text6 = base.Request.Form["buttonevents_" + index];
                        string ico   = base.Request.Form["buttonico_" + index];
                        string str7  = base.Request.Form["showtype_" + index];
                        string str8  = base.Request.Form["buttonsort_" + index];
                        if (!str6.IsNullOrEmpty() && !text6.IsNullOrEmpty())
                        {
                            RoadFlow.Data.Model.AppLibraryButtons1 appLibraryButtons2 = allByAppID.Find((RoadFlow.Data.Model.AppLibraryButtons1 p) => p.ID == index.ToGuid());
                            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 (str5.IsGuid())
                            {
                                appLibraryButtons2.ButtonID = str5.ToGuid();
                            }
                            appLibraryButtons2.Events   = text6;
                            appLibraryButtons2.Ico      = ico;
                            appLibraryButtons2.Name     = str6.Trim1();
                            appLibraryButtons2.Sort     = str8.ToInt(0);
                            appLibraryButtons2.ShowType = str7.ToInt(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));
        }
示例#14
0
        public int Add(RoadFlow.Data.Model.AppLibrary model)
        {
            //IL_0018: Unknown result type (might be due to invalid IL or missing references)
            //IL_001d: Unknown result type (might be due to invalid IL or missing references)
            //IL_002e: Expected O, but got Unknown
            //IL_002f: Expected O, but got Unknown
            //IL_003d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0042: Unknown result type (might be due to invalid IL or missing references)
            //IL_004e: Expected O, but got Unknown
            //IL_004f: Expected O, but got Unknown
            //IL_005d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0062: Unknown result type (might be due to invalid IL or missing references)
            //IL_006e: Expected O, but got Unknown
            //IL_006f: Expected O, but got Unknown
            //IL_007a: Unknown result type (might be due to invalid IL or missing references)
            //IL_007f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0090: Expected O, but got Unknown
            //IL_0091: Expected O, but got Unknown
            //IL_009a: Unknown result type (might be due to invalid IL or missing references)
            //IL_009f: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b0: Expected O, but got Unknown
            //IL_00b1: Expected O, but got Unknown
            //IL_00ca: Unknown result type (might be due to invalid IL or missing references)
            //IL_00cf: Unknown result type (might be due to invalid IL or missing references)
            //IL_00e0: Expected O, but got Unknown
            //IL_00e9: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ee: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f9: Expected O, but got Unknown
            //IL_00fa: Expected O, but got Unknown
            //IL_0113: Unknown result type (might be due to invalid IL or missing references)
            //IL_0118: Unknown result type (might be due to invalid IL or missing references)
            //IL_0129: Expected O, but got Unknown
            //IL_0132: Unknown result type (might be due to invalid IL or missing references)
            //IL_0137: Unknown result type (might be due to invalid IL or missing references)
            //IL_0142: Expected O, but got Unknown
            //IL_0143: Expected O, but got Unknown
            //IL_0154: Unknown result type (might be due to invalid IL or missing references)
            //IL_0159: Unknown result type (might be due to invalid IL or missing references)
            //IL_0165: Expected O, but got Unknown
            //IL_016e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0173: Unknown result type (might be due to invalid IL or missing references)
            //IL_017e: Expected O, but got Unknown
            //IL_017f: Expected O, but got Unknown
            //IL_0190: Unknown result type (might be due to invalid IL or missing references)
            //IL_0195: Unknown result type (might be due to invalid IL or missing references)
            //IL_01a1: Expected O, but got Unknown
            //IL_01aa: Unknown result type (might be due to invalid IL or missing references)
            //IL_01af: Unknown result type (might be due to invalid IL or missing references)
            //IL_01ba: Expected O, but got Unknown
            //IL_01bb: Expected O, but got Unknown
            //IL_01cd: Unknown result type (might be due to invalid IL or missing references)
            //IL_01d2: Unknown result type (might be due to invalid IL or missing references)
            //IL_01de: Expected O, but got Unknown
            //IL_01e7: Unknown result type (might be due to invalid IL or missing references)
            //IL_01ec: Unknown result type (might be due to invalid IL or missing references)
            //IL_01f7: Expected O, but got Unknown
            //IL_01f8: Expected O, but got Unknown
            //IL_020c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0211: Unknown result type (might be due to invalid IL or missing references)
            //IL_021d: Expected O, but got Unknown
            //IL_0228: Unknown result type (might be due to invalid IL or missing references)
            //IL_022d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0238: Expected O, but got Unknown
            //IL_0239: Expected O, but got Unknown
            //IL_024b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0250: Unknown result type (might be due to invalid IL or missing references)
            //IL_025c: Expected O, but got Unknown
            //IL_0265: Unknown result type (might be due to invalid IL or missing references)
            //IL_026a: Unknown result type (might be due to invalid IL or missing references)
            //IL_0275: Expected O, but got Unknown
            //IL_0276: Expected O, but got Unknown
            //IL_0288: Unknown result type (might be due to invalid IL or missing references)
            //IL_028d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0299: Expected O, but got Unknown
            //IL_02a2: Unknown result type (might be due to invalid IL or missing references)
            //IL_02a7: Unknown result type (might be due to invalid IL or missing references)
            //IL_02b2: Expected O, but got Unknown
            //IL_02b3: Expected O, but got Unknown
            string sql = "INSERT INTO AppLibrary\r\n\t\t\t\t(ID,Title,Address,Type,OpenMode,Width,Height,Params,Manager,Note,Code,Ico,Color) \r\n\t\t\t\tVALUES(:ID,:Title,:Address,:Type,:OpenMode,:Width,:Height,:Params,:Manager,:Note,:Code,:Ico,:Color)";

            OracleParameter[] obj = new OracleParameter[13];
            OracleParameter   val = new OracleParameter(":ID", 126, 40);

            ((DbParameter)val).Value = model.ID;
            obj[0] = val;
            OracleParameter val2 = new OracleParameter(":Title", 119, 510);

            ((DbParameter)val2).Value = model.Title;
            obj[1] = val2;
            OracleParameter val3 = new OracleParameter(":Address", 126, 200);

            ((DbParameter)val3).Value = model.Address;
            obj[2] = val3;
            OracleParameter val4 = new OracleParameter(":Type", 126, 40);

            ((DbParameter)val4).Value = model.Type;
            obj[3] = val4;
            OracleParameter val5 = new OracleParameter(":OpenMode", 112);

            ((DbParameter)val5).Value = model.OpenMode;
            obj[4] = val5;
            _003F val6;

            if (model.Width.HasValue)
            {
                val6 = new OracleParameter(":Width", 112);
                ((DbParameter)val6).Value = model.Width;
            }
            else
            {
                val6 = new OracleParameter(":Width", 112);
                ((DbParameter)val6).Value = DBNull.Value;
            }
            obj[5] = val6;
            _003F val7;

            if (model.Height.HasValue)
            {
                val7 = new OracleParameter(":Height", 112);
                ((DbParameter)val7).Value = model.Height;
            }
            else
            {
                val7 = new OracleParameter(":Height", 112);
                ((DbParameter)val7).Value = DBNull.Value;
            }
            obj[6] = val7;
            _003F val8;

            if (model.Params != null)
            {
                val8 = new OracleParameter(":Params", 105);
                ((DbParameter)val8).Value = model.Params;
            }
            else
            {
                val8 = new OracleParameter(":Params", 105);
                ((DbParameter)val8).Value = DBNull.Value;
            }
            obj[7] = val8;
            _003F val9;

            if (model.Manager != null)
            {
                val9 = new OracleParameter(":Manager", 105);
                ((DbParameter)val9).Value = model.Manager;
            }
            else
            {
                val9 = new OracleParameter(":Manager", 105);
                ((DbParameter)val9).Value = DBNull.Value;
            }
            obj[8] = val9;
            _003F val10;

            if (model.Note != null)
            {
                val10 = new OracleParameter(":Note", 105);
                ((DbParameter)val10).Value = model.Note;
            }
            else
            {
                val10 = new OracleParameter(":Note", 105);
                ((DbParameter)val10).Value = DBNull.Value;
            }
            obj[9] = val10;
            _003F val11;

            if (model.Code != null)
            {
                val11 = new OracleParameter(":Code", 126, 50);
                ((DbParameter)val11).Value = model.Code;
            }
            else
            {
                val11 = new OracleParameter(":Code", 126, 50);
                ((DbParameter)val11).Value = DBNull.Value;
            }
            obj[10] = val11;
            _003F val12;

            if (model.Ico != null)
            {
                val12 = new OracleParameter(":Ico", 126);
                ((DbParameter)val12).Value = model.Ico;
            }
            else
            {
                val12 = new OracleParameter(":Ico", 126);
                ((DbParameter)val12).Value = DBNull.Value;
            }
            obj[11] = val12;
            _003F val13;

            if (model.Color != null)
            {
                val13 = new OracleParameter(":Color", 126);
                ((DbParameter)val13).Value = model.Color;
            }
            else
            {
                val13 = new OracleParameter(":Color", 126);
                ((DbParameter)val13).Value = DBNull.Value;
            }
            obj[12] = val13;
            OracleParameter[] parameter = (OracleParameter[])obj;
            return(dbHelper.Execute(sql, parameter));
        }
示例#15
0
 public int Add(RoadFlow.Data.Model.AppLibrary model)
 {
     return(dataAppLibrary.Add(model));
 }
        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 str        = 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 text       = base.Request.Form["sidx"];
            string text2      = base.Request.Form["sord"];
            string text3      = "";
            int    pageSize   = RoadFlow.Utility.Tools.GetPageSize();
            int    pageNumber = RoadFlow.Utility.Tools.GetPageNumber();
            long   count;
            List <RoadFlow.Data.Model.WorkFlowTask> obj = workFlowTask.GetTasks(order: (text.IsNullOrEmpty() ? "ReceiveTime" : text) + " " + (text2.IsNullOrEmpty() ? "asc" : text2), userID: MyController.CurrentUserID, count: out count, size: pageSize, number: pageNumber, title: str.Trim1(), 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"] = item.ReceiveTime.ToDateTimeString();
                jsonData2["SenderName"]  = item.SenderName;
                if (item.CompletedTime.HasValue)
                {
                    if (item.CompletedTime.Value < DateTimeNew.Now)
                    {
                        jsonData2["StatusTitle"] = "<i title=\"已过期\" class=\"fa fa-bell\" style=\"color:red;font-weight:bold;\"><span title=\"要求完成时间:" + item.CompletedTime.Value.ToDateTimeString() + "\">已过期</span></i>";
                    }
                    else if ((item.CompletedTime.Value - DateTimeNew.Now).Days <= 3)
                    {
                        jsonData2["StatusTitle"] = "<i title=\"即将过期\" class=\"fa fa-bell\" style=\"color:#fd8a02;font-weight:bold;\"><span title=\"要求完成时间:" + item.CompletedTime.Value.ToDateTimeString() + "\">即将到期</span></i>";
                    }
                    else
                    {
                        jsonData2["StatusTitle"] = "<i title=\"正常\" class=\"fa fa-bell\" style=\"color:#666;font-weight:bold;\"></i><span title=\"要求完成时间:" + item.CompletedTime.Value.ToDateTimeString() + "\">正常</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?" + string.Format("flowid={0}&stepid={1}&instanceid={2}&taskid={3}&groupid={4}&appid={5}", item.FlowID, item.StepID, item.InstanceID, item.ID, item.GroupID, text3) + "','" + item.Title.RemoveHTML().UrlEncode() + "','" + item.ID + "'," + num + "," + num2 + "," + num3 + ");return false;\">" + item.Title.HtmlEncode() + "</a>";
                string text4 = "<a href=\"javascript:void(0);\" class=\"editlink\" onclick=\"openTask('/WorkFlowRun/Index?" + string.Format("flowid={0}&stepid={1}&instanceid={2}&taskid={3}&groupid={4}&appid={5}", item.FlowID, item.StepID, item.InstanceID, item.ID, item.GroupID, text3) + "','" + item.Title.RemoveHTML().UrlEncode() + "','" + 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)
                {
                    text4 = text4 + "&nbsp;&nbsp;<a class=\"deletelink\" href=\"javascript:void(0);\" onclick=\"delTask('" + item.FlowID + "','" + item.GroupID + "','" + item.ID + "');return false;\">作废</a>";
                }
                jsonData2["Opation"] = text4;
                jsonData.Add(jsonData2);
            }
            return("{\"userdata\":{\"total\":" + count + ",\"pagesize\":" + pageSize + ",\"pagenumber\":" + pageNumber + "},\"rows\":" + jsonData.ToJson() + "}");
        }
示例#17
0
 public int Update(RoadFlow.Data.Model.AppLibrary model)
 {
     return(dataAppLibrary.Update(model));
 }
示例#18
0
        public bool Publish(Guid id, bool isMvc = false)
        {
            RoadFlow.Data.Model.ProgramBuilder model1 = this.Get(id);
            if (model1 == null || model1.Name.IsNullOrEmpty() || model1.SQL.IsNullOrEmpty())
            {
                return(false);
            }
            AppLibrary appLibrary = new AppLibrary();

            RoadFlow.Data.Model.AppLibrary model2 = appLibrary.GetByCode(id.ToString(), true);
            bool flag1 = false;

            using (TransactionScope transactionScope = new TransactionScope())
            {
                if (model2 == null)
                {
                    flag1     = true;
                    model2    = new RoadFlow.Data.Model.AppLibrary();
                    model2.ID = Guid.NewGuid();
                }
                model2.Address  = !isMvc ? "/Platform/ProgramBuilder/Run.aspx?programid=" + id.ToString() : "/ProgramBuilder/Run?programid=" + id.ToString();
                model2.Code     = id.ToString();
                model2.OpenMode = 0;
                model2.Title    = model1.Name;
                model2.Type     = model1.Type;
                if (flag1)
                {
                    appLibrary.Add(model2);
                }
                else
                {
                    appLibrary.Update(model2);
                }
                model1.Status = 1;
                this.Update(model1);
                List <RoadFlow.Data.Model.ProgramBuilderButtons> all = new ProgramBuilderButtons().GetAll(model1.ID);
                AppLibraryButtons1 appLibraryButtons1_1 = new AppLibraryButtons1();
                List <RoadFlow.Data.Model.AppLibraryButtons1> allByAppId             = appLibraryButtons1_1.GetAllByAppID(model2.ID);
                List <RoadFlow.Data.Model.AppLibraryButtons1> appLibraryButtons1List = new List <RoadFlow.Data.Model.AppLibraryButtons1>();
                foreach (RoadFlow.Data.Model.ProgramBuilderButtons programBuilderButtons in all)
                {
                    RoadFlow.Data.Model.ProgramBuilderButtons button = programBuilderButtons;
                    RoadFlow.Data.Model.AppLibraryButtons1    model3 = allByAppId.Find((Predicate <RoadFlow.Data.Model.AppLibraryButtons1>)(p => p.ID == button.ID));
                    bool flag2 = false;
                    if (model3 == null)
                    {
                        model3 = new RoadFlow.Data.Model.AppLibraryButtons1();
                        flag2  = true;
                    }
                    model3.AppLibraryID   = model2.ID;
                    model3.ButtonID       = button.ButtonID;
                    model3.Events         = button.ClientScript;
                    model3.Ico            = button.Ico ?? "";
                    model3.ID             = button.ID;
                    model3.Name           = button.ButtonName;
                    model3.ShowType       = button.ShowType;
                    model3.Sort           = button.Sort;
                    model3.Type           = 0;
                    model3.IsValidateShow = button.IsValidateShow;
                    if (flag2)
                    {
                        appLibraryButtons1_1.Add(model3);
                    }
                    else
                    {
                        appLibraryButtons1_1.Update(model3);
                    }
                    appLibraryButtons1List.Add(model3);
                }
                foreach (RoadFlow.Data.Model.AppLibraryButtons1 appLibraryButtons1_2 in allByAppId)
                {
                    RoadFlow.Data.Model.AppLibraryButtons1 button = appLibraryButtons1_2;
                    if (appLibraryButtons1List.Find((Predicate <RoadFlow.Data.Model.AppLibraryButtons1>)(p => p.ID == button.ID)) == null)
                    {
                        appLibraryButtons1_1.Delete(button.ID);
                    }
                }
                transactionScope.Complete();
            }
            new AppLibrary().ClearCache();
            new Menu().ClearAllDataTableCache();
            new AppLibraryButtons1().ClearCache();
            new AppLibrarySubPages().ClearCache();
            this.AddToCache(new ProgramBuilderCache()
            {
                Program   = model1,
                Fields    = new ProgramBuilderFields().GetAll(model1.ID).OrderBy <RoadFlow.Data.Model.ProgramBuilderFields, int>((Func <RoadFlow.Data.Model.ProgramBuilderFields, int>)(p => p.Sort)).ToList <RoadFlow.Data.Model.ProgramBuilderFields>(),
                Querys    = new ProgramBuilderQuerys().GetAll(model1.ID).OrderBy <RoadFlow.Data.Model.ProgramBuilderQuerys, int>((Func <RoadFlow.Data.Model.ProgramBuilderQuerys, int>)(p => p.Sort)).ToList <RoadFlow.Data.Model.ProgramBuilderQuerys>(),
                Buttons   = new ProgramBuilderButtons().GetAll(id).OrderBy <RoadFlow.Data.Model.ProgramBuilderButtons, int>((Func <RoadFlow.Data.Model.ProgramBuilderButtons, int>)(p => p.Sort)).ToList <RoadFlow.Data.Model.ProgramBuilderButtons>(),
                Validates = new ProgramBuilderValidates().GetAll(id),
                Export    = new ProgramBuilderExport().GetAll(id).OrderBy <RoadFlow.Data.Model.ProgramBuilderExport, int>((Func <RoadFlow.Data.Model.ProgramBuilderExport, int>)(p => p.Sort)).ToList <RoadFlow.Data.Model.ProgramBuilderExport>()
            });
            return(true);
        }
示例#19
0
        public int Add(RoadFlow.Data.Model.AppLibrary model)
        {
            string sql = "INSERT INTO AppLibrary\r\n\t\t\t\t(ID,Title,Address,Type,OpenMode,Width,Height,Params,Manager,Note,Code,Ico,Color) \r\n\t\t\t\tVALUES(@ID,@Title,@Address,@Type,@OpenMode,@Width,@Height,@Params,@Manager,@Note,@Code,@Ico,@Color)";

            SqlParameter[] parameter = new SqlParameter[13]
            {
                new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ID
                },
                new SqlParameter("@Title", SqlDbType.NVarChar, 510)
                {
                    Value = model.Title
                },
                new SqlParameter("@Address", SqlDbType.VarChar, 200)
                {
                    Value = model.Address
                },
                new SqlParameter("@Type", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.Type
                },
                new SqlParameter("@OpenMode", SqlDbType.Int, -1)
                {
                    Value = model.OpenMode
                },
                (!model.Width.HasValue) ? new SqlParameter("@Width", SqlDbType.Int, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Width", SqlDbType.Int, -1)
                {
                    Value = model.Width
                },
                (!model.Height.HasValue) ? new SqlParameter("@Height", SqlDbType.Int, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Height", SqlDbType.Int, -1)
                {
                    Value = model.Height
                },
                (model.Params == null) ? new SqlParameter("@Params", SqlDbType.VarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Params", SqlDbType.VarChar, -1)
                {
                    Value = model.Params
                },
                (model.Manager == null) ? new SqlParameter("@Manager", SqlDbType.VarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Manager", SqlDbType.VarChar, -1)
                {
                    Value = model.Manager
                },
                (model.Note == null) ? new SqlParameter("@Note", SqlDbType.VarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Note", SqlDbType.VarChar, -1)
                {
                    Value = model.Note
                },
                (model.Code == null) ? new SqlParameter("@Code", SqlDbType.VarChar, 50)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Code", SqlDbType.VarChar, 50)
                {
                    Value = model.Code
                },
                (model.Ico == null) ? new SqlParameter("@Ico", SqlDbType.VarChar, 2000)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Ico", SqlDbType.VarChar, 2000)
                {
                    Value = model.Ico
                },
                (model.Color == null) ? new SqlParameter("@Color", SqlDbType.VarChar, 50)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Color", SqlDbType.VarChar, 50)
                {
                    Value = model.Color
                }
            };
            return(dbHelper.Execute(sql, parameter));
        }
示例#20
0
        public int Update(RoadFlow.Data.Model.AppLibrary model)
        {
            string sql = "UPDATE AppLibrary SET \r\n\t\t\t\tTitle=@Title,Address=@Address,Type=@Type,OpenMode=@OpenMode,Width=@Width,Height=@Height,Params=@Params,Manager=@Manager,Note=@Note,Code=@Code,Ico=@Ico,Color=@Color\r\n\t\t\t\tWHERE ID=@ID";

            SqlParameter[] parameter = new SqlParameter[13]
            {
                new SqlParameter("@Title", SqlDbType.NVarChar, 510)
                {
                    Value = model.Title
                },
                new SqlParameter("@Address", SqlDbType.VarChar, 200)
                {
                    Value = model.Address
                },
                new SqlParameter("@Type", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.Type
                },
                new SqlParameter("@OpenMode", SqlDbType.Int, -1)
                {
                    Value = model.OpenMode
                },
                (!model.Width.HasValue) ? new SqlParameter("@Width", SqlDbType.Int, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Width", SqlDbType.Int, -1)
                {
                    Value = model.Width
                },
                (!model.Height.HasValue) ? new SqlParameter("@Height", SqlDbType.Int, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Height", SqlDbType.Int, -1)
                {
                    Value = model.Height
                },
                (model.Params == null) ? new SqlParameter("@Params", SqlDbType.VarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Params", SqlDbType.VarChar, -1)
                {
                    Value = model.Params
                },
                (model.Manager == null) ? new SqlParameter("@Manager", SqlDbType.VarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Manager", SqlDbType.VarChar, -1)
                {
                    Value = model.Manager
                },
                (model.Note == null) ? new SqlParameter("@Note", SqlDbType.VarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Note", SqlDbType.VarChar, -1)
                {
                    Value = model.Note
                },
                (model.Code == null) ? new SqlParameter("@Code", SqlDbType.VarChar, 50)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Code", SqlDbType.VarChar, 50)
                {
                    Value = model.Code
                },
                (model.Ico == null) ? new SqlParameter("@Ico", SqlDbType.VarChar, 2000)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Ico", SqlDbType.VarChar, 2000)
                {
                    Value = model.Ico
                },
                (model.Color == null) ? new SqlParameter("@Color", SqlDbType.VarChar, 50)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Color", SqlDbType.VarChar, 50)
                {
                    Value = model.Color
                },
                new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ID
                }
            };
            return(dbHelper.Execute(sql, parameter));
        }
        public string Publish()
        {
            string text  = base.Request["html"];
            string text2 = base.Request["name"];
            string text3 = base.Request["att"];
            string text4 = base.Request["id"];
            string str   = base.Request["formats"];
            Guid   test;

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

            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", jsonData["dbconn"].ToString());
            stringBuilder.AppendFormat("\tstring DBTable = \"{0}\";\r\n", jsonData["dbtable"].ToString());
            stringBuilder.AppendFormat("\tstring DBTablePK = \"{0}\";\r\n", jsonData["dbtablepk"].ToString());
            stringBuilder.AppendFormat("\tstring DBTableTitle = \"{0}\";\r\n", 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, \"" + str + "\");\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 str3 = jsonData.ContainsKey("validatealerttype") ? jsonData["validatealerttype"].ToString() : "2";

            stringBuilder.Append("<input type=\"hidden\" id=\"Form_ValidateAlertType\" name=\"Form_ValidateAlertType\" value=\"" + str3 + "\" />\r\n");
            if (jsonData.ContainsKey("autotitle") && jsonData["autotitle"].ToString().ToLower() == "true")
            {
                stringBuilder.AppendFormat("<input type=\"hidden\" id=\"{0}\" name=\"{0}\" value=\"{1}\" />\r\n", jsonData["dbtable"].ToString() + "." + jsonData["dbtabletitle"].ToString(), "@(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", jsonData["dbtable"].ToString() + "." + jsonData["dbtabletitle"].ToString());
            stringBuilder.AppendFormat("<input type=\"hidden\" id=\"Form_DBConnID\" name=\"Form_DBConnID\" value=\"{0}\" />\r\n", jsonData["dbconn"].ToString());
            stringBuilder.AppendFormat("<input type=\"hidden\" id=\"Form_DBTable\" name=\"Form_DBTable\" value=\"{0}\" />\r\n", jsonData["dbtable"].ToString());
            stringBuilder.AppendFormat("<input type=\"hidden\" id=\"Form_DBTablePk\" name=\"Form_DBTablePk\" value=\"{0}\" />\r\n", jsonData["dbtablepk"].ToString());
            stringBuilder.AppendFormat("<input type=\"hidden\" id=\"Form_DBTableTitle\" name=\"Form_DBTableTitle\" value=\"{0}\" />\r\n", jsonData["dbtabletitle"].ToString());
            stringBuilder.AppendFormat("<input type=\"hidden\" id=\"Form_AutoSaveData\" name=\"Form_AutoSaveData\" value=\"{0}\" />\r\n", "1");
            stringBuilder.AppendFormat("<textarea id=\"Form_DBTableTitleExpression\" name=\"Form_DBTableTitleExpression\" style=\"display:none;width:0;height:0;\">{0}</textarea>\r\n", jsonData.ContainsKey("dbtabletitle1") ? jsonData["dbtabletitle1"].ToString() : "");
            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", jsonData["dbtable"].ToString());
            stringBuilder.Append("\t});\r\n");
            stringBuilder.Append("</script>\r\n");
            FileStream fileStream = System.IO.File.Open(base.Server.MapPath("~/Views/WorkFlowFormDesigner/Forms/" + str2), FileMode.OpenOrCreate, FileAccess.Write, FileShare.None);

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

            streamWriter.Write(stringBuilder.ToString());
            streamWriter.Write(base.Server.HtmlDecode(text));
            streamWriter.Close();
            fileStream.Close();
            string str4 = JsonMapper.ToObject(workFlowForm2.Attribute)["apptype"].ToString();

            RoadFlow.Platform.AppLibrary   appLibrary  = new RoadFlow.Platform.AppLibrary();
            RoadFlow.Data.Model.AppLibrary appLibrary2 = appLibrary.GetByCode(text4);
            bool flag = false;

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