Ejemplo n.º 1
0
        public static Icsecretrieveresults BuildIcsecretrieveresultsFromRow(DataRow row)
        {
            Icsecretrieveresults entity = new Icsecretrieveresults();

            entity.addprtinfo      = row.IsNull("addprtinfo") ? string.Empty : row.Field <string>("addprtinfo");
            entity.altprod         = row.IsNull("altprod") ? string.Empty : row.Field <string>("altprod");
            entity.custglacctno    = row.IsNull("custglacctno") ? string.Empty : row.Field <string>("custglacctno");
            entity.custno          = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno");
            entity.extprod         = row.IsNull("extprod") ? string.Empty : row.Field <string>("extprod");
            entity.extproddescrip1 = row.IsNull("extproddescrip1") ? string.Empty : row.Field <string>("extproddescrip1");
            entity.extproddescrip2 = row.IsNull("extproddescrip2") ? string.Empty : row.Field <string>("extproddescrip2");
            entity.keyno           = row.IsNull("keyno") ? decimal.Zero : row.Field <decimal>("keyno");
            entity.operinit        = row.IsNull("operinit") ? string.Empty : row.Field <string>("operinit");
            entity.orderqty        = row.IsNull("orderqty") ? decimal.Zero : row.Field <decimal>("orderqty");
            entity.price           = row.IsNull("price") ? decimal.Zero : row.Field <decimal>("price");
            entity.prod            = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.rectype         = row.IsNull("rectype") ? string.Empty : row.Field <string>("rectype");
            entity.shipto          = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto");
            entity.sellfirsttype   = row.IsNull("sellfirsttype") ? string.Empty : row.Field <string>("sellfirsttype");
            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.icsecRowID      = row.Field <byte[]>("icsecRowID").ToStringEncoded();
            entity.userfield       = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromIcsecretrieveresults(ref DataRow row, Icsecretrieveresults entity)
 {
     row.SetField("addprtinfo", entity.addprtinfo);
     row.SetField("altprod", entity.altprod);
     row.SetField("custglacctno", entity.custglacctno);
     row.SetField("custno", entity.custno);
     row.SetField("extprod", entity.extprod);
     row.SetField("extproddescrip1", entity.extproddescrip1);
     row.SetField("extproddescrip2", entity.extproddescrip2);
     row.SetField("keyno", entity.keyno);
     row.SetField("operinit", entity.operinit);
     row.SetField("orderqty", entity.orderqty);
     row.SetField("price", entity.price);
     row.SetField("prod", entity.prod);
     row.SetField("rectype", entity.rectype);
     row.SetField("shipto", entity.shipto);
     row.SetField("sellfirsttype", entity.sellfirsttype);
     row.SetField("unitbuy", entity.unitbuy);
     row.SetField("unitsell", entity.unitsell);
     row.SetField("unitstnd", entity.unitstnd);
     row.SetField("icsecRowID", entity.icsecRowID.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }