Example #1
0
        /// <summary>
        /// 将DataRedar转换为List
        /// </summary>
        private List <RoadFlow.Data.Model.UsersApp> DataReaderToList(OracleDataReader dataReader)
        {
            List <RoadFlow.Data.Model.UsersApp> List = new List <RoadFlow.Data.Model.UsersApp>();

            RoadFlow.Data.Model.UsersApp model = null;
            while (dataReader.Read())
            {
                model          = new RoadFlow.Data.Model.UsersApp();
                model.ID       = dataReader.GetString(0).ToGuid();
                model.UserID   = dataReader.GetString(1).ToGuid();
                model.ParentID = dataReader.GetString(2).ToGuid();
                model.RoleID   = dataReader.GetString(3).ToGuid();
                if (!dataReader.IsDBNull(4))
                {
                    model.AppID = dataReader.GetString(4).ToGuid();
                }
                if (!dataReader.IsDBNull(5))
                {
                    model.Title = dataReader.GetString(5);
                }
                if (!dataReader.IsDBNull(6))
                {
                    model.Params = dataReader.GetString(6);
                }
                if (!dataReader.IsDBNull(7))
                {
                    model.Ico = dataReader.GetString(7);
                }
                model.Sort = dataReader.GetInt32(8);
                List.Add(model);
            }
            return(List);
        }
Example #2
0
        /// <summary>
        /// 更新记录
        /// </summary>
        /// <param name="model">RoadFlow.Data.Model.UsersApp实体类</param>
        public int Update(RoadFlow.Data.Model.UsersApp model)
        {
            string sql = @"UPDATE UsersApp SET 
				UserID=:UserID,ParentID=:ParentID,RoleID=:RoleID,AppID=:AppID,Title=:Title,Params=:Params,Ico=:Ico,Sort=:Sort
				WHERE ID=:ID"                ;

            OracleParameter[] parameters = new OracleParameter[] {
                new OracleParameter(":UserID", OracleDbType.Varchar2, 40)
                {
                    Value = model.UserID
                },
                new OracleParameter(":ParentID", OracleDbType.Varchar2, 40)
                {
                    Value = model.ParentID
                },
                new OracleParameter(":RoleID", OracleDbType.Varchar2, 40)
                {
                    Value = model.RoleID
                },
                model.AppID == null ? new OracleParameter(":AppID", OracleDbType.Varchar2, 40)
                {
                    Value = DBNull.Value
                } : new OracleParameter(":AppID", OracleDbType.Varchar2, 40)
                {
                    Value = model.AppID
                },
                model.Title == null ? new OracleParameter(":Title", OracleDbType.NVarchar2, 400)
                {
                    Value = DBNull.Value
                } : new OracleParameter(":Title", OracleDbType.NVarchar2, 400)
                {
                    Value = model.Title
                },
                model.Params == null ? new OracleParameter(":Params", OracleDbType.Varchar2, 500)
                {
                    Value = DBNull.Value
                } : new OracleParameter(":Params", OracleDbType.Varchar2, 500)
                {
                    Value = model.Params
                },
                model.Ico == null ? new OracleParameter(":Ico", OracleDbType.Varchar2, 500)
                {
                    Value = DBNull.Value
                } : new OracleParameter(":Ico", OracleDbType.Varchar2, 500)
                {
                    Value = model.Ico
                },
                new OracleParameter(":Sort", OracleDbType.Int32)
                {
                    Value = model.Sort
                },
                new OracleParameter(":ID", OracleDbType.Varchar2, 40)
                {
                    Value = model.ID
                }
            };
            return(dbHelper.Execute(sql, parameters));
        }
Example #3
0
        /// <summary>
        /// 添加记录
        /// </summary>
        /// <param name="model">RoadFlow.Data.Model.UsersApp实体类</param>
        /// <returns>操作所影响的行数</returns>
        public int Add(RoadFlow.Data.Model.UsersApp model)
        {
            string sql = @"INSERT INTO UsersApp
				(ID,UserID,ParentID,RoleID,AppID,Title,Params,Ico,Sort) 
				VALUES(:ID,:UserID,:ParentID,:RoleID,:AppID,:Title,:Params,:Ico,:Sort)"                ;

            OracleParameter[] parameters = new OracleParameter[] {
                new OracleParameter(":ID", OracleDbType.Varchar2, 40)
                {
                    Value = model.ID
                },
                new OracleParameter(":UserID", OracleDbType.Varchar2, 40)
                {
                    Value = model.UserID
                },
                new OracleParameter(":ParentID", OracleDbType.Varchar2, 40)
                {
                    Value = model.ParentID
                },
                new OracleParameter(":RoleID", OracleDbType.Varchar2, 40)
                {
                    Value = model.RoleID
                },
                model.AppID == null ? new OracleParameter(":AppID", OracleDbType.Varchar2, 40)
                {
                    Value = DBNull.Value
                } : new OracleParameter(":AppID", OracleDbType.Varchar2, 40)
                {
                    Value = model.AppID
                },
                model.Title == null ? new OracleParameter(":Title", OracleDbType.NVarchar2, 400)
                {
                    Value = DBNull.Value
                } : new OracleParameter(":Title", OracleDbType.NVarchar2, 400)
                {
                    Value = model.Title
                },
                model.Params == null ? new OracleParameter(":Params", OracleDbType.Varchar2, 500)
                {
                    Value = DBNull.Value
                } : new OracleParameter(":Params", OracleDbType.Varchar2, 500)
                {
                    Value = model.Params
                },
                model.Ico == null ? new OracleParameter(":Ico", OracleDbType.Varchar2, 500)
                {
                    Value = DBNull.Value
                } : new OracleParameter(":Ico", OracleDbType.Varchar2, 500)
                {
                    Value = model.Ico
                },
                new OracleParameter(":Sort", OracleDbType.Int32)
                {
                    Value = model.Sort
                }
            };
            return(dbHelper.Execute(sql, parameters));
        }
