Example #1
0
        public static Wtlinenonstock BuildWtlinenonstockFromRow(DataRow row)
        {
            Wtlinenonstock entity = new Wtlinenonstock();

            entity.prod                    = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.prodenabled             = row.Field <bool>("prodenabled");
            entity.proddesc1               = row.IsNull("proddesc1") ? string.Empty : row.Field <string>("proddesc1");
            entity.proddesc2               = row.IsNull("proddesc2") ? string.Empty : row.Field <string>("proddesc2");
            entity.proddescenabled         = row.Field <bool>("proddescenabled");
            entity.prodcost                = row.IsNull("prodcost") ? decimal.Zero : row.Field <decimal>("prodcost");
            entity.prodcostenabled         = row.Field <bool>("prodcostenabled");
            entity.vendno                  = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno");
            entity.vendnoenabled           = row.Field <bool>("vendnoenabled");
            entity.vendname                = row.IsNull("vendname") ? string.Empty : row.Field <string>("vendname");
            entity.prodline                = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline");
            entity.prodlineenabled         = row.Field <bool>("prodlineenabled");
            entity.arpwhse                 = row.IsNull("arpwhse") ? string.Empty : row.Field <string>("arpwhse");
            entity.arpwhseenabled          = row.Field <bool>("arpwhseenabled");
            entity.foreigncost             = row.IsNull("foreigncost") ? decimal.Zero : row.Field <decimal>("foreigncost");
            entity.foreigncosthidden       = row.Field <bool>("foreigncosthidden");
            entity.exchangerate            = row.IsNull("exchangerate") ? decimal.Zero : row.Field <decimal>("exchangerate");
            entity.exchangeratehidden      = row.Field <bool>("exchangeratehidden");
            entity.currencyty              = row.IsNull("currencyty") ? string.Empty : row.Field <string>("currencyty");
            entity.currencytyhidden        = row.Field <bool>("currencytyhidden");
            entity.currencytyshort         = row.IsNull("currencytyshort") ? string.Empty : row.Field <string>("currencytyshort");
            entity.currencytyshorthidden   = row.Field <bool>("currencytyshorthidden");
            entity.prodcato                = row.IsNull("prodcato") ? string.Empty : row.Field <string>("prodcato");
            entity.prodcatoenabled         = row.Field <bool>("prodcatoenabled");
            entity.prodcati                = row.IsNull("prodcati") ? string.Empty : row.Field <string>("prodcati");
            entity.prodcatienabled         = row.Field <bool>("prodcatienabled");
            entity.costcalculatebtnenabled = row.Field <bool>("costcalculatebtnenabled");
            entity.costcalculatebtnhidden  = row.Field <bool>("costcalculatebtnhidden");
            entity.nonstockty              = row.IsNull("nonstockty") ? string.Empty : row.Field <string>("nonstockty");
            entity.unit                    = row.IsNull("unit") ? string.Empty : row.Field <string>("unit");
            entity.quesanswer              = row.IsNull("quesanswer") ? string.Empty : row.Field <string>("quesanswer");
            entity.quesdescrip1            = row.IsNull("quesdescrip1") ? string.Empty : row.Field <string>("quesdescrip1");
            entity.quesdescrip2            = row.IsNull("quesdescrip2") ? string.Empty : row.Field <string>("quesdescrip2");
            entity.quespriceavail          = row.IsNull("quespriceavail") ? string.Empty : row.Field <string>("quespriceavail");
            entity.quesprodcat             = row.IsNull("quesprodcat") ? string.Empty : row.Field <string>("quesprodcat");
            entity.quesmessage             = row.IsNull("quesmessage") ? string.Empty : row.Field <string>("quesmessage");
            entity.quesoantext             = row.IsNull("quesoantext") ? string.Empty : row.Field <string>("quesoantext");
            entity.quesoananswer           = row.Field <bool>("quesoananswer");
            entity.userfield               = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
Example #2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromWtlinenonstock(ref DataRow row, Wtlinenonstock entity)
 {
     row.SetField("prod", entity.prod);
     row.SetField("prodenabled", entity.prodenabled);
     row.SetField("proddesc1", entity.proddesc1);
     row.SetField("proddesc2", entity.proddesc2);
     row.SetField("proddescenabled", entity.proddescenabled);
     row.SetField("prodcost", entity.prodcost);
     row.SetField("prodcostenabled", entity.prodcostenabled);
     row.SetField("vendno", entity.vendno);
     row.SetField("vendnoenabled", entity.vendnoenabled);
     row.SetField("vendname", entity.vendname);
     row.SetField("prodline", entity.prodline);
     row.SetField("prodlineenabled", entity.prodlineenabled);
     row.SetField("arpwhse", entity.arpwhse);
     row.SetField("arpwhseenabled", entity.arpwhseenabled);
     row.SetField("foreigncost", entity.foreigncost);
     row.SetField("foreigncosthidden", entity.foreigncosthidden);
     row.SetField("exchangerate", entity.exchangerate);
     row.SetField("exchangeratehidden", entity.exchangeratehidden);
     row.SetField("currencyty", entity.currencyty);
     row.SetField("currencytyhidden", entity.currencytyhidden);
     row.SetField("currencytyshort", entity.currencytyshort);
     row.SetField("currencytyshorthidden", entity.currencytyshorthidden);
     row.SetField("prodcato", entity.prodcato);
     row.SetField("prodcatoenabled", entity.prodcatoenabled);
     row.SetField("prodcati", entity.prodcati);
     row.SetField("prodcatienabled", entity.prodcatienabled);
     row.SetField("costcalculatebtnenabled", entity.costcalculatebtnenabled);
     row.SetField("costcalculatebtnhidden", entity.costcalculatebtnhidden);
     row.SetField("nonstockty", entity.nonstockty);
     row.SetField("unit", entity.unit);
     row.SetField("quesanswer", entity.quesanswer);
     row.SetField("quesdescrip1", entity.quesdescrip1);
     row.SetField("quesdescrip2", entity.quesdescrip2);
     row.SetField("quespriceavail", entity.quespriceavail);
     row.SetField("quesprodcat", entity.quesprodcat);
     row.SetField("quesmessage", entity.quesmessage);
     row.SetField("quesoantext", entity.quesoantext);
     row.SetField("quesoananswer", entity.quesoananswer);
     row.SetField("userfield", entity.userfield);
 }