/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromManrebsearchresults(ref DataRow row, Manrebsearchresults entity) { row.SetField("rebrecno", entity.rebrecno); row.SetField("custno", entity.custno); row.SetField("shipto", entity.shipto); row.SetField("prod", entity.prod); row.SetField("prodcat", entity.prodcat); row.SetField("prodline", entity.prodline); row.SetField("rebatety", entity.rebatety); row.SetField("prodprcty", entity.prodprcty); row.SetField("vendno", entity.vendno); row.SetField("contractno", entity.contractno); row.SetField("contractline", entity.contractline); row.SetField("whse", entity.whse); row.SetField("rebcalcty", entity.rebcalcty); row.SetField("cRebCalcty", entity.cRebCalcty); row.SetField("rebamt", entity.rebamt); row.SetField("rebbasedon", entity.rebbasedon); row.SetField("rebpercent", entity.rebpercent); row.SetField("rebbasedfm", entity.rebbasedfm); row.SetField("rebdownto", entity.rebdownto); row.SetField("margincost", entity.margincost); row.SetField("marpctgnt", entity.marpctgnt); row.SetField("sharepct", entity.sharepct); row.SetField("sharecapamt", entity.sharecapamt); row.SetField("rebateamt", entity.rebateamt); row.SetField("startdt", entity.startdt); row.SetField("enddt", entity.enddt); row.SetField("cRebateDesc", entity.cRebateDesc); row.SetField("cDropShipty", entity.cDropShipty); row.SetField("currencyty", entity.currencyty); row.SetField("iRecordLimit", entity.iRecordLimit); row.SetField("pd_rowid", entity.pdRowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Manrebsearchresults BuildManrebsearchresultsFromRow(DataRow row) { Manrebsearchresults entity = new Manrebsearchresults(); entity.rebrecno = row.IsNull("rebrecno") ? decimal.Zero : row.Field <decimal>("rebrecno"); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.shipto = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto"); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.prodcat = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat"); entity.prodline = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline"); entity.rebatety = row.IsNull("rebatety") ? string.Empty : row.Field <string>("rebatety"); entity.prodprcty = row.IsNull("prodprcty") ? string.Empty : row.Field <string>("prodprcty"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.contractno = row.IsNull("contractno") ? string.Empty : row.Field <string>("contractno"); entity.contractline = row.IsNull("contractline") ? 0 : row.Field <int>("contractline"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.rebcalcty = row.IsNull("rebcalcty") ? string.Empty : row.Field <string>("rebcalcty"); entity.cRebCalcty = row.IsNull("cRebCalcty") ? string.Empty : row.Field <string>("cRebCalcty"); entity.rebamt = row.IsNull("rebamt") ? decimal.Zero : row.Field <decimal>("rebamt"); entity.rebbasedon = row.IsNull("rebbasedon") ? string.Empty : row.Field <string>("rebbasedon"); entity.rebpercent = row.IsNull("rebpercent") ? decimal.Zero : row.Field <decimal>("rebpercent"); entity.rebbasedfm = row.IsNull("rebbasedfm") ? string.Empty : row.Field <string>("rebbasedfm"); entity.rebdownto = row.IsNull("rebdownto") ? string.Empty : row.Field <string>("rebdownto"); entity.margincost = row.IsNull("margincost") ? decimal.Zero : row.Field <decimal>("margincost"); entity.marpctgnt = row.IsNull("marpctgnt") ? decimal.Zero : row.Field <decimal>("marpctgnt"); entity.sharepct = row.IsNull("sharepct") ? decimal.Zero : row.Field <decimal>("sharepct"); entity.sharecapamt = row.IsNull("sharecapamt") ? decimal.Zero : row.Field <decimal>("sharecapamt"); entity.rebateamt = row.IsNull("rebateamt") ? decimal.Zero : row.Field <decimal>("rebateamt"); entity.startdt = row.Field <DateTime?>("startdt"); entity.enddt = row.Field <DateTime?>("enddt"); entity.cRebateDesc = row.IsNull("cRebateDesc") ? string.Empty : row.Field <string>("cRebateDesc"); entity.cDropShipty = row.IsNull("cDropShipty") ? string.Empty : row.Field <string>("cDropShipty"); entity.currencyty = row.IsNull("currencyty") ? string.Empty : row.Field <string>("currencyty"); entity.iRecordLimit = row.IsNull("iRecordLimit") ? 0 : row.Field <int>("iRecordLimit"); entity.pdRowid = row.Field <byte[]>("pd_rowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }