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)";

            SqlParameter[] parameter = new SqlParameter[4]
            {
                new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ID
                },
                new SqlParameter("@MenuID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.MenuID
                },
                new SqlParameter("@UserID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.UserID
                },
                new SqlParameter("@Sort", SqlDbType.Int, -1)
                {
                    Value = model.Sort
                }
            };
            return(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";

            SqlParameter[] parameter = new SqlParameter[4]
            {
                new SqlParameter("@MenuID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.MenuID
                },
                new SqlParameter("@UserID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.UserID
                },
                new SqlParameter("@Sort", SqlDbType.Int, -1)
                {
                    Value = model.Sort
                },
                new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ID
                }
            };
            return(dbHelper.Execute(sql, parameter));
        }
Exemplo n.º 3
0
 public ActionResult ShortcutSet(FormCollection collection)
 {
     RoadFlow.Platform.UserShortcut userShortcut = new RoadFlow.Platform.UserShortcut();
     if (collection != null)
     {
         if (!base.Request.Form["issort"].IsNullOrEmpty())
         {
             string[] array = (base.Request.Form["sort"] ?? "").Split(',');
             for (int i = 0; i < array.Length; i++)
             {
                 RoadFlow.Data.Model.UserShortcut userShortcut2 = userShortcut.Get(array[i].ToGuid());
                 if (userShortcut2 != null)
                 {
                     userShortcut2.Sort = i;
                     userShortcut.Update(userShortcut2);
                 }
             }
             base.ViewBag.script = "alert('排序保存成功!');window.location=window.location;";
         }
         else
         {
             Guid   currentUserID = RoadFlow.Platform.Users.CurrentUserID;
             string text          = base.Request.Form["menuid"] ?? "";
             using (TransactionScope transactionScope = new TransactionScope())
             {
                 userShortcut.DeleteByUserID(currentUserID);
                 int      num    = 0;
                 string[] array2 = text.Split(',');
                 foreach (string str in array2)
                 {
                     if (str.IsGuid())
                     {
                         RoadFlow.Data.Model.UserShortcut userShortcut3 = new RoadFlow.Data.Model.UserShortcut();
                         userShortcut3.ID     = Guid.NewGuid();
                         userShortcut3.MenuID = str.ToGuid();
                         userShortcut3.Sort   = num++;
                         userShortcut3.UserID = currentUserID;
                         userShortcut.Add(userShortcut3);
                     }
                 }
                 transactionScope.Complete();
                 base.ViewBag.script = "alert('保存成功!');window.location=window.location;";
             }
         }
         userShortcut.ClearCache();
     }
     return(View());
 }
Exemplo n.º 4
0
        private List <RoadFlow.Data.Model.UserShortcut> DataReaderToList(SqlDataReader dataReader)
        {
            List <RoadFlow.Data.Model.UserShortcut> list = new List <RoadFlow.Data.Model.UserShortcut>();

            RoadFlow.Data.Model.UserShortcut userShortcut = null;
            while (dataReader.Read())
            {
                userShortcut        = new RoadFlow.Data.Model.UserShortcut();
                userShortcut.ID     = dataReader.GetGuid(0);
                userShortcut.MenuID = dataReader.GetGuid(1);
                userShortcut.UserID = dataReader.GetGuid(2);
                userShortcut.Sort   = dataReader.GetInt32(3);
                list.Add(userShortcut);
            }
            return(list);
        }
Exemplo n.º 5
0
        private List <RoadFlow.Data.Model.UserShortcut> DataReaderToList(MySqlDataReader dataReader)
        {
            List <RoadFlow.Data.Model.UserShortcut> list = new List <RoadFlow.Data.Model.UserShortcut>();

            RoadFlow.Data.Model.UserShortcut userShortcut = null;
            while (((DbDataReader)dataReader).Read())
            {
                userShortcut        = new RoadFlow.Data.Model.UserShortcut();
                userShortcut.ID     = ((DbDataReader)dataReader).GetString(0).ToGuid();
                userShortcut.MenuID = ((DbDataReader)dataReader).GetString(1).ToGuid();
                userShortcut.UserID = ((DbDataReader)dataReader).GetString(2).ToGuid();
                userShortcut.Sort   = ((DbDataReader)dataReader).GetInt32(3);
                list.Add(userShortcut);
            }
            return(list);
        }
