コード例 #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromLoadcrossrefttresults(ref DataRow row, Loadcrossrefttresults entity)
 {
     row.SetField("altprod", entity.altprod);
     row.SetField("prod", entity.prod);
     row.SetField("extprod", entity.extprod);
     row.SetField("rectype", entity.rectype);
     row.SetField("custno", entity.custno);
     row.SetField("shipto", entity.shipto);
     row.SetField("keyno", entity.keyno);
     row.SetField("unitbuy", entity.unitbuy);
     row.SetField("unitsell", entity.unitsell);
     row.SetField("unitstnd", entity.unitstnd);
     row.SetField("lastchgdt", entity.lastchgdt);
     row.SetField("leadtm", entity.leadtm);
     row.SetField("price", entity.price);
     row.SetField("orderqty", entity.orderqty);
     row.SetField("icsec_rowid", entity.icsecRowid.ToByteArray());
     row.SetField("proddspl", entity.proddspl);
     row.SetField("rectypedspl", entity.rectypedspl);
     row.SetField("altproddspl", entity.altproddspl);
     row.SetField("prodnotes", entity.prodnotes);
     row.SetField("proddesc", entity.proddesc);
     row.SetField("proddescrip3", entity.proddescrip3);
     row.SetField("custnodspl", entity.custnodspl);
     row.SetField("custnotes", entity.custnotes);
     row.SetField("custname", entity.custname);
     row.SetField("vendname", entity.vendname);
     row.SetField("shiptonotes", entity.shiptonotes);
     row.SetField("shiptoname", entity.shiptoname);
     row.SetField("keynodspl", entity.keynodspl);
     row.SetField("qtyavail", entity.qtyavail);
     row.SetField("vendno", entity.vendno);
     row.SetField("userfield", entity.userfield);
 }
コード例 #2
0
        public static Loadcrossrefttresults BuildLoadcrossrefttresultsFromRow(DataRow row)
        {
            Loadcrossrefttresults entity = new Loadcrossrefttresults();

            entity.altprod      = row.IsNull("altprod") ? string.Empty : row.Field <string>("altprod");
            entity.prod         = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.extprod      = row.IsNull("extprod") ? string.Empty : row.Field <string>("extprod");
            entity.rectype      = row.IsNull("rectype") ? string.Empty : row.Field <string>("rectype");
            entity.custno       = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno");
            entity.shipto       = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto");
            entity.keyno        = row.IsNull("keyno") ? decimal.Zero : row.Field <decimal>("keyno");
            entity.unitbuy      = row.IsNull("unitbuy") ? string.Empty : row.Field <string>("unitbuy");
            entity.unitsell     = row.IsNull("unitsell") ? string.Empty : row.Field <string>("unitsell");
            entity.unitstnd     = row.IsNull("unitstnd") ? string.Empty : row.Field <string>("unitstnd");
            entity.lastchgdt    = row.Field <DateTime?>("lastchgdt");
            entity.leadtm       = row.IsNull("leadtm") ? 0 : row.Field <int>("leadtm");
            entity.price        = row.IsNull("price") ? decimal.Zero : row.Field <decimal>("price");
            entity.orderqty     = row.IsNull("orderqty") ? decimal.Zero : row.Field <decimal>("orderqty");
            entity.icsecRowid   = row.Field <byte[]>("icsec_rowid").ToStringEncoded();
            entity.proddspl     = row.IsNull("proddspl") ? string.Empty : row.Field <string>("proddspl");
            entity.rectypedspl  = row.IsNull("rectypedspl") ? string.Empty : row.Field <string>("rectypedspl");
            entity.altproddspl  = row.IsNull("altproddspl") ? string.Empty : row.Field <string>("altproddspl");
            entity.prodnotes    = row.IsNull("prodnotes") ? string.Empty : row.Field <string>("prodnotes");
            entity.proddesc     = row.IsNull("proddesc") ? string.Empty : row.Field <string>("proddesc");
            entity.proddescrip3 = row.IsNull("proddescrip3") ? string.Empty : row.Field <string>("proddescrip3");
            entity.custnodspl   = row.IsNull("custnodspl") ? decimal.Zero : row.Field <decimal>("custnodspl");
            entity.custnotes    = row.IsNull("custnotes") ? string.Empty : row.Field <string>("custnotes");
            entity.custname     = row.IsNull("custname") ? string.Empty : row.Field <string>("custname");
            entity.vendname     = row.IsNull("vendname") ? string.Empty : row.Field <string>("vendname");
            entity.shiptonotes  = row.IsNull("shiptonotes") ? string.Empty : row.Field <string>("shiptonotes");
            entity.shiptoname   = row.IsNull("shiptoname") ? string.Empty : row.Field <string>("shiptoname");
            entity.keynodspl    = row.IsNull("keynodspl") ? decimal.Zero : row.Field <decimal>("keynodspl");
            entity.qtyavail     = row.IsNull("qtyavail") ? string.Empty : row.Field <string>("qtyavail");
            entity.vendno       = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno");
            entity.userfield    = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }