/// <summary> /// 数据映射 /// </summary> /// <param name="record">记录</param> /// <param name="info">实体</param> private static void BuildInfo(IRecord record, TemplateMappingInfo info) { info.Id = record.Get <int>("Id"); info.AppId = record.Get <string>("AppId"); info.TemplateIdShort = record.Get <string>("TemplateIdShort"); info.TemplateId = record.Get <string>("TemplateId"); }
public int Add(TemplateMappingInfo info) { ArgumentHelper.AssertNotNull(info, "TemplateMappingInfo is null"); ArgumentHelper.AssertNotNullOrEmpty(info.AppId, "TemplateMappingInfo.appId is null"); ArgumentHelper.AssertNotNullOrEmpty(info.TemplateIdShort, "TemplateMappingInfo.TemplateIdShort is null"); ArgumentHelper.AssertNotNullOrEmpty(info.TemplateId, "TemplateMappingInfo.TemplateId is null"); return(TemplateMappingDao.Insert(info)); }
internal static int Insert(TemplateMappingInfo info) { var db = Database.GetDatabase(DatabaseName.AppConnect); int id = 0; SafeProcedure.ExecuteNonQuery(db, "dbo.TemplateMapping_Insert", parameterMapper => { parameterMapper.AddWithValue("@AppId", info.AppId); parameterMapper.AddWithValue("@TemplateIdShort", info.TemplateIdShort); parameterMapper.AddWithValue("@TemplateId", info.TemplateId); parameterMapper.AddWithValue("@UserId", info.CreateBy); parameterMapper.AddTypedDbNull("@Id", ParameterDirectionWrap.Output, DbType.Int32); }, o => { id = (int)o.GetValue("@Id"); }); return(id); }