/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromOeonetimerebate(ref DataRow row, Oeonetimerebate entity) { row.SetField("orderno", entity.orderno); row.SetField("ordersuf", entity.ordersuf); row.SetField("lineno", entity.lineno); row.SetField("idpder", entity.idpder); row.SetField("prod", entity.prod); row.SetField("whse", entity.whse); row.SetField("prodcost", entity.prodcost); row.SetField("prccostper", entity.prccostper); row.SetField("currebamt", entity.currebamt); row.SetField("currebcst", entity.currebcst); row.SetField("venrebno", entity.venrebno); row.SetField("unit", entity.unit); row.SetField("curcontract", entity.curcontract); row.SetField("vendname", entity.vendname); row.SetField("currencyty", entity.currencyty); row.SetField("newrebcst", entity.newrebcst); row.SetField("newrebamt", entity.newrebamt); row.SetField("vendno", entity.vendno); row.SetField("contractno", entity.contractno); row.SetField("costtypeenabled", entity.costtypeenabled); row.SetField("costtype", entity.costtype); row.SetField("userfield", entity.userfield); }
public static Oeonetimerebate BuildOeonetimerebateFromRow(DataRow row) { Oeonetimerebate entity = new Oeonetimerebate(); entity.orderno = row.IsNull("orderno") ? 0 : row.Field <int>("orderno"); entity.ordersuf = row.IsNull("ordersuf") ? 0 : row.Field <int>("ordersuf"); entity.lineno = row.IsNull("lineno") ? 0 : row.Field <int>("lineno"); entity.idpder = row.IsNull("idpder") ? 0 : row.Field <long>("idpder"); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.prodcost = row.IsNull("prodcost") ? decimal.Zero : row.Field <decimal>("prodcost"); entity.prccostper = row.IsNull("prccostper") ? string.Empty : row.Field <string>("prccostper"); entity.currebamt = row.IsNull("currebamt") ? decimal.Zero : row.Field <decimal>("currebamt"); entity.currebcst = row.IsNull("currebcst") ? decimal.Zero : row.Field <decimal>("currebcst"); entity.venrebno = row.IsNull("venrebno") ? string.Empty : row.Field <string>("venrebno"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.curcontract = row.IsNull("curcontract") ? string.Empty : row.Field <string>("curcontract"); entity.vendname = row.IsNull("vendname") ? string.Empty : row.Field <string>("vendname"); entity.currencyty = row.IsNull("currencyty") ? string.Empty : row.Field <string>("currencyty"); entity.newrebcst = row.IsNull("newrebcst") ? decimal.Zero : row.Field <decimal>("newrebcst"); entity.newrebamt = row.IsNull("newrebamt") ? decimal.Zero : row.Field <decimal>("newrebamt"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.contractno = row.IsNull("contractno") ? string.Empty : row.Field <string>("contractno"); entity.costtypeenabled = row.Field <bool>("costtypeenabled"); entity.costtype = row.IsNull("costtype") ? string.Empty : row.Field <string>("costtype"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }