/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromIceavdetail(ref DataRow row, Iceavdetail entity) { row.SetField("whse", entity.whse); row.SetField("WhseName", entity.whseName); row.SetField("origprod", entity.origprod); row.SetField("origdescrip", entity.origdescrip); row.SetField("coredescrip", entity.coredescrip); row.SetField("coreprod", entity.coreprod); row.SetField("vendno", entity.vendno); row.SetField("vendname", entity.vendname); row.SetField("qtyimply", entity.qtyimply); row.SetField("qtyoh", entity.qtyoh); row.SetField("qtywarr", entity.qtywarr); row.SetField("iceav-rowid", entity.iceavRowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Iceavdetail BuildIceavdetailFromRow(DataRow row) { Iceavdetail entity = new Iceavdetail(); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.whseName = row.IsNull("WhseName") ? string.Empty : row.Field <string>("WhseName"); entity.origprod = row.IsNull("origprod") ? string.Empty : row.Field <string>("origprod"); entity.origdescrip = row.IsNull("origdescrip") ? string.Empty : row.Field <string>("origdescrip"); entity.coredescrip = row.IsNull("coredescrip") ? string.Empty : row.Field <string>("coredescrip"); entity.coreprod = row.IsNull("coreprod") ? string.Empty : row.Field <string>("coreprod"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.vendname = row.IsNull("vendname") ? string.Empty : row.Field <string>("vendname"); entity.qtyimply = row.IsNull("qtyimply") ? decimal.Zero : row.Field <decimal>("qtyimply"); entity.qtyoh = row.IsNull("qtyoh") ? decimal.Zero : row.Field <decimal>("qtyoh"); entity.qtywarr = row.IsNull("qtywarr") ? decimal.Zero : row.Field <decimal>("qtywarr"); entity.iceavRowid = row.Field <byte[]>("iceav-rowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }