Exemple #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromItemresv(ref DataRow row, Itemresv entity)
 {
     row.SetField("type", entity.type);
     row.SetField("key1", entity.key1);
     row.SetField("key2", entity.key2);
     row.SetField("key3", entity.key3);
     row.SetField("quantity", entity.quantity);
     row.SetField("order", entity.order);
     row.SetField("order_suffix", entity.orderSuffix);
     row.SetField("altwhse", entity.altwhse);
     row.SetField("name", entity.name);
     row.SetField("line", entity.line);
     row.SetField("line_sequence", entity.lineSequence);
     row.SetField("wave", entity.wave);
     row.SetField("lot", entity.lot);
     row.SetField("itemresvuserfield", entity.itemresvuserfield);
     row.SetField("userfield", entity.userfield);
 }
Exemple #2
0
        public static Itemresv BuildItemresvFromRow(DataRow row)
        {
            Itemresv entity = new Itemresv();

            entity.type              = row.IsNull("type") ? string.Empty : row.Field <string>("type");
            entity.key1              = row.IsNull("key1") ? 0 : row.Field <int>("key1");
            entity.key2              = row.IsNull("key2") ? 0 : row.Field <int>("key2");
            entity.key3              = row.IsNull("key3") ? 0 : row.Field <int>("key3");
            entity.quantity          = row.IsNull("quantity") ? decimal.Zero : row.Field <decimal>("quantity");
            entity.order             = row.IsNull("order") ? string.Empty : row.Field <string>("order");
            entity.orderSuffix       = row.IsNull("order_suffix") ? string.Empty : row.Field <string>("order_suffix");
            entity.altwhse           = row.IsNull("altwhse") ? string.Empty : row.Field <string>("altwhse");
            entity.name              = row.IsNull("name") ? string.Empty : row.Field <string>("name");
            entity.line              = row.IsNull("line") ? 0 : row.Field <int>("line");
            entity.lineSequence      = row.IsNull("line_sequence") ? 0 : row.Field <int>("line_sequence");
            entity.wave              = row.IsNull("wave") ? 0 : row.Field <int>("wave");
            entity.lot               = row.IsNull("lot") ? string.Empty : row.Field <string>("lot");
            entity.itemresvuserfield = row.IsNull("itemresvuserfield") ? string.Empty : row.Field <string>("itemresvuserfield");
            entity.userfield         = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }