Ejemplo n.º 1
0
        public static Artransdetailresults BuildArtransdetailresultsFromRow(DataRow row)
        {
            Artransdetailresults entity = new Artransdetailresults();

            entity.invno           = row.IsNull("invno") ? 0 : row.Field <int>("invno");
            entity.invsuf          = row.IsNull("invsuf") ? 0 : row.Field <int>("invsuf");
            entity.amount          = row.IsNull("amount") ? decimal.Zero : row.Field <decimal>("amount");
            entity.origdisc        = row.IsNull("origdisc") ? decimal.Zero : row.Field <decimal>("origdisc");
            entity.amountdue       = row.IsNull("amountdue") ? decimal.Zero : row.Field <decimal>("amountdue");
            entity.paymtamt        = row.IsNull("paymtamt") ? decimal.Zero : row.Field <decimal>("paymtamt");
            entity.discamt         = row.IsNull("discamt") ? decimal.Zero : row.Field <decimal>("discamt");
            entity.writeofftaken   = row.IsNull("writeofftaken") ? decimal.Zero : row.Field <decimal>("writeofftaken");
            entity.invdt           = row.Field <DateTime?>("invdt");
            entity.postdt          = row.Field <DateTime?>("postdt");
            entity.discdt          = row.Field <DateTime?>("discdt");
            entity.duedt           = row.Field <DateTime?>("duedt");
            entity.paymtdt         = row.Field <DateTime?>("paymtdt");
            entity.paymentcode     = row.IsNull("paymentcode") ? string.Empty : row.Field <string>("paymentcode");
            entity.checknopaid     = row.IsNull("checknopaid") ? decimal.Zero : row.Field <decimal>("checknopaid");
            entity.checkno         = row.IsNull("checkno") ? decimal.Zero : row.Field <decimal>("checkno");
            entity.custpono        = row.IsNull("custpono") ? string.Empty : row.Field <string>("custpono");
            entity.refer           = row.IsNull("refer") ? string.Empty : row.Field <string>("refer");
            entity.shipto          = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto");
            entity.lastupdatedata  = row.IsNull("lastupdatedata") ? string.Empty : row.Field <string>("lastupdatedata");
            entity.jrnlno          = row.IsNull("jrnlno") ? 0 : row.Field <int>("jrnlno");
            entity.setno           = row.IsNull("setno") ? 0 : row.Field <int>("setno");
            entity.seqno           = row.IsNull("seqno") ? 0 : row.Field <int>("seqno");
            entity.disputefl       = row.Field <bool>("disputefl");
            entity.divno           = row.IsNull("divno") ? 0 : row.Field <int>("divno");
            entity.divnodesc       = row.IsNull("divnodesc") ? string.Empty : row.Field <string>("divnodesc");
            entity.appliedonjrnlno = row.IsNull("appliedonjrnlno") ? 0 : row.Field <int>("appliedonjrnlno");
            entity.user1           = row.IsNull("user1") ? string.Empty : row.Field <string>("user1");
            entity.user2           = row.IsNull("user2") ? string.Empty : row.Field <string>("user2");
            entity.user3           = row.IsNull("user3") ? string.Empty : row.Field <string>("user3");
            entity.user4           = row.IsNull("user4") ? string.Empty : row.Field <string>("user4");
            entity.user5           = row.IsNull("user5") ? string.Empty : row.Field <string>("user5");
            entity.user6           = row.Field <decimal?>("user6");
            entity.user7           = row.Field <decimal?>("user7");
            entity.user8           = row.Field <DateTime?>("user8");
            entity.user9           = row.Field <DateTime?>("user9");
            entity.userfield       = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromArtransdetailresults(ref DataRow row, Artransdetailresults entity)
 {
     row.SetField("invno", entity.invno);
     row.SetField("invsuf", entity.invsuf);
     row.SetField("amount", entity.amount);
     row.SetField("origdisc", entity.origdisc);
     row.SetField("amountdue", entity.amountdue);
     row.SetField("paymtamt", entity.paymtamt);
     row.SetField("discamt", entity.discamt);
     row.SetField("writeofftaken", entity.writeofftaken);
     row.SetField("invdt", entity.invdt);
     row.SetField("postdt", entity.postdt);
     row.SetField("discdt", entity.discdt);
     row.SetField("duedt", entity.duedt);
     row.SetField("paymtdt", entity.paymtdt);
     row.SetField("paymentcode", entity.paymentcode);
     row.SetField("checknopaid", entity.checknopaid);
     row.SetField("checkno", entity.checkno);
     row.SetField("custpono", entity.custpono);
     row.SetField("refer", entity.refer);
     row.SetField("shipto", entity.shipto);
     row.SetField("lastupdatedata", entity.lastupdatedata);
     row.SetField("jrnlno", entity.jrnlno);
     row.SetField("setno", entity.setno);
     row.SetField("seqno", entity.seqno);
     row.SetField("disputefl", entity.disputefl);
     row.SetField("divno", entity.divno);
     row.SetField("divnodesc", entity.divnodesc);
     row.SetField("appliedonjrnlno", entity.appliedonjrnlno);
     row.SetField("user1", entity.user1);
     row.SetField("user2", entity.user2);
     row.SetField("user3", entity.user3);
     row.SetField("user4", entity.user4);
     row.SetField("user5", entity.user5);
     row.SetField("user6", entity.user6);
     row.SetField("user7", entity.user7);
     row.SetField("user8", entity.user8);
     row.SetField("user9", entity.user9);
     row.SetField("userfield", entity.userfield);
 }