/// <summary> /// 修改UserOtherInfo /// </summary> /// <param name="userother"></param> /// <returns></returns> public static int UpdateUserOther(UserOtherInfo userother) { string sql = @"UPDATE [UserOther] SET PersonalityIntroduce=@PersonalityIntroduce WHERE UserId=@UserId"; var par = new DynamicParameters(); par.Add("@UserId", userother.UserId, DbType.Int32); par.Add("@PersonalityIntroduce", userother.PersonalityIntroduce, DbType.String); return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par)); }
/// <summary> /// DataModel 转 ViewModel /// </summary> /// <param name="userotherInfo"></param> /// <returns></returns> public static UserOtherVModel UserOtherInfoToVModel(UserOtherInfo userotherInfo) { if (userotherInfo == null) { return(new UserOtherVModel()); } return(new UserOtherVModel { UserId = userotherInfo.UserId, PersonalityIntroduce = userotherInfo.PersonalityIntroduce }); }
/// <summary> /// 添加UserOtherInfo /// </summary> /// <param name="userother"></param> /// <returns></returns> public static int AddUserOther(UserOtherInfo userother) { string sql = @"INSERT INTO [UserOther] ([UserId],[PersonalityIntroduce]) VALUES (@UserId,@PersonalityIntroduce) SELECT SCOPE_IDENTITY() " ; var par = new DynamicParameters(); par.Add("@UserId", userother.UserId, DbType.Int32); par.Add("@PersonalityIntroduce", userother.PersonalityIntroduce, DbType.String); return(DapWrapper.InnerQueryScalarSql <int>(DbConfig.ArticleManagerConnString, sql, par)); }
/// <summary> /// 修改UserOtherInfo /// </summary> /// <param name="userother"></param> /// <returns></returns> public static int UpdateUserOther(UserOtherInfo userother) { return(DataProvider.UserOthers.UpdateUserOther(userother)); }
/// <summary> /// 添加UserOtherInfo /// </summary> /// <param name="userother"></param> /// <returns></returns> public static int AddUserOther(UserOtherInfo userother) { return(DataProvider.UserOthers.AddUserOther(userother)); }