Exemple #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromOtittrackline(ref DataRow row, Otittrackline entity)
 {
     row.SetField("trackno", entity.trackno);
     row.SetField("lineno", entity.lineno);
     row.SetField("comment", entity.comment);
     row.SetField("vendno", entity.vendno);
     row.SetField("vendnotes", entity.vendnotes);
     row.SetField("vendname", entity.vendname);
     row.SetField("pono", entity.pono);
     row.SetField("posuf", entity.posuf);
     row.SetField("polineno", entity.polineno);
     row.SetField("pocomment", entity.pocomment);
     row.SetField("shipprod", entity.shipprod);
     row.SetField("prodnotes", entity.prodnotes);
     row.SetField("proddesc", entity.proddesc);
     row.SetField("qtyord", entity.qtyord);
     row.SetField("unit", entity.unit);
     row.SetField("stkqtyord", entity.stkqtyord);
     row.SetField("cubes", entity.cubes);
     row.SetField("weight", entity.weight);
     row.SetField("duedt", entity.duedt);
     row.SetField("expshipdt", entity.expshipdt);
     row.SetField("reqshipdt", entity.reqshipdt);
     row.SetField("userfield", entity.userfield);
 }
Exemple #2
0
        public static Otittrackline BuildOtittracklineFromRow(DataRow row)
        {
            Otittrackline entity = new Otittrackline();

            entity.trackno   = row.IsNull("trackno") ? 0 : row.Field <int>("trackno");
            entity.lineno    = row.IsNull("lineno") ? 0 : row.Field <int>("lineno");
            entity.comment   = row.IsNull("comment") ? string.Empty : row.Field <string>("comment");
            entity.vendno    = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno");
            entity.vendnotes = row.IsNull("vendnotes") ? string.Empty : row.Field <string>("vendnotes");
            entity.vendname  = row.IsNull("vendname") ? string.Empty : row.Field <string>("vendname");
            entity.pono      = row.IsNull("pono") ? 0 : row.Field <int>("pono");
            entity.posuf     = row.IsNull("posuf") ? 0 : row.Field <int>("posuf");
            entity.polineno  = row.IsNull("polineno") ? 0 : row.Field <int>("polineno");
            entity.pocomment = row.IsNull("pocomment") ? string.Empty : row.Field <string>("pocomment");
            entity.shipprod  = row.IsNull("shipprod") ? string.Empty : row.Field <string>("shipprod");
            entity.prodnotes = row.IsNull("prodnotes") ? string.Empty : row.Field <string>("prodnotes");
            entity.proddesc  = row.IsNull("proddesc") ? string.Empty : row.Field <string>("proddesc");
            entity.qtyord    = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord");
            entity.unit      = row.IsNull("unit") ? string.Empty : row.Field <string>("unit");
            entity.stkqtyord = row.IsNull("stkqtyord") ? decimal.Zero : row.Field <decimal>("stkqtyord");
            entity.cubes     = row.IsNull("cubes") ? decimal.Zero : row.Field <decimal>("cubes");
            entity.weight    = row.IsNull("weight") ? decimal.Zero : row.Field <decimal>("weight");
            entity.duedt     = row.Field <DateTime?>("duedt");
            entity.expshipdt = row.Field <DateTime?>("expshipdt");
            entity.reqshipdt = row.Field <DateTime?>("reqshipdt");
            entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }