Пример #1
0
        protected override object OnSuccessCommandForEffectCount(int effect)
        {
            IEnumerable <IDataParamet> p = Paramet;

            if (p != null && p_NewItem != null && p_Par != null && p_Par.OutputGenerateFieldNames != null)
            {
                IDataModel model = typeof(T).GetDataModel();
                foreach (string fn in p_Par.OutputGenerateFieldNames)
                {
                    object v     = MsSqlServerHelper.GetParametValue(fn, p_Par.NameHz, p);
                    var    field = model.Fields[fn];
                    v = MsSqlServerHelper.ConvertFieldValueFromDbValue(field, v);
                    field.SetModelFieldValue(p_NewItem, v);
                }
            }
            return(base.OnSuccessCommandForEffectCount(effect));
        }
Пример #2
0
 /// <summary>
 /// 将字段值从数据库格式转换为本机格式
 /// </summary>
 /// <param name="field">字段信息</param>
 /// <param name="value">字段值</param>
 /// <returns></returns>
 protected object ConvertFieldValueFromDbValue(IDataModel model, string name, object value)
 {
     return(MsSqlServerHelper.ConvertFieldValueFromDbValue(model.Fields[name], value));
 }