Example #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromValaborline(ref DataRow row, Valaborline entity)
 {
     row.SetField("whse", entity.whse);
     row.SetField("vano", entity.vano);
     row.SetField("vasuf", entity.vasuf);
     row.SetField("seqno", entity.seqno);
     row.SetField("lineno", entity.lineno);
     row.SetField("sctntype", entity.sctntype);
     row.SetField("sctncode", entity.sctncode);
     row.SetField("stagecddesc", entity.stagecddesc);
     row.SetField("shipprod", entity.shipprod);
     row.SetField("nonstockty", entity.nonstockty);
     row.SetField("unitconv", entity.unitconv);
     row.SetField("proddesc", entity.proddesc);
     row.SetField("timeslsrep", entity.timeslsrep);
     row.SetField("timeslsrepnamedisp", entity.timeslsrepnamedisp);
     row.SetField("hours", entity.hours);
     row.SetField("minutes", entity.minutes);
     row.SetField("timeworkdt", entity.timeworkdt);
     row.SetField("timecomment", entity.timecomment);
     row.SetField("vaehnotesfl", entity.vaehnotesfl);
     row.SetField("icspnotesfl", entity.icspnotesfl);
     row.SetField("prodcost", entity.prodcost);
     row.SetField("prodcostdefault", entity.prodcostdefault);
     row.SetField("netamt", entity.netamt);
     row.SetField("seecostfl", entity.seecostfl);
     row.SetField("prodcostdspl", entity.prodcostdspl);
     row.SetField("netamtdspl", entity.netamtdspl);
     row.SetField("getnewprodcostfl", entity.getnewprodcostfl);
     row.SetField("vaeslrowid", entity.vaeslrowid.ToByteArray());
 }
Example #2
0
        public static Valaborline BuildValaborlineFromRow(DataRow row)
        {
            Valaborline entity = new Valaborline();

            entity.whse               = row.IsNull("whse") ? string.Empty : row.Field <string>("whse");
            entity.vano               = row.IsNull("vano") ? 0 : row.Field <int>("vano");
            entity.vasuf              = row.IsNull("vasuf") ? 0 : row.Field <int>("vasuf");
            entity.seqno              = row.IsNull("seqno") ? 0 : row.Field <int>("seqno");
            entity.lineno             = row.IsNull("lineno") ? 0 : row.Field <int>("lineno");
            entity.sctntype           = row.IsNull("sctntype") ? string.Empty : row.Field <string>("sctntype");
            entity.sctncode           = row.IsNull("sctncode") ? string.Empty : row.Field <string>("sctncode");
            entity.stagecddesc        = row.IsNull("stagecddesc") ? string.Empty : row.Field <string>("stagecddesc");
            entity.shipprod           = row.IsNull("shipprod") ? string.Empty : row.Field <string>("shipprod");
            entity.nonstockty         = row.IsNull("nonstockty") ? string.Empty : row.Field <string>("nonstockty");
            entity.unitconv           = row.IsNull("unitconv") ? decimal.Zero : row.Field <decimal>("unitconv");
            entity.proddesc           = row.IsNull("proddesc") ? string.Empty : row.Field <string>("proddesc");
            entity.timeslsrep         = row.IsNull("timeslsrep") ? string.Empty : row.Field <string>("timeslsrep");
            entity.timeslsrepnamedisp = row.IsNull("timeslsrepnamedisp") ? string.Empty : row.Field <string>("timeslsrepnamedisp");
            entity.hours              = row.IsNull("hours") ? 0 : row.Field <int>("hours");
            entity.minutes            = row.IsNull("minutes") ? 0 : row.Field <int>("minutes");
            entity.timeworkdt         = row.Field <DateTime?>("timeworkdt");
            entity.timecomment        = row.IsNull("timecomment") ? string.Empty : row.Field <string>("timecomment");
            entity.vaehnotesfl        = row.IsNull("vaehnotesfl") ? string.Empty : row.Field <string>("vaehnotesfl");
            entity.icspnotesfl        = row.IsNull("icspnotesfl") ? string.Empty : row.Field <string>("icspnotesfl");
            entity.prodcost           = row.IsNull("prodcost") ? decimal.Zero : row.Field <decimal>("prodcost");
            entity.prodcostdefault    = row.IsNull("prodcostdefault") ? decimal.Zero : row.Field <decimal>("prodcostdefault");
            entity.netamt             = row.IsNull("netamt") ? decimal.Zero : row.Field <decimal>("netamt");
            entity.seecostfl          = row.Field <bool>("seecostfl");
            entity.prodcostdspl       = row.IsNull("prodcostdspl") ? string.Empty : row.Field <string>("prodcostdspl");
            entity.netamtdspl         = row.IsNull("netamtdspl") ? string.Empty : row.Field <string>("netamtdspl");
            entity.getnewprodcostfl   = row.Field <bool>("getnewprodcostfl");
            entity.vaeslrowid         = row.Field <byte[]>("vaeslrowid").ToStringEncoded();
            return(entity);
        }