Beispiel #1
0
        public static Kitsplit BuildKitsplitFromRow(DataRow row)
        {
            Kitsplit entity = new Kitsplit();

            entity.qtyord       = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord");
            entity.unit         = row.IsNull("unit") ? string.Empty : row.Field <string>("unit");
            entity.price        = row.IsNull("price") ? decimal.Zero : row.Field <decimal>("price");
            entity.priceorig    = row.IsNull("priceorig") ? decimal.Zero : row.Field <decimal>("priceorig");
            entity.netamt       = row.IsNull("netamt") ? decimal.Zero : row.Field <decimal>("netamt");
            entity.netamtorig   = row.IsNull("netamtorig") ? decimal.Zero : row.Field <decimal>("netamtorig");
            entity.boamt        = row.IsNull("boamt") ? decimal.Zero : row.Field <decimal>("boamt");
            entity.boamtorig    = row.IsNull("boamtorig") ? decimal.Zero : row.Field <decimal>("boamtorig");
            entity.bopct        = row.IsNull("bopct") ? decimal.Zero : row.Field <decimal>("bopct");
            entity.unitconv     = row.IsNull("unitconv") ? decimal.Zero : row.Field <decimal>("unitconv");
            entity.specnstype   = row.IsNull("specnstype") ? string.Empty : row.Field <string>("specnstype");
            entity.speccostty   = row.IsNull("speccostty") ? string.Empty : row.Field <string>("speccostty");
            entity.csunperstk   = row.IsNull("csunperstk") ? decimal.Zero : row.Field <decimal>("csunperstk");
            entity.priceconv    = row.IsNull("priceconv") ? decimal.Zero : row.Field <decimal>("priceconv");
            entity.qtyorddspl   = row.IsNull("qtyorddspl") ? decimal.Zero : row.Field <decimal>("qtyorddspl");
            entity.unitdspl     = row.IsNull("unitdspl") ? string.Empty : row.Field <string>("unitdspl");
            entity.pricedspl    = row.IsNull("pricedspl") ? decimal.Zero : row.Field <decimal>("pricedspl");
            entity.netamtdspl   = row.IsNull("netamtdspl") ? decimal.Zero : row.Field <decimal>("netamtdspl");
            entity.bopctdspl    = row.IsNull("bopctdspl") ? decimal.Zero : row.Field <decimal>("bopctdspl");
            entity.splitprcdspl = row.IsNull("splitprcdspl") ? decimal.Zero : row.Field <decimal>("splitprcdspl");
            entity.userfield    = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
Beispiel #2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromKitsplit(ref DataRow row, Kitsplit entity)
 {
     row.SetField("qtyord", entity.qtyord);
     row.SetField("unit", entity.unit);
     row.SetField("price", entity.price);
     row.SetField("priceorig", entity.priceorig);
     row.SetField("netamt", entity.netamt);
     row.SetField("netamtorig", entity.netamtorig);
     row.SetField("boamt", entity.boamt);
     row.SetField("boamtorig", entity.boamtorig);
     row.SetField("bopct", entity.bopct);
     row.SetField("unitconv", entity.unitconv);
     row.SetField("specnstype", entity.specnstype);
     row.SetField("speccostty", entity.speccostty);
     row.SetField("csunperstk", entity.csunperstk);
     row.SetField("priceconv", entity.priceconv);
     row.SetField("qtyorddspl", entity.qtyorddspl);
     row.SetField("unitdspl", entity.unitdspl);
     row.SetField("pricedspl", entity.pricedspl);
     row.SetField("netamtdspl", entity.netamtdspl);
     row.SetField("bopctdspl", entity.bopctdspl);
     row.SetField("splitprcdspl", entity.splitprcdspl);
     row.SetField("userfield", entity.userfield);
 }