Example #4
0
        /// <summary>
        /// 更新记录
        /// </summary>
        /// <param name="model">RoadFlow.Data.Model.UsersApp实体类</param>
        public int Update(RoadFlow.Data.Model.UsersApp model)
        {
            string sql = @"UPDATE UsersApp SET 
				UserID=@UserID,ParentID=@ParentID,RoleID=@RoleID,AppID=@AppID,Title=@Title,Params=@Params,Ico=@Ico,Sort=@Sort
				WHERE ID=@ID"                ;

            SqlParameter[] parameters = new SqlParameter[] {
                new SqlParameter("@UserID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.UserID
                },
                new SqlParameter("@ParentID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ParentID
                },
                new SqlParameter("@RoleID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.RoleID
                },
                model.AppID == null ? new SqlParameter("@AppID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@AppID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.AppID
                },
                model.Title == null ? new SqlParameter("@Title", SqlDbType.NVarChar, 400)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Title", SqlDbType.NVarChar, 400)
                {
                    Value = model.Title
                },
                model.Params == null ? new SqlParameter("@Params", SqlDbType.VarChar, 500)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Params", SqlDbType.VarChar, 500)
                {
                    Value = model.Params
                },
                model.Ico == null ? new SqlParameter("@Ico", SqlDbType.VarChar, 500)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Ico", SqlDbType.VarChar, 500)
                {
                    Value = model.Ico
                },
                new SqlParameter("@Sort", SqlDbType.Int, -1)
                {
                    Value = model.Sort
                },
                new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ID
                }
            };
            return(dbHelper.Execute(sql, parameters));
        }
Example #5
0
        /// <summary>
        /// 添加记录
        /// </summary>
        /// <param name="model">RoadFlow.Data.Model.UsersApp实体类</param>
        /// <returns>操作所影响的行数</returns>
        public int Add(RoadFlow.Data.Model.UsersApp model)
        {
            string sql = @"INSERT INTO UsersApp
				(ID,UserID,ParentID,RoleID,AppID,Title,Params,Ico,Sort) 
				VALUES(@ID,@UserID,@ParentID,@RoleID,@AppID,@Title,@Params,@Ico,@Sort)"                ;

            SqlParameter[] parameters = new SqlParameter[] {
                new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ID
                },
                new SqlParameter("@UserID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.UserID
                },
                new SqlParameter("@ParentID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ParentID
                },
                new SqlParameter("@RoleID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.RoleID
                },
                model.AppID == null ? new SqlParameter("@AppID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@AppID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.AppID
                },
                model.Title == null ? new SqlParameter("@Title", SqlDbType.NVarChar, 400)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Title", SqlDbType.NVarChar, 400)
                {
                    Value = model.Title
                },
                model.Params == null ? new SqlParameter("@Params", SqlDbType.VarChar, 500)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Params", SqlDbType.VarChar, 500)
                {
                    Value = model.Params
                },
                model.Ico == null ? new SqlParameter("@Ico", SqlDbType.VarChar, 500)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Ico", SqlDbType.VarChar, 500)
                {
                    Value = model.Ico
                },
                new SqlParameter("@Sort", SqlDbType.Int, -1)
                {
                    Value = model.Sort
                }
            };
            return(dbHelper.Execute(sql, parameters));
        }
Example #6
0
        public ActionResult AddApp(FormCollection collection)
        {
            RoadFlow.Platform.AppLibraryBLL bappLibrary = new RoadFlow.Platform.AppLibraryBLL();
            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.Convert <Guid>());
                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.Convert <Guid>();
                    usersApp1.Title    = name.Trim();
                    usersApp1.Sort     = broleApp.GetMaxSort(id.Convert <Guid>());
                    usersApp1.UserID   = userID.Convert <Guid>();
                    usersApp1.RoleID   = roleID.IsGuid() ? roleID.Convert <Guid>() : Guid.Empty;
                    if (appid.IsGuid())
                    {
                        usersApp1.AppID = appid.Convert <Guid>();
                    }
                    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());
        }
Example #7
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();
        }
Example #8
0
 /// <summary>
 /// 更新
 /// </summary>
 public int Update(RoadFlow.Data.Model.UsersApp model)
 {
     return(dataUsersApp.Update(model));
 }
Example #9
0
 /// <summary>
 /// 新增
 /// </summary>
 public int Add(RoadFlow.Data.Model.UsersApp model)
 {
     return(dataUsersApp.Add(model));
 }
Example #10
0
        public ActionResult Body1(FormCollection collection)
        {
            RoadFlow.Platform.AppLibraryBLL bappLibrary = new RoadFlow.Platform.AppLibraryBLL();
            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.Convert <Guid>();
                    }
                    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));
        }
Example #11
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);
        }