Пример #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromLoadwtlinenonstockresults(ref DataRow row, Loadwtlinenonstockresults entity)
 {
     row.SetField("prod", entity.prod);
     row.SetField("proddesc1", entity.proddesc1);
     row.SetField("proddesc2", entity.proddesc2);
     row.SetField("prodcost", entity.prodcost);
     row.SetField("vendno", entity.vendno);
     row.SetField("vendname", entity.vendname);
     row.SetField("prodline", entity.prodline);
     row.SetField("prodlinedesc", entity.prodlinedesc);
     row.SetField("arpwhse", entity.arpwhse);
     row.SetField("arpwhsename", entity.arpwhsename);
     row.SetField("foreigncost", entity.foreigncost);
     row.SetField("exchgrate", entity.exchgrate);
     row.SetField("currencyty", entity.currencyty);
     row.SetField("shortdesc", entity.shortdesc);
     row.SetField("prodcato", entity.prodcato);
     row.SetField("prodcatodesc", entity.prodcatodesc);
     row.SetField("prodcati", entity.prodcati);
     row.SetField("prodcatidesc", entity.prodcatidesc);
 }
Пример #2
0
        public static Loadwtlinenonstockresults BuildLoadwtlinenonstockresultsFromRow(DataRow row)
        {
            Loadwtlinenonstockresults entity = new Loadwtlinenonstockresults();

            entity.prod         = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.proddesc1    = row.IsNull("proddesc1") ? string.Empty : row.Field <string>("proddesc1");
            entity.proddesc2    = row.IsNull("proddesc2") ? string.Empty : row.Field <string>("proddesc2");
            entity.prodcost     = row.IsNull("prodcost") ? decimal.Zero : row.Field <decimal>("prodcost");
            entity.vendno       = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno");
            entity.vendname     = row.IsNull("vendname") ? string.Empty : row.Field <string>("vendname");
            entity.prodline     = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline");
            entity.prodlinedesc = row.IsNull("prodlinedesc") ? string.Empty : row.Field <string>("prodlinedesc");
            entity.arpwhse      = row.IsNull("arpwhse") ? string.Empty : row.Field <string>("arpwhse");
            entity.arpwhsename  = row.IsNull("arpwhsename") ? string.Empty : row.Field <string>("arpwhsename");
            entity.foreigncost  = row.IsNull("foreigncost") ? decimal.Zero : row.Field <decimal>("foreigncost");
            entity.exchgrate    = row.IsNull("exchgrate") ? decimal.Zero : row.Field <decimal>("exchgrate");
            entity.currencyty   = row.IsNull("currencyty") ? string.Empty : row.Field <string>("currencyty");
            entity.shortdesc    = row.IsNull("shortdesc") ? string.Empty : row.Field <string>("shortdesc");
            entity.prodcato     = row.IsNull("prodcato") ? string.Empty : row.Field <string>("prodcato");
            entity.prodcatodesc = row.IsNull("prodcatodesc") ? string.Empty : row.Field <string>("prodcatodesc");
            entity.prodcati     = row.IsNull("prodcati") ? string.Empty : row.Field <string>("prodcati");
            entity.prodcatidesc = row.IsNull("prodcatidesc") ? string.Empty : row.Field <string>("prodcatidesc");
            return(entity);
        }