Exemplo n.º 6
0
        public int Update(RoadFlow.Data.Model.UserShortcut model)
        {
            //IL_001a: Unknown result type (might be due to invalid IL or missing references)
            //IL_001f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0030: Expected O, but got Unknown
            //IL_0031: Expected O, but got Unknown
            //IL_003f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0044: Unknown result type (might be due to invalid IL or missing references)
            //IL_0055: Expected O, but got Unknown
            //IL_0056: Expected O, but got Unknown
            //IL_0060: Unknown result type (might be due to invalid IL or missing references)
            //IL_0065: Unknown result type (might be due to invalid IL or missing references)
            //IL_0076: Expected O, but got Unknown
            //IL_0077: Expected O, but got Unknown
            //IL_0085: Unknown result type (might be due to invalid IL or missing references)
            //IL_008a: Unknown result type (might be due to invalid IL or missing references)
            //IL_009b: Expected O, but got Unknown
            //IL_009c: Expected O, but got Unknown
            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[] obj = new MySqlParameter[4];
            MySqlParameter   val = new MySqlParameter("@MenuID", 253, 36);

            ((DbParameter)val).Value = model.MenuID;
            obj[0] = val;
            MySqlParameter val2 = new MySqlParameter("@UserID", 253, 36);

            ((DbParameter)val2).Value = model.UserID;
            obj[1] = val2;
            MySqlParameter val3 = new MySqlParameter("@Sort", 3, 11);

            ((DbParameter)val3).Value = model.Sort;
            obj[2] = val3;
            MySqlParameter val4 = new MySqlParameter("@ID", 253, 36);

            ((DbParameter)val4).Value = model.ID;
            obj[3] = val4;
            MySqlParameter[] parameter = (MySqlParameter[])obj;
            return(dbHelper.Execute(sql, parameter));
        }
Exemplo n.º 7
0
        public int Add(RoadFlow.Data.Model.UserShortcut model)
        {
            //IL_001a: Unknown result type (might be due to invalid IL or missing references)
            //IL_001f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0030: Expected O, but got Unknown
            //IL_0031: Expected O, but got Unknown
            //IL_003f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0044: Unknown result type (might be due to invalid IL or missing references)
            //IL_0055: Expected O, but got Unknown
            //IL_0056: Expected O, but got Unknown
            //IL_0064: Unknown result type (might be due to invalid IL or missing references)
            //IL_0069: Unknown result type (might be due to invalid IL or missing references)
            //IL_007a: Expected O, but got Unknown
            //IL_007b: Expected O, but got Unknown
            //IL_0085: Unknown result type (might be due to invalid IL or missing references)
            //IL_008a: Unknown result type (might be due to invalid IL or missing references)
            //IL_009b: Expected O, but got Unknown
            //IL_009c: Expected O, but got Unknown
            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[] obj = new MySqlParameter[4];
            MySqlParameter   val = new MySqlParameter("@ID", 253, 36);

            ((DbParameter)val).Value = model.ID;
            obj[0] = val;
            MySqlParameter val2 = new MySqlParameter("@MenuID", 253, 36);

            ((DbParameter)val2).Value = model.MenuID;
            obj[1] = val2;
            MySqlParameter val3 = new MySqlParameter("@UserID", 253, 36);

            ((DbParameter)val3).Value = model.UserID;
            obj[2] = val3;
            MySqlParameter val4 = new MySqlParameter("@Sort", 3, 11);

            ((DbParameter)val4).Value = model.Sort;
            obj[3] = val4;
            MySqlParameter[] parameter = (MySqlParameter[])obj;
            return(dbHelper.Execute(sql, parameter));
        }
Exemplo n.º 8
0
        public int Update(RoadFlow.Data.Model.UserShortcut model)
        {
            //IL_0015: Unknown result type (might be due to invalid IL or missing references)
            //IL_001a: Unknown result type (might be due to invalid IL or missing references)
            //IL_002b: Expected O, but got Unknown
            //IL_002c: Expected O, but got Unknown
            //IL_0035: Unknown result type (might be due to invalid IL or missing references)
            //IL_003a: Unknown result type (might be due to invalid IL or missing references)
            //IL_004b: Expected O, but got Unknown
            //IL_004c: Expected O, but got Unknown
            //IL_0055: Unknown result type (might be due to invalid IL or missing references)
            //IL_005a: Unknown result type (might be due to invalid IL or missing references)
            //IL_006b: Expected O, but got Unknown
            //IL_006c: Expected O, but got Unknown
            //IL_0075: Unknown result type (might be due to invalid IL or missing references)
            //IL_007a: Unknown result type (might be due to invalid IL or missing references)
            //IL_008b: Expected O, but got Unknown
            //IL_008c: Expected O, but got Unknown
            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[] obj = new OracleParameter[4];
            OracleParameter   val = new OracleParameter(":MenuID", 126);

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

            ((DbParameter)val2).Value = model.UserID;
            obj[1] = val2;
            OracleParameter val3 = new OracleParameter(":Sort", 112);

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

            ((DbParameter)val4).Value = model.ID;
            obj[3] = val4;
            OracleParameter[] parameter = (OracleParameter[])obj;
            return(dbHelper.Execute(sql, parameter));
        }
Exemplo n.º 9
0
 public int Update(RoadFlow.Data.Model.UserShortcut model)
 {
     return(dataUserShortcut.Update(model));
 }
Exemplo n.º 10
0
 public int Add(RoadFlow.Data.Model.UserShortcut model)
 {
     return(dataUserShortcut.Add(model));
 }