Пример #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromWtitbuildwtlnhdrresults(ref DataRow row, Wtitbuildwtlnhdrresults entity)
 {
     row.SetField("wtno", entity.wtno);
     row.SetField("wtsuf", entity.wtsuf);
     row.SetField("notesfl", entity.notesfl);
     row.SetField("transtype", entity.transtype);
     row.SetField("stagename", entity.stagename);
     row.SetField("trackerno", entity.trackerno);
     row.SetField("pkgno", entity.pkgno);
     row.SetField("stagecd", entity.stagecd);
     row.SetField("shipfmwhse", entity.shipfmwhse);
     row.SetField("shipfmwhsename", entity.shipfmwhsename);
     row.SetField("shiptowhse", entity.shiptowhse);
     row.SetField("shiptowhsename", entity.shiptowhsename);
     row.SetField("shiptonm", entity.shiptonm);
     row.SetField("enterdt", entity.enterdt);
     row.SetField("orderdt", entity.orderdt);
     row.SetField("duedt", entity.duedt);
     row.SetField("reqshipdt", entity.reqshipdt);
     row.SetField("shipdt", entity.shipdt);
     row.SetField("receiptdt", entity.receiptdt);
     row.SetField("totlineamt", entity.totlineamt);
     row.SetField("cono", entity.cono);
     row.SetField("cono2", entity.cono2);
     row.SetField("rowid-wteh", entity.rowidWteh.ToByteArray());
 }
Пример #2
0
        public static Wtitbuildwtlnhdrresults BuildWtitbuildwtlnhdrresultsFromRow(DataRow row)
        {
            Wtitbuildwtlnhdrresults entity = new Wtitbuildwtlnhdrresults();

            entity.wtno           = row.IsNull("wtno") ? 0 : row.Field <int>("wtno");
            entity.wtsuf          = row.IsNull("wtsuf") ? 0 : row.Field <int>("wtsuf");
            entity.notesfl        = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl");
            entity.transtype      = row.IsNull("transtype") ? string.Empty : row.Field <string>("transtype");
            entity.stagename      = row.IsNull("stagename") ? string.Empty : row.Field <string>("stagename");
            entity.trackerno      = row.IsNull("trackerno") ? string.Empty : row.Field <string>("trackerno");
            entity.pkgno          = row.IsNull("pkgno") ? 0 : row.Field <int>("pkgno");
            entity.stagecd        = row.IsNull("stagecd") ? 0 : row.Field <int>("stagecd");
            entity.shipfmwhse     = row.IsNull("shipfmwhse") ? string.Empty : row.Field <string>("shipfmwhse");
            entity.shipfmwhsename = row.IsNull("shipfmwhsename") ? string.Empty : row.Field <string>("shipfmwhsename");
            entity.shiptowhse     = row.IsNull("shiptowhse") ? string.Empty : row.Field <string>("shiptowhse");
            entity.shiptowhsename = row.IsNull("shiptowhsename") ? string.Empty : row.Field <string>("shiptowhsename");
            entity.shiptonm       = row.IsNull("shiptonm") ? string.Empty : row.Field <string>("shiptonm");
            entity.enterdt        = row.Field <DateTime?>("enterdt");
            entity.orderdt        = row.Field <DateTime?>("orderdt");
            entity.duedt          = row.Field <DateTime?>("duedt");
            entity.reqshipdt      = row.Field <DateTime?>("reqshipdt");
            entity.shipdt         = row.Field <DateTime?>("shipdt");
            entity.receiptdt      = row.Field <DateTime?>("receiptdt");
            entity.totlineamt     = row.IsNull("totlineamt") ? decimal.Zero : row.Field <decimal>("totlineamt");
            entity.cono           = row.IsNull("cono") ? 0 : row.Field <int>("cono");
            entity.cono2          = row.IsNull("cono2") ? 0 : row.Field <int>("cono2");
            entity.rowidWteh      = row.Field <byte[]>("rowid-wteh").ToStringEncoded();
            foreach (var dRow in row.GetChildRows("C_Lines"))
            {
                Wtitbuildwtlnlistresults wtitbuildwtlnlistresults = new Wtitbuildwtlnlistresults();
                wtitbuildwtlnlistresults = (Wtitbuildwtlnlistresults)SetKeyFields(entity, Wtitbuildwtlnlistresults.BuildWtitbuildwtlnlistresultsFromRow(dRow), "wtno,wtsuf", "wtno,wtsuf");
                entity.wtitbuildwtlnlistresults.Add(wtitbuildwtlnlistresults);
            }
            return(entity);
        }