Exemple #1
0
        public static Apeemaint BuildApeemaintFromRow(DataRow row)
        {
            Apeemaint entity = new Apeemaint();

            entity.invoiceno       = row.IsNull("invoiceno") ? string.Empty : row.Field <string>("invoiceno");
            entity.schedulepayment = row.IsNull("schedulepayment") ? decimal.Zero : row.Field <decimal>("schedulepayment");
            entity.currencyty      = row.IsNull("currencyty") ? string.Empty : row.Field <string>("currencyty");
            entity.invoicedate     = row.Field <DateTime?>("invoicedate");
            entity.postdate        = row.Field <DateTime?>("postdate");
            entity.disputefl       = row.Field <bool>("disputefl");
            entity.invoicetype     = row.IsNull("invoicetype") ? string.Empty : row.Field <string>("invoicetype");
            entity.duedate         = row.Field <DateTime?>("duedate");
            entity.duedatedays     = row.IsNull("duedatedays") ? 0 : row.Field <int>("duedatedays");
            entity.discdate        = row.Field <DateTime?>("discdate");
            entity.discdatedays    = row.IsNull("discdatedays") ? 0 : row.Field <int>("discdatedays");
            entity.discountperc    = row.IsNull("discountperc") ? decimal.Zero : row.Field <decimal>("discountperc");
            entity.discountamount  = row.IsNull("discountamount") ? decimal.Zero : row.Field <decimal>("discountamount");
            entity.refer           = row.IsNull("refer") ? string.Empty : row.Field <string>("refer");
            entity.apetrowid       = row.Field <byte[]>("apetrowid").ToStringEncoded();
            entity.transcd         = row.IsNull("transcd") ? 0 : row.Field <int>("transcd");
            entity.jrnlno          = row.IsNull("jrnlno") ? 0 : row.Field <int>("jrnlno");
            entity.setno           = row.IsNull("setno") ? 0 : row.Field <int>("setno");
            entity.userfield       = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
Exemple #2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromApeemaint(ref DataRow row, Apeemaint entity)
 {
     row.SetField("invoiceno", entity.invoiceno);
     row.SetField("schedulepayment", entity.schedulepayment);
     row.SetField("currencyty", entity.currencyty);
     row.SetField("invoicedate", entity.invoicedate);
     row.SetField("postdate", entity.postdate);
     row.SetField("disputefl", entity.disputefl);
     row.SetField("invoicetype", entity.invoicetype);
     row.SetField("duedate", entity.duedate);
     row.SetField("duedatedays", entity.duedatedays);
     row.SetField("discdate", entity.discdate);
     row.SetField("discdatedays", entity.discdatedays);
     row.SetField("discountperc", entity.discountperc);
     row.SetField("discountamount", entity.discountamount);
     row.SetField("refer", entity.refer);
     row.SetField("apetrowid", entity.apetrowid.ToByteArray());
     row.SetField("transcd", entity.transcd);
     row.SetField("jrnlno", entity.jrnlno);
     row.SetField("setno", entity.setno);
     row.SetField("userfield", entity.userfield);
 }