Exemple #1
0
        public static Porrarreptaddnew BuildPorrarreptaddnewFromRow(DataRow row)
        {
            Porrarreptaddnew entity = new Porrarreptaddnew();

            entity.buyer       = row.IsNull("buyer") ? string.Empty : row.Field <string>("buyer");
            entity.vendno      = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno");
            entity.whse        = row.IsNull("whse") ? string.Empty : row.Field <string>("whse");
            entity.prodline    = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline");
            entity.newreportno = row.IsNull("newreportno") ? 0 : row.Field <int>("newreportno");
            entity.consty      = row.IsNull("consty") ? string.Empty : row.Field <string>("consty");
            entity.lookupnm    = row.IsNull("lookupnm") ? string.Empty : row.Field <string>("lookupnm");
            entity.pcttarget   = row.IsNull("pcttarget") ? 0 : row.Field <int>("pcttarget");
            entity.totlineamtd = row.IsNull("totlineamtd") ? decimal.Zero : row.Field <decimal>("totlineamtd");
            entity.totcubesd   = row.IsNull("totcubesd") ? decimal.Zero : row.Field <decimal>("totcubesd");
            entity.totweightd  = row.IsNull("totweightd") ? decimal.Zero : row.Field <decimal>("totweightd");
            entity.totqtyordd  = row.IsNull("totqtyordd") ? decimal.Zero : row.Field <decimal>("totqtyordd");
            entity.totlineamti = row.IsNull("totlineamti") ? 0 : row.Field <int>("totlineamti");
            entity.totcubesi   = row.IsNull("totcubesi") ? 0 : row.Field <int>("totcubesi");
            entity.totweighti  = row.IsNull("totweighti") ? 0 : row.Field <int>("totweighti");
            entity.totqtyordi  = row.IsNull("totqtyordi") ? 0 : row.Field <int>("totqtyordi");
            entity.revcyclin   = row.IsNull("revcyclin") ? 0 : row.Field <int>("revcyclin");
            entity.lastpowtdt  = row.Field <DateTime?>("lastpowtdt");
            entity.rowidPoerah = row.Field <byte[]>("rowid-poerah").ToStringEncoded();
            return(entity);
        }
Exemple #2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromPorrarreptaddnew(ref DataRow row, Porrarreptaddnew entity)
 {
     row.SetField("buyer", entity.buyer);
     row.SetField("vendno", entity.vendno);
     row.SetField("whse", entity.whse);
     row.SetField("prodline", entity.prodline);
     row.SetField("newreportno", entity.newreportno);
     row.SetField("consty", entity.consty);
     row.SetField("lookupnm", entity.lookupnm);
     row.SetField("pcttarget", entity.pcttarget);
     row.SetField("totlineamtd", entity.totlineamtd);
     row.SetField("totcubesd", entity.totcubesd);
     row.SetField("totweightd", entity.totweightd);
     row.SetField("totqtyordd", entity.totqtyordd);
     row.SetField("totlineamti", entity.totlineamti);
     row.SetField("totcubesi", entity.totcubesi);
     row.SetField("totweighti", entity.totweighti);
     row.SetField("totqtyordi", entity.totqtyordi);
     row.SetField("revcyclin", entity.revcyclin);
     row.SetField("lastpowtdt", entity.lastpowtdt);
     row.SetField("rowid-poerah", entity.rowidPoerah.ToByteArray());
 }