public Model_ResourceToResourceFolder_img DataRowToModel(DataRow row) { Model_ResourceToResourceFolder_img _img = new Model_ResourceToResourceFolder_img(); if (row != null) { if (row["ResourceToResourceFolder_img_id"] != null) { _img.ResourceToResourceFolder_img_id = row["ResourceToResourceFolder_img_id"].ToString(); } if (row["ResourceToResourceFolder_id"] != null) { _img.ResourceToResourceFolder_id = row["ResourceToResourceFolder_id"].ToString(); } if (row["ResourceToResourceFolderImg_Url"] != null) { _img.ResourceToResourceFolderImg_Url = row["ResourceToResourceFolderImg_Url"].ToString(); } if ((row["ResourceToResourceFolderImg_Order"] != null) && (row["ResourceToResourceFolderImg_Order"].ToString() != "")) { _img.ResourceToResourceFolderImg_Order = new int?(int.Parse(row["ResourceToResourceFolderImg_Order"].ToString())); } if ((row["CreateTime"] != null) && (row["CreateTime"].ToString() != "")) { _img.CreateTime = new DateTime?(DateTime.Parse(row["CreateTime"].ToString())); } } return(_img); }
public bool Add(Model_ResourceToResourceFolder_img model) { StringBuilder builder = new StringBuilder(); builder.Append("insert into ResourceToResourceFolder_img("); builder.Append("ResourceToResourceFolder_img_id,ResourceToResourceFolder_id,ResourceToResourceFolderImg_Url,ResourceToResourceFolderImg_Order,CreateTime)"); builder.Append(" values ("); builder.Append("@ResourceToResourceFolder_img_id,@ResourceToResourceFolder_id,@ResourceToResourceFolderImg_Url,@ResourceToResourceFolderImg_Order,@CreateTime)"); SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@ResourceToResourceFolder_img_id", SqlDbType.Char, 0x24), new SqlParameter("@ResourceToResourceFolder_id", SqlDbType.Char, 0x24), new SqlParameter("@ResourceToResourceFolderImg_Url", SqlDbType.VarChar, 500), new SqlParameter("@ResourceToResourceFolderImg_Order", SqlDbType.Int, 4), new SqlParameter("@CreateTime", SqlDbType.DateTime) }; cmdParms[0].Value = model.ResourceToResourceFolder_img_id; cmdParms[1].Value = model.ResourceToResourceFolder_id; cmdParms[2].Value = model.ResourceToResourceFolderImg_Url; cmdParms[3].Value = model.ResourceToResourceFolderImg_Order; cmdParms[4].Value = model.CreateTime; return(DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0); }
public bool Update(Model_ResourceToResourceFolder_img model) { StringBuilder builder = new StringBuilder(); builder.Append("update ResourceToResourceFolder_img set "); builder.Append("ResourceToResourceFolder_id=@ResourceToResourceFolder_id,"); builder.Append("ResourceToResourceFolderImg_Url=@ResourceToResourceFolderImg_Url,"); builder.Append("ResourceToResourceFolderImg_Order=@ResourceToResourceFolderImg_Order,"); builder.Append("CreateTime=@CreateTime"); builder.Append(" where ResourceToResourceFolder_img_id=@ResourceToResourceFolder_img_id "); SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@ResourceToResourceFolder_id", SqlDbType.Char, 0x24), new SqlParameter("@ResourceToResourceFolderImg_Url", SqlDbType.VarChar, 500), new SqlParameter("@ResourceToResourceFolderImg_Order", SqlDbType.Int, 4), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@ResourceToResourceFolder_img_id", SqlDbType.Char, 0x24) }; cmdParms[0].Value = model.ResourceToResourceFolder_id; cmdParms[1].Value = model.ResourceToResourceFolderImg_Url; cmdParms[2].Value = model.ResourceToResourceFolderImg_Order; cmdParms[3].Value = model.CreateTime; cmdParms[4].Value = model.ResourceToResourceFolder_img_id; return(DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0); }
public List <Model_ResourceToResourceFolder_img> DataTableToList(DataTable dt) { List <Model_ResourceToResourceFolder_img> list = new List <Model_ResourceToResourceFolder_img>(); int count = dt.Rows.Count; if (count > 0) { for (int i = 0; i < count; i++) { Model_ResourceToResourceFolder_img item = this.dal.DataRowToModel(dt.Rows[i]); if (item != null) { list.Add(item); } } } return(list); }
public bool Add(Model_ResourceToResourceFolder_img model) { return(this.dal.Add(model)); }
public bool Update(Model_ResourceToResourceFolder_img model) { return(this.dal.Update(model)); }