コード例 #1
0
        private List <RoadFlow.Data.Model.Dictionary> DataReaderToList(SqlDataReader dataReader)
        {
            List <RoadFlow.Data.Model.Dictionary> list = new List <RoadFlow.Data.Model.Dictionary>();

            RoadFlow.Data.Model.Dictionary dictionary = null;
            while (dataReader.Read())
            {
                dictionary          = new RoadFlow.Data.Model.Dictionary();
                dictionary.ID       = dataReader.GetGuid(0);
                dictionary.ParentID = dataReader.GetGuid(1);
                dictionary.Title    = dataReader.GetString(2);
                if (!dataReader.IsDBNull(3))
                {
                    dictionary.Code = dataReader.GetString(3);
                }
                if (!dataReader.IsDBNull(4))
                {
                    dictionary.Value = dataReader.GetString(4);
                }
                if (!dataReader.IsDBNull(5))
                {
                    dictionary.Note = dataReader.GetString(5);
                }
                if (!dataReader.IsDBNull(6))
                {
                    dictionary.Other = dataReader.GetString(6);
                }
                dictionary.Sort = dataReader.GetInt32(7);
                list.Add(dictionary);
            }
            return(list);
        }
コード例 #2
0
        private string getOptionsValue(OptionValueField valueField, RoadFlow.Data.Model.Dictionary dict)
        {
            string result = string.Empty;

            switch (valueField)
            {
            case OptionValueField.Code:
                result = dict.Code;
                break;

            case OptionValueField.ID:
                result = dict.ID.ToString();
                break;

            case OptionValueField.Note:
                result = dict.Note;
                break;

            case OptionValueField.Other:
                result = dict.Other;
                break;

            case OptionValueField.Title:
                result = dict.Title;
                break;

            case OptionValueField.Value:
                result = dict.Value;
                break;
            }
            return(result);
        }
コード例 #3
0
        public string Tree1()
        {
            string msg;

            if (!Tools.CheckLogin(out msg) && !RoadFlow.Platform.WeiXin.Organize.CheckLogin())
            {
                return("");
            }
            RoadFlow.Platform.Dictionary dictionary = new RoadFlow.Platform.Dictionary();
            string text  = base.Request.QueryString["root"];
            bool   flag2 = "1" == base.Request.QueryString["ischild"];
            Guid   test  = Guid.Empty;

            if (!text.IsNullOrEmpty() && !text.IsGuid(out test))
            {
                RoadFlow.Data.Model.Dictionary byCode = dictionary.GetByCode(text);
                if (byCode != null)
                {
                    test = byCode.ID;
                }
            }
            RoadFlow.Data.Model.Dictionary dictionary2 = (test != Guid.Empty) ? dictionary.Get(test) : dictionary.GetRoot();
            bool          flag          = dictionary.HasChilds(dictionary2.ID);
            StringBuilder stringBuilder = new StringBuilder("[", 1000);

            stringBuilder.Append("{");
            stringBuilder.AppendFormat("\"id\":\"{0}\",", dictionary2.ID);
            stringBuilder.AppendFormat("\"parentID\":\"{0}\",", dictionary2.ParentID);
            stringBuilder.AppendFormat("\"title\":\"{0}\",", dictionary2.Title);
            stringBuilder.AppendFormat("\"type\":\"{0}\",", flag ? "0" : "2");
            stringBuilder.AppendFormat("\"ico\":\"{0}\",", base.Url.Content("~/images/ico/role.gif"));
            stringBuilder.AppendFormat("\"hasChilds\":\"{0}\",", flag ? "1" : "0");
            stringBuilder.Append("\"childs\":[");
            List <RoadFlow.Data.Model.Dictionary> childs = dictionary.GetChilds(dictionary2.ID);
            int num   = 0;
            int count = childs.Count;

            foreach (RoadFlow.Data.Model.Dictionary item in childs)
            {
                stringBuilder.Append("{");
                stringBuilder.AppendFormat("\"id\":\"{0}\",", item.ID);
                stringBuilder.AppendFormat("\"parentID\":\"{0}\",", item.ParentID);
                stringBuilder.AppendFormat("\"title\":\"{0}\",", item.Title);
                stringBuilder.AppendFormat("\"ico\":\"{0}\",", "");
                stringBuilder.AppendFormat("\"hasChilds\":\"{0}\",", dictionary.HasChilds(item.ID) ? "1" : "0");
                stringBuilder.Append("\"childs\":[");
                stringBuilder.Append("]");
                stringBuilder.Append("}");
                if (num++ < count - 1)
                {
                    stringBuilder.Append(",");
                }
            }
            stringBuilder.Append("]");
            stringBuilder.Append("}");
            stringBuilder.Append("]");
            return(stringBuilder.ToString());
        }
コード例 #4
0
 /// <summary>
 /// 删除一个字典
 /// </summary>
 /// <param name="dictionary">字典实体</param>
 /// <returns></returns>
 public int Delete(Model.Dictionary dictionary)
 {
     ClearCache();
     using (var db = new DataContext())
     {
         db.Remove(dictionary);
         return(db.SaveChanges());
     }
 }
コード例 #5
0
 public string GetTitle(Guid id)
 {
     RoadFlow.Data.Model.Dictionary dictionary = Get(id, true);
     if (dictionary != null)
     {
         return(dictionary.Title);
     }
     return("");
 }
コード例 #6
0
 public Guid GetIDByCode(string code)
 {
     RoadFlow.Data.Model.Dictionary byCode = GetByCode(code, true);
     if (byCode != null)
     {
         return(byCode.ID);
     }
     return(Guid.Empty);
 }
コード例 #7
0
 private void addParent(List <RoadFlow.Data.Model.Dictionary> list, Guid id)
 {
     RoadFlow.Data.Model.Dictionary parent = GetParent(id);
     if (parent != null)
     {
         list.Add(parent);
         addParent(list, parent.ParentID);
     }
 }
コード例 #8
0
        private int getParentCount(List <RoadFlow.Data.Model.Dictionary> dictList, RoadFlow.Data.Model.Dictionary dict)
        {
            int num = 0;

            RoadFlow.Data.Model.Dictionary parentDict = dictList.Find((RoadFlow.Data.Model.Dictionary p) => p.ID == dict.ParentID);
            while (parentDict != null)
            {
                parentDict = dictList.Find((RoadFlow.Data.Model.Dictionary p) => p.ID == parentDict.ParentID);
                num++;
            }
            return(num);
        }
