public static Wlitorderlineresults BuildWlitorderlineresultsFromRow(DataRow row) { Wlitorderlineresults entity = new Wlitorderlineresults(); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.statustype = row.IsNull("statustype") ? string.Empty : row.Field <string>("statustype"); entity.orderno = row.IsNull("orderno") ? 0 : row.Field <int>("orderno"); entity.ordersuf = row.IsNull("ordersuf") ? 0 : row.Field <int>("ordersuf"); entity.ordertype = row.IsNull("ordertype") ? string.Empty : row.Field <string>("ordertype"); entity.updtype = row.IsNull("updtype") ? string.Empty : row.Field <string>("updtype"); entity.setno = row.IsNull("setno") ? string.Empty : row.Field <string>("setno"); entity.errormsg = row.IsNull("errormsg") ? string.Empty : row.Field <string>("errormsg"); entity.wlelrowid = row.Field <byte[]>("wlelrowid").ToStringEncoded(); entity.cWLETstatustype = row.IsNull("cWLETstatustype") ? string.Empty : row.Field <string>("cWLETstatustype"); entity.cWLETOrdertype = row.IsNull("cWLETOrdertype") ? string.Empty : row.Field <string>("cWLETOrdertype"); entity.cWLETUpdatetype = row.IsNull("cWLETUpdatetype") ? string.Empty : row.Field <string>("cWLETUpdatetype"); entity.cWLETErrorMessage = row.IsNull("cWLETErrorMessage") ? string.Empty : row.Field <string>("cWLETErrorMessage"); entity.lineno = row.IsNull("lineno") ? 0 : row.Field <int>("lineno"); entity.specnstype = row.IsNull("specnstype") ? string.Empty : row.Field <string>("specnstype"); entity.shipprod = row.IsNull("shipprod") ? string.Empty : row.Field <string>("shipprod"); entity.stkqty = row.IsNull("stkqty") ? decimal.Zero : row.Field <decimal>("stkqty"); entity.qtyunavail = row.IsNull("qtyunavail") ? decimal.Zero : row.Field <decimal>("qtyunavail"); entity.cTranslatedErrorMessage = row.IsNull("cTranslatedErrorMessage") ? string.Empty : row.Field <string>("cTranslatedErrorMessage"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }
/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromWlitorderlineresults(ref DataRow row, Wlitorderlineresults entity) { row.SetField("whse", entity.whse); row.SetField("statustype", entity.statustype); row.SetField("orderno", entity.orderno); row.SetField("ordersuf", entity.ordersuf); row.SetField("ordertype", entity.ordertype); row.SetField("updtype", entity.updtype); row.SetField("setno", entity.setno); row.SetField("errormsg", entity.errormsg); row.SetField("wlelrowid", entity.wlelrowid.ToByteArray()); row.SetField("cWLETstatustype", entity.cWLETstatustype); row.SetField("cWLETOrdertype", entity.cWLETOrdertype); row.SetField("cWLETUpdatetype", entity.cWLETUpdatetype); row.SetField("cWLETErrorMessage", entity.cWLETErrorMessage); row.SetField("lineno", entity.lineno); row.SetField("specnstype", entity.specnstype); row.SetField("shipprod", entity.shipprod); row.SetField("stkqty", entity.stkqty); row.SetField("qtyunavail", entity.qtyunavail); row.SetField("cTranslatedErrorMessage", entity.cTranslatedErrorMessage); row.SetField("userfield", entity.userfield); }