public bool Update(UnitsVolume uv) { string sql = string.Format(@"UPDATE UnitsVolume SET "); sql += string.Format("UniqueName={0}, ", uv.Name); sql += string.Format("DisplayFullName='{0}', ", uv.DisplayFullName); sql += string.Format("DisplayAbbreviatedName='{0}', ", uv.DisplayAbbreviatedName); sql += string.Format("ConversionFactor={0}, ", uv.ConversionFactor); sql += string.Format("Description='{0}', ", uv.Description); sql += string.Format("WHERE CatID='{0}'", uv.Id); return(DB.Update(sql)); }
private UnitsVolume getDataObject(DataRow row) { UnitsVolume uv = new UnitsVolume(); uv.Id = Convert.ToInt32(row[0].ToString()); uv.Name = row[1].ToString(); uv.DisplayFullName = row[2].ToString(); uv.DisplayAbbreviatedName = row[3].ToString(); uv.ConversionFactor = Convert.ToDouble(row[4].ToString()); uv.Description = row[5].ToString(); return(uv); }
public int Insert(UnitsVolume uv) { return(this.Insert(uv.Name, uv.DisplayFullName, uv.DisplayAbbreviatedName, uv.ConversionFactor, uv.Description)); }