コード例 #9
0
        public int Update(RoadFlow.Data.Model.Dictionary model)
        {
            string sql = "UPDATE Dictionary SET \r\n\t\t\t\tParentID=@ParentID,Title=@Title,Code=@Code,Value=@Value,Note=@Note,Other=@Other,Sort=@Sort\r\n\t\t\t\tWHERE ID=@ID";

            SqlParameter[] parameter = new SqlParameter[8]
            {
                new SqlParameter("@ParentID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ParentID
                },
                new SqlParameter("@Title", SqlDbType.NVarChar, -1)
                {
                    Value = model.Title
                },
                (model.Code == null) ? new SqlParameter("@Code", SqlDbType.VarChar, 500)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Code", SqlDbType.VarChar, 500)
                {
                    Value = model.Code
                },
                (model.Value == null) ? new SqlParameter("@Value", SqlDbType.VarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Value", SqlDbType.VarChar, -1)
                {
                    Value = model.Value
                },
                (model.Note == null) ? new SqlParameter("@Note", SqlDbType.VarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Note", SqlDbType.VarChar, -1)
                {
                    Value = model.Note
                },
                (model.Other == null) ? new SqlParameter("@Other", SqlDbType.VarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Other", SqlDbType.VarChar, -1)
                {
                    Value = model.Other
                },
                new SqlParameter("@Sort", SqlDbType.Int, -1)
                {
                    Value = model.Sort
                },
                new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ID
                }
            };
            return(dbHelper.Execute(sql, parameter));
        }
コード例 #10
0
        public int Add(RoadFlow.Data.Model.Dictionary model)
        {
            string sql = "INSERT INTO Dictionary\r\n\t\t\t\t(ID,ParentID,Title,Code,Value,Note,Other,Sort) \r\n\t\t\t\tVALUES(@ID,@ParentID,@Title,@Code,@Value,@Note,@Other,@Sort)";

            SqlParameter[] parameter = new SqlParameter[8]
            {
                new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ID
                },
                new SqlParameter("@ParentID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ParentID
                },
                new SqlParameter("@Title", SqlDbType.NVarChar, -1)
                {
                    Value = model.Title
                },
                (model.Code == null) ? new SqlParameter("@Code", SqlDbType.VarChar, 500)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Code", SqlDbType.VarChar, 500)
                {
                    Value = model.Code
                },
                (model.Value == null) ? new SqlParameter("@Value", SqlDbType.VarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Value", SqlDbType.VarChar, -1)
                {
                    Value = model.Value
                },
                (model.Note == null) ? new SqlParameter("@Note", SqlDbType.VarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Note", SqlDbType.VarChar, -1)
                {
                    Value = model.Note
                },
                (model.Other == null) ? new SqlParameter("@Other", SqlDbType.VarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Other", SqlDbType.VarChar, -1)
                {
                    Value = model.Other
                },
                new SqlParameter("@Sort", SqlDbType.Int, -1)
                {
                    Value = model.Sort
                }
            };
            return(dbHelper.Execute(sql, parameter));
        }
コード例 #11
0
 public string GetTitle(string code)
 {
     if (code.IsNullOrEmpty())
     {
         return("");
     }
     RoadFlow.Data.Model.Dictionary byCode = GetByCode(code.Trim(), true);
     if (byCode != null)
     {
         return(byCode.Title);
     }
     return("");
 }
コード例 #12
0
 public RoadFlow.Data.Model.Dictionary Get(Guid id, bool fromCache = false)
 {
     if (fromCache)
     {
         RoadFlow.Data.Model.Dictionary dictionary = GetAll(true).Find((RoadFlow.Data.Model.Dictionary p) => p.ID == id);
         if (dictionary != null)
         {
             return(dictionary);
         }
         return(dataDictionary.Get(id));
     }
     return(dataDictionary.Get(id));
 }
コード例 #13
0
 public string GetTitle(string code, string value)
 {
     if (code.IsNullOrEmpty())
     {
         return("");
     }
     RoadFlow.Data.Model.Dictionary dictionary = getChildsByCodeFromCache(code.Trim()).Find((RoadFlow.Data.Model.Dictionary p) => p.Value == value);
     if (dictionary != null)
     {
         return(dictionary.Title);
     }
     return("");
 }
コード例 #14
0
 public List <RoadFlow.Data.Model.Dictionary> GetAllChilds(string code, bool fromCache)
 {
     if (code.IsNullOrEmpty())
     {
         return(new List <RoadFlow.Data.Model.Dictionary>());
     }
     RoadFlow.Data.Model.Dictionary byCode = GetByCode(code, fromCache);
     if (byCode == null)
     {
         return(new List <RoadFlow.Data.Model.Dictionary>());
     }
     return(GetAllChilds(byCode.ID, fromCache));
 }
コード例 #15
0
        private List <RoadFlow.Data.Model.Dictionary> getChildsByCodeFromCache(string code)
        {
            List <RoadFlow.Data.Model.Dictionary> all = GetAll(true);

            RoadFlow.Data.Model.Dictionary dict = all.Find((RoadFlow.Data.Model.Dictionary p) => string.Compare(p.Code, code, true) == 0);
            if (dict != null)
            {
                return((from p in all.FindAll((RoadFlow.Data.Model.Dictionary p) => p.ParentID == dict.ID)
                        orderby p.Sort
                        select p).ToList());
            }
            return(new List <RoadFlow.Data.Model.Dictionary>());
        }
コード例 #16
0
        public List <RoadFlow.Data.Model.Dictionary> GetAllParents(Guid id, bool isMe = true)
        {
            List <RoadFlow.Data.Model.Dictionary> list = new List <RoadFlow.Data.Model.Dictionary>();

            RoadFlow.Data.Model.Dictionary dictionary = Get(id);
            if (dictionary == null)
            {
                return(list);
            }
            if (isMe)
            {
                list.Add(dictionary);
            }
            addParent(list, dictionary.ParentID);
            return(list);
        }
コード例 #17
0
        public string GetNames()
        {
            string obj = base.Request.QueryString["values"] ?? "";

            RoadFlow.Platform.Dictionary dictionary = new RoadFlow.Platform.Dictionary();
            StringBuilder stringBuilder             = new StringBuilder();

            string[] array = obj.Split(',');
            foreach (string str in array)
            {
                RoadFlow.Data.Model.Dictionary dictionary2 = dictionary.Get(str.ToGuid(), true);
                if (dictionary2 != null)
                {
                    stringBuilder.Append(dictionary2.Title);
                    stringBuilder.Append(',');
                }
            }
            return(stringBuilder.ToString().TrimEnd(','));
        }
コード例 #18
0
        public ActionResult Body(FormCollection collection)
        {
            RoadFlow.Platform.Dictionary   dictionary  = new RoadFlow.Platform.Dictionary();
            RoadFlow.Data.Model.Dictionary dictionary2 = null;
            string str = base.Request.QueryString["id"];

            if (str.IsGuid())
            {
                dictionary2 = dictionary.Get(str.ToGuid());
            }
            if (dictionary2 == null)
            {
                dictionary2 = dictionary.GetRoot();
            }
            if (collection != null)
            {
                string text = (dictionary2.ParentID == Guid.Empty) ? dictionary2.ID.ToString() : dictionary2.ParentID.ToString();
                if (!base.Request.Form["Delete"].IsNullOrEmpty())
                {
                    int num = dictionary.DeleteAndAllChilds(dictionary2.ID);
                    dictionary.RefreshCache();
                    RoadFlow.Platform.Log.Add("删除了数据字典及其下级共" + num.ToString() + "项", dictionary2.Serialize(), RoadFlow.Platform.Log.Types.数据字典);
                    base.ViewBag.Script = "alert('删除成功!');parent.frames[0].reLoad('" + text + "');window.location='Body?id=" + dictionary2.ParentID.ToString() + "&appid=" + base.Request.QueryString["appid"] + "';";
                    return(View(dictionary2));
                }
                string text2  = base.Request.Form["Title"];
                string text3  = base.Request.Form["Code"];
                string text4  = base.Request.Form["Values"];
                string text5  = base.Request.Form["Note"];
                string text6  = base.Request.Form["Other"];
                string oldXML = dictionary2.Serialize();
                dictionary2.Code  = (text3.IsNullOrEmpty() ? null : text3.Trim());
                dictionary2.Note  = (text5.IsNullOrEmpty() ? null : text5.Trim());
                dictionary2.Other = (text6.IsNullOrEmpty() ? null : text6.Trim());
                dictionary2.Title = text2.Trim();
                dictionary2.Value = (text4.IsNullOrEmpty() ? null : text4.Trim());
                dictionary.Update(dictionary2);
                dictionary.RefreshCache();
                RoadFlow.Platform.Log.Add("修改了数据字典项", "", RoadFlow.Platform.Log.Types.数据字典, oldXML, dictionary2.Serialize());
                base.ViewBag.Script = "alert('保存成功!');parent.frames[0].reLoad('" + text + "');";
            }
            return(View(dictionary2));
        }
コード例 #19
0
        public bool HasCode(string code, string id = "")
        {
            if (code.IsNullOrEmpty())
            {
                return(false);
            }
            RoadFlow.Data.Model.Dictionary byCode = GetByCode(code.Trim());
            if (byCode == null)
            {
                return(false);
            }
            Guid test;

            if (id.IsGuid(out test) && byCode.ID == test)
            {
                return(false);
            }
            return(true);
        }
コード例 #20
0
        public ActionResult Sort(FormCollection collection)
        {
            RoadFlow.Platform.Dictionary dictionary = new RoadFlow.Platform.Dictionary();
            string text  = base.Request.QueryString["id"];
            string text2 = "";
            List <RoadFlow.Data.Model.Dictionary> model = new List <RoadFlow.Data.Model.Dictionary>();
            Guid test;

            if (text.IsGuid(out test))
            {
                RoadFlow.Data.Model.Dictionary dictionary2 = dictionary.Get(test);
                if (dictionary2 != null)
                {
                    model = dictionary.GetChilds(dictionary2.ParentID);
                    text2 = dictionary2.ParentID.ToString();
                }
            }
            if (collection != null)
            {
                string text3 = base.Request.Form["sort"];
                if (text3.IsNullOrEmpty())
                {
                    return(View(model));
                }
                string[] array  = text3.Split(',');
                int      num    = 1;
                string[] array2 = array;
                for (int i = 0; i < array2.Length; i++)
                {
                    Guid test2;
                    if (array2[i].IsGuid(out test2))
                    {
                        dictionary.UpdateSort(test2, num++);
                    }
                }
                dictionary.RefreshCache();
                RoadFlow.Platform.Log.Add("保存了数据字典排序", "保存了ID为:" + text + "的同级排序", RoadFlow.Platform.Log.Types.数据字典);
                base.ViewBag.Script = "parent.frames[0].reLoad('" + text2 + "');";
                model = dictionary.GetChilds(text2.ToGuid());
            }
            return(View(model));
        }
コード例 #21
0
        public ActionResult add1(FormCollection collection)
        {
            RoadFlow.Data.Model.Dictionary dictionary  = new RoadFlow.Data.Model.Dictionary();
            RoadFlow.Platform.Dictionary   dictionary2 = new RoadFlow.Platform.Dictionary();
            string text = base.Request.QueryString["id"];

            if (!text.IsGuid())
            {
                RoadFlow.Data.Model.Dictionary root = dictionary2.GetRoot();
                text = ((root != null) ? root.ID.ToString() : "");
            }
            if (!text.IsGuid())
            {
                throw new Exception("未找到父级");
            }
            if (collection != null)
            {
                string text2 = base.Request.Form["Title"];
                string text3 = base.Request.Form["Code"];
                string text4 = base.Request.Form["Values"];
                string text5 = base.Request.Form["Note"];
                string text6 = base.Request.Form["Other"];
                dictionary.ID       = Guid.NewGuid();
                dictionary.Code     = (text3.IsNullOrEmpty() ? null : text3.Trim());
                dictionary.Note     = (text5.IsNullOrEmpty() ? null : text5.Trim());
                dictionary.Other    = (text6.IsNullOrEmpty() ? null : text6.Trim());
                dictionary.ParentID = text.ToGuid();
                dictionary.Sort     = dictionary2.GetMaxSort(text.ToGuid());
                dictionary.Title    = text2.Trim();
                dictionary.Value    = (text4.IsNullOrEmpty() ? null : text4.Trim());
                dictionary2.Add(dictionary);
                dictionary2.RefreshCache();
                RoadFlow.Platform.Log.Add("添加了数据字典项", dictionary.Serialize(), RoadFlow.Platform.Log.Types.数据字典);
                base.ViewBag.Script = "alert('添加成功!');parent.frames[0].reLoad('" + text + "');";
            }
            return(View(dictionary));
        }
コード例 #22
0
        public int Add(RoadFlow.Data.Model.Dictionary 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_0063: Unknown result type (might be due to invalid IL or missing references)
            //IL_0068: Unknown result type (might be due to invalid IL or missing references)
            //IL_0074: Expected O, but got Unknown
            //IL_0075: Expected O, but got Unknown
            //IL_008a: Unknown result type (might be due to invalid IL or missing references)
            //IL_008f: Unknown result type (might be due to invalid IL or missing references)
            //IL_009b: 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_00b8: Expected O, but got Unknown
            //IL_00b9: Expected O, but got Unknown
            //IL_00ce: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d3: Unknown result type (might be due to invalid IL or missing references)
            //IL_00df: Expected O, but got Unknown
            //IL_00ec: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f1: Unknown result type (might be due to invalid IL or missing references)
            //IL_00fc: Expected O, but got Unknown
            //IL_00fd: Expected O, but got Unknown
            //IL_0112: Unknown result type (might be due to invalid IL or missing references)
            //IL_0117: Unknown result type (might be due to invalid IL or missing references)
            //IL_0123: Expected O, but got Unknown
            //IL_0130: Unknown result type (might be due to invalid IL or missing references)
            //IL_0135: Unknown result type (might be due to invalid IL or missing references)
            //IL_0140: Expected O, but got Unknown
            //IL_0141: Expected O, but got Unknown
            //IL_0156: Unknown result type (might be due to invalid IL or missing references)
            //IL_015b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0167: Expected O, but got Unknown
            //IL_0174: Unknown result type (might be due to invalid IL or missing references)
            //IL_0179: Unknown result type (might be due to invalid IL or missing references)
            //IL_0184: Expected O, but got Unknown
            //IL_0185: Expected O, but got Unknown
            //IL_018f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0194: Unknown result type (might be due to invalid IL or missing references)
            //IL_01a5: Expected O, but got Unknown
            //IL_01a6: Expected O, but got Unknown
            string sql = "INSERT INTO dictionary\r\n\t\t\t\t(ID,ParentID,Title,Code,Value,Note,Other,Sort) \r\n\t\t\t\tVALUES(@ID,@ParentID,@Title,@Code,@Value,@Note,@Other,@Sort)";

            MySqlParameter[] obj = new MySqlParameter[8];
            MySqlParameter   val = new MySqlParameter("@ID", 253, 36);

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

            ((DbParameter)val2).Value = model.ParentID;
            obj[1] = val2;
            MySqlParameter val3 = new MySqlParameter("@Title", 751, -1);

            ((DbParameter)val3).Value = model.Title;
            obj[2] = val3;
            _003F val4;

            if (model.Code != null)
            {
                val4 = new MySqlParameter("@Code", 752, -1);
                ((DbParameter)val4).Value = model.Code;
            }
            else
            {
                val4 = new MySqlParameter("@Code", 752, -1);
                ((DbParameter)val4).Value = DBNull.Value;
            }
            obj[3] = val4;
            _003F val5;

            if (model.Value != null)
            {
                val5 = new MySqlParameter("@Value", 751, -1);
                ((DbParameter)val5).Value = model.Value;
            }
            else
            {
                val5 = new MySqlParameter("@Value", 751, -1);
                ((DbParameter)val5).Value = DBNull.Value;
            }
            obj[4] = val5;
            _003F val6;

            if (model.Note != null)
            {
                val6 = new MySqlParameter("@Note", 751, -1);
                ((DbParameter)val6).Value = model.Note;
            }
            else
            {
                val6 = new MySqlParameter("@Note", 751, -1);
                ((DbParameter)val6).Value = DBNull.Value;
            }
            obj[5] = val6;
            _003F val7;

            if (model.Other != null)
            {
                val7 = new MySqlParameter("@Other", 751, -1);
                ((DbParameter)val7).Value = model.Other;
            }
            else
            {
                val7 = new MySqlParameter("@Other", 751, -1);
                ((DbParameter)val7).Value = DBNull.Value;
            }
            obj[6] = val7;
            MySqlParameter val8 = new MySqlParameter("@Sort", 3, 11);

            ((DbParameter)val8).Value = model.Sort;
            obj[7] = val8;
            MySqlParameter[] parameter = (MySqlParameter[])obj;
            return(dbHelper.Execute(sql, parameter));
        }
コード例 #23
0
 public int Update(RoadFlow.Data.Model.Dictionary model)
 {
     return(dataDictionary.Update(model));
 }
コード例 #24
0
 public int Add(RoadFlow.Data.Model.Dictionary model)
 {
     return(dataDictionary.Add(model));
 }
コード例 #25
0
        public int Update(RoadFlow.Data.Model.Dictionary 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_003e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0043: Unknown result type (might be due to invalid IL or missing references)
            //IL_004f: Expected O, but got Unknown
            //IL_0050: Expected O, but got Unknown
            //IL_0065: Unknown result type (might be due to invalid IL or missing references)
            //IL_006a: Unknown result type (might be due to invalid IL or missing references)
            //IL_0076: Expected O, but got Unknown
            //IL_0083: Unknown result type (might be due to invalid IL or missing references)
            //IL_0088: Unknown result type (might be due to invalid IL or missing references)
            //IL_0093: Expected O, but got Unknown
            //IL_0094: Expected O, but got Unknown
            //IL_00a9: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ba: 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_00ed: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f2: Unknown result type (might be due to invalid IL or missing references)
            //IL_00fe: Expected O, but got Unknown
            //IL_010b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0110: Unknown result type (might be due to invalid IL or missing references)
            //IL_011b: Expected O, but got Unknown
            //IL_011c: Expected O, but got Unknown
            //IL_0131: Unknown result type (might be due to invalid IL or missing references)
            //IL_0136: Unknown result type (might be due to invalid IL or missing references)
            //IL_0142: Expected O, but got Unknown
            //IL_014f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0154: Unknown result type (might be due to invalid IL or missing references)
            //IL_015f: Expected O, but got Unknown
            //IL_0160: Expected O, but got Unknown
            //IL_016a: Unknown result type (might be due to invalid IL or missing references)
            //IL_016f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0180: Expected O, but got Unknown
            //IL_0181: Expected O, but got Unknown
            //IL_018f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0194: Unknown result type (might be due to invalid IL or missing references)
            //IL_01a5: Expected O, but got Unknown
            //IL_01a6: Expected O, but got Unknown
            string sql = "UPDATE dictionary SET \r\n\t\t\t\tParentID=@ParentID,Title=@Title,Code=@Code,Value=@Value,Note=@Note,Other=@Other,Sort=@Sort\r\n\t\t\t\tWHERE ID=@ID";

            MySqlParameter[] obj = new MySqlParameter[8];
            MySqlParameter   val = new MySqlParameter("@ParentID", 253, 36);

            ((DbParameter)val).Value = model.ParentID;
            obj[0] = val;
            MySqlParameter val2 = new MySqlParameter("@Title", 751, -1);

            ((DbParameter)val2).Value = model.Title;
            obj[1] = val2;
            _003F val3;

            if (model.Code != null)
            {
                val3 = new MySqlParameter("@Code", 752, -1);
                ((DbParameter)val3).Value = model.Code;
            }
            else
            {
                val3 = new MySqlParameter("@Code", 752, -1);
                ((DbParameter)val3).Value = DBNull.Value;
            }
            obj[2] = val3;
            _003F val4;

            if (model.Value != null)
            {
                val4 = new MySqlParameter("@Value", 751, -1);
                ((DbParameter)val4).Value = model.Value;
            }
            else
            {
                val4 = new MySqlParameter("@Value", 751, -1);
                ((DbParameter)val4).Value = DBNull.Value;
            }
            obj[3] = val4;
            _003F val5;

            if (model.Note != null)
            {
                val5 = new MySqlParameter("@Note", 751, -1);
                ((DbParameter)val5).Value = model.Note;
            }
            else
            {
                val5 = new MySqlParameter("@Note", 751, -1);
                ((DbParameter)val5).Value = DBNull.Value;
            }
            obj[4] = val5;
            _003F val6;

            if (model.Other != null)
            {
                val6 = new MySqlParameter("@Other", 751, -1);
                ((DbParameter)val6).Value = model.Other;
            }
            else
            {
                val6 = new MySqlParameter("@Other", 751, -1);
                ((DbParameter)val6).Value = DBNull.Value;
            }
            obj[5] = val6;
            MySqlParameter val7 = new MySqlParameter("@Sort", 3, 11);

            ((DbParameter)val7).Value = model.Sort;
            obj[6] = val7;
            MySqlParameter val8 = new MySqlParameter("@ID", 253, 36);

            ((DbParameter)val8).Value = model.ID;
            obj[7] = val8;
            MySqlParameter[] parameter = (MySqlParameter[])obj;
            return(dbHelper.Execute(sql, parameter));
        }