Exemplo n.º 1
0
        public int Add(RoadFlow.Data.Model.UserShortcut model)
        {
            string sql = "INSERT INTO UserShortcut\r\n\t\t\t\t(ID,MenuID,UserID,Sort) \r\n\t\t\t\tVALUES(:ID,:MenuID,:UserID,:Sort)";

            OracleParameter[] oracleParameterArray = new OracleParameter[4];
            int             index1           = 0;
            OracleParameter oracleParameter1 = new OracleParameter(":ID", OracleDbType.Varchar2);

            oracleParameter1.Value       = (object)model.ID;
            oracleParameterArray[index1] = oracleParameter1;
            int             index2           = 1;
            OracleParameter oracleParameter2 = new OracleParameter(":MenuID", OracleDbType.Varchar2);

            oracleParameter2.Value       = (object)model.MenuID;
            oracleParameterArray[index2] = oracleParameter2;
            int             index3           = 2;
            OracleParameter oracleParameter3 = new OracleParameter(":UserID", OracleDbType.Varchar2);

            oracleParameter3.Value       = (object)model.UserID;
            oracleParameterArray[index3] = oracleParameter3;
            int             index4           = 3;
            OracleParameter oracleParameter4 = new OracleParameter(":Sort", OracleDbType.Int32);

            oracleParameter4.Value       = (object)model.Sort;
            oracleParameterArray[index4] = oracleParameter4;
            OracleParameter[] parameter = oracleParameterArray;
            return(this.dbHelper.Execute(sql, parameter));
        }
Exemplo n.º 2
0
        public int Update(RoadFlow.Data.Model.UserShortcut model)
        {
            string sql = "UPDATE UserShortcut SET \r\n\t\t\t\tMenuID=:MenuID,UserID=:UserID,Sort=:Sort\r\n\t\t\t\tWHERE ID=:ID";

            OracleParameter[] oracleParameterArray = new OracleParameter[4];
            int             index1           = 0;
            OracleParameter oracleParameter1 = new OracleParameter(":MenuID", OracleDbType.Varchar2);

            oracleParameter1.Value       = (object)model.MenuID;
            oracleParameterArray[index1] = oracleParameter1;
            int             index2           = 1;
            OracleParameter oracleParameter2 = new OracleParameter(":UserID", OracleDbType.Varchar2);

            oracleParameter2.Value       = (object)model.UserID;
            oracleParameterArray[index2] = oracleParameter2;
            int             index3           = 2;
            OracleParameter oracleParameter3 = new OracleParameter(":Sort", OracleDbType.Int32);

            oracleParameter3.Value       = (object)model.Sort;
            oracleParameterArray[index3] = oracleParameter3;
            int             index4           = 3;
            OracleParameter oracleParameter4 = new OracleParameter(":ID", OracleDbType.Varchar2);

            oracleParameter4.Value       = (object)model.ID;
            oracleParameterArray[index4] = oracleParameter4;
            OracleParameter[] parameter = oracleParameterArray;
            return(this.dbHelper.Execute(sql, parameter));
        }
Exemplo n.º 3
0
        public int Update(RoadFlow.Data.Model.UserShortcut model)
        {
            string sql = "UPDATE UserShortcut SET \r\n\t\t\t\tMenuID=@MenuID,UserID=@UserID,Sort=@Sort\r\n\t\t\t\tWHERE ID=@ID";

            SqlParameter[] sqlParameterArray = new SqlParameter[4];
            int            index1            = 0;
            SqlParameter   sqlParameter1     = new SqlParameter("@MenuID", SqlDbType.UniqueIdentifier, -1);

            sqlParameter1.Value       = (object)model.MenuID;
            sqlParameterArray[index1] = sqlParameter1;
            int          index2        = 1;
            SqlParameter sqlParameter2 = new SqlParameter("@UserID", SqlDbType.UniqueIdentifier, -1);

            sqlParameter2.Value       = (object)model.UserID;
            sqlParameterArray[index2] = sqlParameter2;
            int          index3        = 2;
            SqlParameter sqlParameter3 = new SqlParameter("@Sort", SqlDbType.Int, -1);

            sqlParameter3.Value       = (object)model.Sort;
            sqlParameterArray[index3] = sqlParameter3;
            int          index4        = 3;
            SqlParameter sqlParameter4 = new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1);

            sqlParameter4.Value       = (object)model.ID;
            sqlParameterArray[index4] = sqlParameter4;
            SqlParameter[] parameter = sqlParameterArray;
            return(this.dbHelper.Execute(sql, parameter, false));
        }
