示例#1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromLoadserialshistttresults(ref DataRow row, Loadserialshistttresults entity)
 {
     row.SetField("postdt", entity.postdt);
     row.SetField("ordertypedspl", entity.ordertypedspl);
     row.SetField("ordernodspl", entity.ordernodspl);
     row.SetField("lineno", entity.lineno);
     row.SetField("custvendwhse", entity.custvendwhse);
     row.SetField("reasunavty", entity.reasunavty);
     row.SetField("returnfl", entity.returnfl);
     row.SetField("prodcost", entity.prodcost);
     row.SetField("price", entity.price);
     row.SetField("userfield", entity.userfield);
 }
示例#2
0
        public static Loadserialshistttresults BuildLoadserialshistttresultsFromRow(DataRow row)
        {
            Loadserialshistttresults entity = new Loadserialshistttresults();

            entity.postdt        = row.Field <DateTime?>("postdt");
            entity.ordertypedspl = row.IsNull("ordertypedspl") ? string.Empty : row.Field <string>("ordertypedspl");
            entity.ordernodspl   = row.IsNull("ordernodspl") ? string.Empty : row.Field <string>("ordernodspl");
            entity.lineno        = row.IsNull("lineno") ? 0 : row.Field <int>("lineno");
            entity.custvendwhse  = row.IsNull("custvendwhse") ? string.Empty : row.Field <string>("custvendwhse");
            entity.reasunavty    = row.IsNull("reasunavty") ? string.Empty : row.Field <string>("reasunavty");
            entity.returnfl      = row.Field <bool>("returnfl");
            entity.prodcost      = row.IsNull("prodcost") ? decimal.Zero : row.Field <decimal>("prodcost");
            entity.price         = row.IsNull("price") ? decimal.Zero : row.Field <decimal>("price");
            entity.userfield     = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }