コード例 #1
0
        public static Loadpolineextresults BuildLoadpolineextresultsFromRow(DataRow row)
        {
            Loadpolineextresults entity = new Loadpolineextresults();

            entity.duedt           = row.Field <DateTime?>("duedt");
            entity.unit            = row.IsNull("unit") ? string.Empty : row.Field <string>("unit");
            entity.price           = row.IsNull("price") ? decimal.Zero : row.Field <decimal>("price");
            entity.lineno          = row.IsNull("lineno") ? 0 : row.Field <int>("lineno");
            entity.reasunavty      = row.IsNull("reasunavty") ? string.Empty : row.Field <string>("reasunavty");
            entity.weight          = row.IsNull("weight") ? decimal.Zero : row.Field <decimal>("weight");
            entity.totweight       = row.IsNull("totweight") ? decimal.Zero : row.Field <decimal>("totweight");
            entity.onorder         = row.IsNull("onorder") ? decimal.Zero : row.Field <decimal>("onorder");
            entity.proddesc        = row.IsNull("proddesc") ? string.Empty : row.Field <string>("proddesc");
            entity.netamt          = row.IsNull("netamt") ? decimal.Zero : row.Field <decimal>("netamt");
            entity.specprcst       = row.IsNull("specprcst") ? string.Empty : row.Field <string>("specprcst");
            entity.stkqtyord       = row.IsNull("stkqtyord") ? decimal.Zero : row.Field <decimal>("stkqtyord");
            entity.cubes           = row.IsNull("cubes") ? decimal.Zero : row.Field <decimal>("cubes");
            entity.totcubes        = row.IsNull("totcubes") ? decimal.Zero : row.Field <decimal>("totcubes");
            entity.backorder       = row.IsNull("backorder") ? decimal.Zero : row.Field <decimal>("backorder");
            entity.expshipdt       = row.Field <DateTime?>("expshipdt");
            entity.stkunit         = row.IsNull("stkunit") ? string.Empty : row.Field <string>("stkunit");
            entity.reqshipdt       = row.Field <DateTime?>("reqshipdt");
            entity.ignoreltfl      = row.Field <bool>("ignoreltfl");
            entity.netavail        = row.IsNull("netavail") ? decimal.Zero : row.Field <decimal>("netavail");
            entity.contractno      = row.IsNull("contractno") ? string.Empty : row.Field <string>("contractno");
            entity.ackdt           = row.Field <DateTime?>("ackdt");
            entity.user1           = row.IsNull("user1") ? string.Empty : row.Field <string>("user1");
            entity.user4           = row.IsNull("user4") ? string.Empty : row.Field <string>("user4");
            entity.user7           = row.Field <decimal?>("user7");
            entity.user2           = row.IsNull("user2") ? string.Empty : row.Field <string>("user2");
            entity.user5           = row.IsNull("user5") ? string.Empty : row.Field <string>("user5");
            entity.user8           = row.Field <DateTime?>("user8");
            entity.ackrsn          = row.IsNull("ackrsn") ? string.Empty : row.Field <string>("ackrsn");
            entity.user3           = row.IsNull("user3") ? string.Empty : row.Field <string>("user3");
            entity.user6           = row.Field <decimal?>("user6");
            entity.user9           = row.Field <DateTime?>("user9");
            entity.ncnr            = row.IsNull("ncnr") ? string.Empty : row.Field <string>("ncnr");
            entity.dutyrate        = row.IsNull("dutyrate") ? decimal.Zero : row.Field <decimal>("dutyrate");
            entity.tariffcd        = row.IsNull("tariffcd") ? string.Empty : row.Field <string>("tariffcd");
            entity.countryoforigin = row.IsNull("countryoforigin") ? string.Empty : row.Field <string>("countryoforigin");
            entity.vendretauth     = row.IsNull("vendretauth") ? string.Empty : row.Field <string>("vendretauth");
            entity.netbillty       = row.IsNull("netbillty") ? string.Empty : row.Field <string>("netbillty");
            entity.upcid           = row.IsNull("upcid") ? string.Empty : row.Field <string>("upcid");
            entity.dlvrydatecd     = row.IsNull("dlvrydatecd") ? string.Empty : row.Field <string>("dlvrydatecd");
            return(entity);
        }
コード例 #2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromLoadpolineextresults(ref DataRow row, Loadpolineextresults entity)
 {
     row.SetField("duedt", entity.duedt);
     row.SetField("unit", entity.unit);
     row.SetField("price", entity.price);
     row.SetField("lineno", entity.lineno);
     row.SetField("reasunavty", entity.reasunavty);
     row.SetField("weight", entity.weight);
     row.SetField("totweight", entity.totweight);
     row.SetField("onorder", entity.onorder);
     row.SetField("proddesc", entity.proddesc);
     row.SetField("netamt", entity.netamt);
     row.SetField("specprcst", entity.specprcst);
     row.SetField("stkqtyord", entity.stkqtyord);
     row.SetField("cubes", entity.cubes);
     row.SetField("totcubes", entity.totcubes);
     row.SetField("backorder", entity.backorder);
     row.SetField("expshipdt", entity.expshipdt);
     row.SetField("stkunit", entity.stkunit);
     row.SetField("reqshipdt", entity.reqshipdt);
     row.SetField("ignoreltfl", entity.ignoreltfl);
     row.SetField("netavail", entity.netavail);
     row.SetField("contractno", entity.contractno);
     row.SetField("ackdt", entity.ackdt);
     row.SetField("user1", entity.user1);
     row.SetField("user4", entity.user4);
     row.SetField("user7", entity.user7);
     row.SetField("user2", entity.user2);
     row.SetField("user5", entity.user5);
     row.SetField("user8", entity.user8);
     row.SetField("ackrsn", entity.ackrsn);
     row.SetField("user3", entity.user3);
     row.SetField("user6", entity.user6);
     row.SetField("user9", entity.user9);
     row.SetField("ncnr", entity.ncnr);
     row.SetField("dutyrate", entity.dutyrate);
     row.SetField("tariffcd", entity.tariffcd);
     row.SetField("countryoforigin", entity.countryoforigin);
     row.SetField("vendretauth", entity.vendretauth);
     row.SetField("netbillty", entity.netbillty);
     row.SetField("upcid", entity.upcid);
     row.SetField("dlvrydatecd", entity.dlvrydatecd);
 }