Exemplo n.º 4
0
        public int Add(RoadFlow.Data.Model.UserShortcut model)
        {
            string sql = "INSERT INTO UserShortcut\r\n\t\t\t\t(ID,MenuID,UserID,Sort) \r\n\t\t\t\tVALUES(@ID,@MenuID,@UserID,@Sort)";

            SqlParameter[] sqlParameterArray = new SqlParameter[4];
            int            index1            = 0;
            SqlParameter   sqlParameter1     = new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1);

            sqlParameter1.Value       = (object)model.ID;
            sqlParameterArray[index1] = sqlParameter1;
            int          index2        = 1;
            SqlParameter sqlParameter2 = new SqlParameter("@MenuID", SqlDbType.UniqueIdentifier, -1);

            sqlParameter2.Value       = (object)model.MenuID;
            sqlParameterArray[index2] = sqlParameter2;
            int          index3        = 2;
            SqlParameter sqlParameter3 = new SqlParameter("@UserID", SqlDbType.UniqueIdentifier, -1);

            sqlParameter3.Value       = (object)model.UserID;
            sqlParameterArray[index3] = sqlParameter3;
            int          index4        = 3;
            SqlParameter sqlParameter4 = new SqlParameter("@Sort", SqlDbType.Int, -1);

            sqlParameter4.Value       = (object)model.Sort;
            sqlParameterArray[index4] = sqlParameter4;
            SqlParameter[] parameter = sqlParameterArray;
            return(this.dbHelper.Execute(sql, parameter, false));
        }
Exemplo n.º 5
0
        public int Update(RoadFlow.Data.Model.UserShortcut model)
        {
            string sql = "UPDATE usershortcut SET \r\n\t\t\t\tMenuID=@MenuID,UserID=@UserID,Sort=@Sort\r\n\t\t\t\tWHERE ID=@ID";

            MySqlParameter[] mySqlParameterArray = new MySqlParameter[4];
            int            index1          = 0;
            MySqlParameter mySqlParameter1 = new MySqlParameter("@MenuID", MySqlDbType.VarChar, 36);

            mySqlParameter1.Value       = (object)model.MenuID;
            mySqlParameterArray[index1] = mySqlParameter1;
            int            index2          = 1;
            MySqlParameter mySqlParameter2 = new MySqlParameter("@UserID", MySqlDbType.VarChar, 36);

            mySqlParameter2.Value       = (object)model.UserID;
            mySqlParameterArray[index2] = mySqlParameter2;
            int            index3          = 2;
            MySqlParameter mySqlParameter3 = new MySqlParameter("@Sort", MySqlDbType.Int32, 11);

            mySqlParameter3.Value       = (object)model.Sort;
            mySqlParameterArray[index3] = mySqlParameter3;
            int            index4          = 3;
            MySqlParameter mySqlParameter4 = new MySqlParameter("@ID", MySqlDbType.VarChar, 36);

            mySqlParameter4.Value       = (object)model.ID;
            mySqlParameterArray[index4] = mySqlParameter4;
            MySqlParameter[] parameter = mySqlParameterArray;
            return(this.dbHelper.Execute(sql, parameter, false));
        }
Exemplo n.º 6
0
        public int Add(RoadFlow.Data.Model.UserShortcut model)
        {
            string sql = "INSERT INTO usershortcut\r\n\t\t\t\t(ID,MenuID,UserID,Sort) \r\n\t\t\t\tVALUES(@ID,@MenuID,@UserID,@Sort)";

            MySqlParameter[] mySqlParameterArray = new MySqlParameter[4];
            int            index1          = 0;
            MySqlParameter mySqlParameter1 = new MySqlParameter("@ID", MySqlDbType.VarChar, 36);

            mySqlParameter1.Value       = (object)model.ID;
            mySqlParameterArray[index1] = mySqlParameter1;
            int            index2          = 1;
            MySqlParameter mySqlParameter2 = new MySqlParameter("@MenuID", MySqlDbType.VarChar, 36);

            mySqlParameter2.Value       = (object)model.MenuID;
            mySqlParameterArray[index2] = mySqlParameter2;
            int            index3          = 2;
            MySqlParameter mySqlParameter3 = new MySqlParameter("@UserID", MySqlDbType.VarChar, 36);

            mySqlParameter3.Value       = (object)model.UserID;
            mySqlParameterArray[index3] = mySqlParameter3;
            int            index4          = 3;
            MySqlParameter mySqlParameter4 = new MySqlParameter("@Sort", MySqlDbType.Int32, 11);

            mySqlParameter4.Value       = (object)model.Sort;
            mySqlParameterArray[index4] = mySqlParameter4;
            MySqlParameter[] parameter = mySqlParameterArray;
            return(this.dbHelper.Execute(sql, parameter, false));
        }
