Exemple #1
0
        public void SetValue(DictionDtl oldv, DictionDtl newv, ValueTypeE type)
        {
            oldv.order = newv.order;
            oldv.name  = newv.name;
            switch (type)
            {
            case ValueTypeE.Integer:
                oldv.int_value = newv.int_value;
                break;

            case ValueTypeE.Boolean:
                oldv.bool_value = newv.bool_value;
                break;

            case ValueTypeE.String:
                oldv.string_value = newv.string_value;
                break;

            case ValueTypeE.Double:
                oldv.double_value = newv.double_value;
                break;

            case ValueTypeE.UInteger:
                oldv.uint_value = newv.uint_value;
                break;

            default:
                break;
            }
        }
Exemple #2
0
        internal bool EditDicDtlValue(DictionDtl dtl, ValueTypeE dicType)
        {
            string sql = string.Format("UPDATE diction_dtl set updatetime = {0}, ", GetTimeOrNull(DateTime.Now));

            switch (dicType)
            {
            case ValueTypeE.Integer:
                sql += string.Format("int_value = '{0}'", dtl.int_value);
                break;

            case ValueTypeE.Boolean:
                sql += string.Format("bool_value = {0}", dtl.bool_value);
                break;

            case ValueTypeE.String:
                sql += string.Format("string_value = '{0}'", dtl.string_value);
                break;

            case ValueTypeE.Double:
                sql += string.Format("double_value = '{0}'", dtl.double_value);
                break;

            case ValueTypeE.UInteger:
                sql += string.Format("uint_value = '{0}'", dtl.uint_value);
                break;

            default:
                sql += "1=1";
                break;
            }
            sql += string.Format(" where id = {0}", dtl.id);
            int row = mSql.ExcuteSql(sql);

            return(row >= 1);
        }
Exemple #3
0
        internal bool AddDictionDtl(DictionDtl dtl, ValueTypeE dicType)
        {
            string sql = "INSERT INTO `diction_dtl`(`diction_id`, `code`,  `name`, `int_value`, `bool_value`, `string_value`, `double_value`, `uint_value`, `order`) " +
                         "VALUES ('{0}', '{1}', '{2}', '{3}', {4}, '{5}', '{6}', '{7}', '{8}')";

            sql = string.Format(sql, dtl.diction_id, dtl.code, dtl.name, dtl.int_value, dtl.bool_value, dtl.string_value, dtl.double_value, dtl.uint_value, dtl.order);
            int row = mSql.ExcuteSql(sql);

            return(row >= 1);
        }
Exemple #4
0
 public bool AddDictionDtl(DictionDtl dtl, ValueTypeE dicType, out string result)
 {
     result = "";
     if (!PubMaster.Mod.DicSql.AddDictionDtl(dtl, dicType))
     {
         result = "添加失败!";
         return(false);
     }
     Refresh(false, true);
     return(true);
 }
Exemple #5
0
 public bool AddDictionDtl(DictionDtl dtl, ValueTypeE dicType, out string result)
 {
     result = "";
     if (!PubMaster.Mod.DicSql.AddDictionDtl(dtl, dicType))
     {
         result = "添加失败!";
         return(false);
     }
     mLog.Info(true, string.Format(@"在字典ID【{0}】里,添加字典细节{1}", dtl.diction_id, dtl.ToString()));
     Refresh(false, true);
     return(true);
 }
Exemple #6
0
        public bool EditDictionDtl(DictionDtl dtl, ValueTypeE dicType, out string result)
        {
            result = "";
            DictionDtl d = GetDictionDtl(dtl.id);

            SetValue(d, dtl, dicType);
            if (!PubMaster.Mod.DicSql.EditDicDtlValue(d, dicType))
            {
                result = "添加失败!";
                return(false);
            }
            Refresh(false, true);
            return(true);
        }
Exemple #7
0
        public bool EditDictionDtl(DictionDtl dtl, ValueTypeE dicType, out string result)
        {
            result = "";
            DictionDtl d = GetDictionDtl(dtl.id);

            SetValue(d, dtl, dicType);
            if (!PubMaster.Mod.DicSql.EditDicDtlValue(d, dicType))
            {
                result = "添加失败!";
                return(false);
            }
            mLog.Info(true, string.Format(@"在字典ID【{0}】里,编辑字典细节{1}", d.diction_id, d.ToString()));
            Refresh(false, true);
            return(true);
        }