/// <summary> /// 得到DawnAuthUserPic实体对象 /// </summary> /// <param name="row">row</param> /// <returns>DawnAuthUserPic实体对象</returns> public DawnAuthUserPicMDL Select(DataRow row) { DawnAuthUserPicMDL obj = new DawnAuthUserPicMDL(); if (row != null) { try { obj.PicId = ((row["pic_id"]) == DBNull.Value) ? 0 : Convert.ToInt32(row["pic_id"]); } catch { } try { obj.UserId = ((row["user_id"]) == DBNull.Value) ? 0 : Convert.ToInt32(row["user_id"]); } catch { } try { obj.PicTime = ((row["pic_time"]) == DBNull.Value) ? DateTime.MinValue : Convert.ToDateTime(row["pic_time"]); } catch { } try { obj.PicPhoto = row["pic_photo"] as byte[]; } catch { } } else { return(null); } return(obj); }
/// <summary> /// 得到DawnAuthUserPic实体对象 /// </summary> /// <param name="dr">dr</param> /// <returns>DawnAuthUserPics实体对象</returns> public DawnAuthUserPicMDL Select(IDataReader dr) { DawnAuthUserPicMDL obj = new DawnAuthUserPicMDL(); try { obj.PicId = ((dr["pic_id"]) == DBNull.Value) ? 0 : Convert.ToInt32(dr["pic_id"]); } catch { } try { obj.UserId = ((dr["user_id"]) == DBNull.Value) ? 0 : Convert.ToInt32(dr["user_id"]); } catch { } try { obj.PicTime = ((dr["pic_time"]) == DBNull.Value) ? DateTime.MinValue : Convert.ToDateTime(dr["pic_time"]); } catch { } try { obj.PicPhoto = dr["pic_photo"] as byte[]; } catch { } return(obj); }
/// <summary> /// 向数据表DawnAuthUserPic修改一条记录 /// </summary> /// <param name="dawnAuthUserPic">DawnAuthUserPic实体对象</param> /// <returns></returns> public static int Update(DawnAuthUserPicMDL dawnAuthUserPic) { if (dawnAuthUserPic == null) { return(0); } return(DawnAuthUserPicBLL._dal.Update(dawnAuthUserPic)); }
/// <summary> /// 向数据表DawnAuthUserPic中插入一条新记录。带事务 /// </summary> /// <param name="sp">事务对象</param> /// <param name="dawnAuthUserPic">DawnAuthUserPic实体对象</param> /// <returns>ı</returns> public static int Insert(SqlTransaction sp, DawnAuthUserPicMDL dawnAuthUserPic) { if (dawnAuthUserPic == null) { return(0); } return(DawnAuthUserPicBLL._dal.Insert(sp, dawnAuthUserPic)); }
/// <summary> /// 向数据表DawnAuthUserPic中插入一条新记录 /// </summary> /// <param name="dawnAuthUserPic">DawnAuthUserPic实体对象</param> /// <returns></returns> public static int Insert(DawnAuthUserPicMDL dawnAuthUserPic) { if (dawnAuthUserPic == null) { return(0); } return(DawnAuthUserPicBLL._dal.Insert(dawnAuthUserPic)); }
/// <summary> /// 删除数据表DawnAuthUserPic中的一条记录,带事务 /// </summary> /// <param name="sp">事务对象</param> /// <param name="dawnAuthUserPic">dawnAuthUserPic实体对象</param> /// <returns></returns> public int Delete(SqlTransaction sp, DawnAuthUserPicMDL dawnAuthUserPic) { string sqlCommand = "DawnAuthUserPicDelete"; SqlParameter[] param = { new SqlParameter("@PicId", SqlDbType.Int) }; param[0].Value = dawnAuthUserPic.PicId; return(SqlHelper.ExecuteNonQuery(sp, CommandType.StoredProcedure, sqlCommand, param)); }
/// <summary> /// 向数据表DawnAuthUserPic修改一条记录。带事务 /// </summary> /// <param name="sp">事务对象</param> /// <param name="dawnAuthUserPic">dawnAuthUserPic实体对象</param> /// <returns></returns> public int Update(SqlTransaction sp, DawnAuthUserPicMDL dawnAuthUserPic) { string sqlCommand = "DawnAuthUserPicUpdate"; SqlParameter[] param = { new SqlParameter("@PicId", SqlDbType.Int), new SqlParameter("@UserId", SqlDbType.Int), new SqlParameter("@PicTime", SqlDbType.DateTime), new SqlParameter("@PicPhoto", SqlDbType.Image) }; param[0].Value = dawnAuthUserPic.PicId; param[1].Value = dawnAuthUserPic.UserId; param[2].Value = dawnAuthUserPic.PicTime; param[3].Value = dawnAuthUserPic.PicPhoto; return(SqlHelper.ExecuteNonQuery(sp, CommandType.StoredProcedure, sqlCommand, param)); }
/// <summary> /// 向数据表DawnAuthUserPic中插入一条新记录。带事务 /// </summary> /// <param name="sp">事务对象</param> /// <param name="dawnAuthUserPic">DawnAuthUserPic实体对象</param> /// <returns></returns> public int Insert(SqlTransaction sp, DawnAuthUserPicMDL dawnAuthUserPic) { string sqlCommand = "DawnAuthUserPicInsert"; int res; SqlParameter[] param = { new SqlParameter("@PicId", SqlDbType.Int), new SqlParameter("@UserId", SqlDbType.Int), new SqlParameter("@PicTime", SqlDbType.DateTime), new SqlParameter("@PicPhoto", SqlDbType.Image) }; param[0].Direction = ParameterDirection.Output; param[1].Value = dawnAuthUserPic.UserId; param[2].Value = dawnAuthUserPic.PicTime; param[3].Value = dawnAuthUserPic.PicPhoto; res = SqlHelper.ExecuteNonQuery(sp, CommandType.StoredProcedure, sqlCommand, param); dawnAuthUserPic.PicId = ((param[0].Value) == DBNull.Value) ? 0 : Convert.ToInt32(param[0].Value); return(res); }
/// <summary> /// 根据ID,返回一个DawnAuthUserPic实体对象 /// </summary> /// <param name="picId">系统编号</param> /// <returns>DawnAuthUserPic实体对象</returns> public DawnAuthUserPicMDL Select(int picId) { DawnAuthUserPicMDL obj = null; SqlParameter[] param = { new SqlParameter("@PicId", SqlDbType.Int) }; param[0].Value = picId; string sqlCommand = "DawnAuthUserPicSelect"; using (SqlDataReader dr = SqlHelper.ExecuteReader(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand, param)) { while (dr.Read()) { obj = this.Select(dr); } } return(obj); }
/// <summary> /// 删除数据表DawnAuthUserPic中的一条记录,带事务 /// </summary> /// <param name="sp">事务对象</param> /// <param name="dawnAuthUserPic">DawnAuthUserPic实体对象</param> /// <returns></returns> public int Delete(SqlTransaction sp, DawnAuthUserPicMDL dawnAuthUserPic) { return(DawnAuthUserPicBLL._dal.Delete(sp, dawnAuthUserPic)); }
/// <summary> /// 删除数据表DawnAuthUserPic中的一条记录 /// </summary> /// <param name="dawnAuthUserPic">DawnAuthUserPic实体对象</param> /// <returns></returns> public static int Delete(DawnAuthUserPicMDL dawnAuthUserPic) { return(DawnAuthUserPicBLL._dal.Delete(dawnAuthUserPic)); }