Exemplo n.º 7
0
 public int Update(RoadFlow.Data.Model.UserShortcut model)
 {
     return(this.dataUserShortcut.Update(model));
 }
Exemplo n.º 8
0
 public int Add(RoadFlow.Data.Model.UserShortcut model)
 {
     return(this.dataUserShortcut.Add(model));
 }
Exemplo n.º 9
0
 public ActionResult ShortcutSet(FormCollection collection)
 {
     RoadFlow.Platform.UserShortcut userShortcut = new RoadFlow.Platform.UserShortcut();
     if (collection != null)
     {
         if (!this.Request.Form["issort"].IsNullOrEmpty())
         {
             string[] strArray = (this.Request.Form["sort"] ?? "").Split(',');
             for (int index = 0; index < strArray.Length; ++index)
             {
                 RoadFlow.Data.Model.UserShortcut model = userShortcut.Get(strArray[index].ToGuid());
                 if (model != null)
                 {
                     model.Sort = index;
                     userShortcut.Update(model);
                 }
             }
             // ISSUE: reference to a compiler-generated field
             if (UserInfoController.\u003C\u003Eo__5.\u003C\u003Ep__0 == null)
             {
                 // ISSUE: reference to a compiler-generated field
                 UserInfoController.\u003C\u003Eo__5.\u003C\u003Ep__0 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "script", typeof(UserInfoController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                 {
                     CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                     CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, (string)null)
                 }));
             }
             // ISSUE: reference to a compiler-generated field
             // ISSUE: reference to a compiler-generated field
             object obj = UserInfoController.\u003C\u003Eo__5.\u003C\u003Ep__0.Target((CallSite)UserInfoController.\u003C\u003Eo__5.\u003C\u003Ep__0, this.ViewBag, "alert('排序保存成功!');window.location=window.location;");
         }
         else
         {
             Guid   currentUserId = RoadFlow.Platform.Users.CurrentUserID;
             string str1          = this.Request.Form["menuid"] ?? "";
             using (TransactionScope transactionScope = new TransactionScope())
             {
                 userShortcut.DeleteByUserID(currentUserId);
                 int    num     = 0;
                 string str2    = str1;
                 char[] chArray = new char[1] {
                     ','
                 };
                 foreach (string str3 in str2.Split(chArray))
                 {
                     if (str3.IsGuid())
                     {
                         userShortcut.Add(new RoadFlow.Data.Model.UserShortcut()
                         {
                             ID     = Guid.NewGuid(),
                             MenuID = str3.ToGuid(),
                             Sort   = num++,
                             UserID = currentUserId
                         });
                     }
                 }
                 transactionScope.Complete();
                 // ISSUE: reference to a compiler-generated field
                 if (UserInfoController.\u003C\u003Eo__5.\u003C\u003Ep__1 == null)
                 {
                     // ISSUE: reference to a compiler-generated field
                     UserInfoController.\u003C\u003Eo__5.\u003C\u003Ep__1 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "script", typeof(UserInfoController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                     {
                         CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                         CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, (string)null)
                     }));
                 }
                 // ISSUE: reference to a compiler-generated field
                 // ISSUE: reference to a compiler-generated field
                 object obj = UserInfoController.\u003C\u003Eo__5.\u003C\u003Ep__1.Target((CallSite)UserInfoController.\u003C\u003Eo__5.\u003C\u003Ep__1, this.ViewBag, "alert('保存成功!');window.location=window.location;");
             }
         }
         userShortcut.ClearCache();
     }
     return((ActionResult)this.View());
 }