public static Oeorderhistory BuildOeorderhistoryFromRow(DataRow row) { Oeorderhistory entity = new Oeorderhistory(); entity.orderno = row.IsNull("orderno") ? 0 : row.Field <int>("orderno"); entity.ordersuf = row.IsNull("ordersuf") ? 0 : row.Field <int>("ordersuf"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.custname = row.IsNull("custname") ? string.Empty : row.Field <string>("custname"); entity.enterdt = row.Field <DateTime?>("enterdt"); entity.shiptonm = row.IsNull("shiptonm") ? string.Empty : row.Field <string>("shiptonm"); entity.shiptoaddr1 = row.IsNull("shiptoaddr1") ? string.Empty : row.Field <string>("shiptoaddr1"); entity.shiptoaddr2 = row.IsNull("shiptoaddr2") ? string.Empty : row.Field <string>("shiptoaddr2"); entity.shiptoaddr3 = row.IsNull("shiptoaddr3") ? string.Empty : row.Field <string>("shiptoaddr3"); entity.shiptocity = row.IsNull("shiptocity") ? string.Empty : row.Field <string>("shiptocity"); entity.shiptost = row.IsNull("shiptost") ? string.Empty : row.Field <string>("shiptost"); entity.shiptozip = row.IsNull("shiptozip") ? string.Empty : row.Field <string>("shiptozip"); entity.shipviaty = row.IsNull("shipviaty") ? string.Empty : row.Field <string>("shipviaty"); entity.shipviatydesc = row.IsNull("shipviatydesc") ? string.Empty : row.Field <string>("shipviatydesc"); entity.transtype = row.IsNull("transtype") ? string.Empty : row.Field <string>("transtype"); entity.totinvamt = row.IsNull("totinvamt") ? decimal.Zero : row.Field <decimal>("totinvamt"); entity.nolines = row.IsNull("nolines") ? 0 : row.Field <int>("nolines"); 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 UpdateRowFromOeorderhistory(ref DataRow row, Oeorderhistory entity) { row.SetField("orderno", entity.orderno); row.SetField("ordersuf", entity.ordersuf); row.SetField("whse", entity.whse); row.SetField("custno", entity.custno); row.SetField("custname", entity.custname); row.SetField("enterdt", entity.enterdt); row.SetField("shiptonm", entity.shiptonm); row.SetField("shiptoaddr1", entity.shiptoaddr1); row.SetField("shiptoaddr2", entity.shiptoaddr2); row.SetField("shiptoaddr3", entity.shiptoaddr3); row.SetField("shiptocity", entity.shiptocity); row.SetField("shiptost", entity.shiptost); row.SetField("shiptozip", entity.shiptozip); row.SetField("shipviaty", entity.shipviaty); row.SetField("shipviatydesc", entity.shipviatydesc); row.SetField("transtype", entity.transtype); row.SetField("totinvamt", entity.totinvamt); row.SetField("nolines", entity.nolines); row.SetField("userfield", entity.userfield); }