/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromAoservicewarranty(ref DataRow row, Aoservicewarranty entity) { row.SetField("cono", entity.cono); row.SetField("billtype", entity.billtype); row.SetField("jobtype", entity.jobtype); row.SetField("bomtype", entity.bomtype); row.SetField("prodcat", entity.prodcat); row.SetField("claimtype", entity.claimtype); row.SetField("wolimit", entity.wolimit); row.SetField("cAccount", entity.cAccount); row.SetField("origcustfl", entity.origcustfl); row.SetField("promdays", entity.promdays); row.SetField("reqdays", entity.reqdays); row.SetField("reldate", entity.reldate); row.SetField("prtfrmt", entity.prtfrmt); row.SetField("repairheadfl", entity.repairheadfl); row.SetField("PrintOnOEInvoice", entity.printOnOEInvoice); row.SetField("swao-rowid", entity.swaoRowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Aoservicewarranty BuildAoservicewarrantyFromRow(DataRow row) { Aoservicewarranty entity = new Aoservicewarranty(); entity.cono = row.IsNull("cono") ? 0 : row.Field <int>("cono"); entity.billtype = row.Field <bool>("billtype"); entity.jobtype = row.IsNull("jobtype") ? string.Empty : row.Field <string>("jobtype"); entity.bomtype = row.IsNull("bomtype") ? string.Empty : row.Field <string>("bomtype"); entity.prodcat = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat"); entity.claimtype = row.IsNull("claimtype") ? string.Empty : row.Field <string>("claimtype"); entity.wolimit = row.IsNull("wolimit") ? decimal.Zero : row.Field <decimal>("wolimit"); entity.cAccount = row.IsNull("cAccount") ? string.Empty : row.Field <string>("cAccount"); entity.origcustfl = row.Field <bool>("origcustfl"); entity.promdays = row.IsNull("promdays") ? 0 : row.Field <int>("promdays"); entity.reqdays = row.IsNull("reqdays") ? 0 : row.Field <int>("reqdays"); entity.reldate = row.Field <DateTime?>("reldate"); entity.prtfrmt = row.IsNull("prtfrmt") ? 0 : row.Field <int>("prtfrmt"); entity.repairheadfl = row.Field <bool>("repairheadfl"); entity.printOnOEInvoice = row.Field <bool>("PrintOnOEInvoice"); entity.swaoRowid = row.Field <byte[]>("swao-rowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }