コード例 #1
0
        public static Vanonstockresults BuildVanonstockresultsFromRow(DataRow row)
        {
            Vanonstockresults entity = new Vanonstockresults();

            entity.shipprod       = row.IsNull("shipprod") ? string.Empty : row.Field <string>("shipprod");
            entity.arpprodline    = row.IsNull("arpprodline") ? string.Empty : row.Field <string>("arpprodline");
            entity.arpvendno      = row.IsNull("arpvendno") ? decimal.Zero : row.Field <decimal>("arpvendno");
            entity.arpwhse        = row.IsNull("arpwhse") ? string.Empty : row.Field <string>("arpwhse");
            entity.cproddesc      = row.IsNull("cproddesc") ? string.Empty : row.Field <string>("cproddesc");
            entity.cprodnotes     = row.IsNull("cprodnotes") ? string.Empty : row.Field <string>("cprodnotes");
            entity.cubes          = row.IsNull("cubes") ? decimal.Zero : row.Field <decimal>("cubes");
            entity.prodcat        = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat");
            entity.prodcost       = row.IsNull("prodcost") ? decimal.Zero : row.Field <decimal>("prodcost");
            entity.prodcostdspl   = row.IsNull("prodcostdspl") ? string.Empty : row.Field <string>("prodcostdspl");
            entity.proddesc       = row.IsNull("proddesc") ? string.Empty : row.Field <string>("proddesc");
            entity.proddesc2      = row.IsNull("proddesc2") ? string.Empty : row.Field <string>("proddesc2");
            entity.rushfl         = row.Field <bool>("rushfl");
            entity.weight         = row.IsNull("weight") ? decimal.Zero : row.Field <decimal>("weight");
            entity.usesettingsfl  = row.Field <bool>("usesettingsfl");
            entity.nonstkmessage  = row.IsNull("nonstkmessage") ? string.Empty : row.Field <string>("nonstkmessage");
            entity.prcavlmessage  = row.IsNull("prcavlmessage") ? string.Empty : row.Field <string>("prcavlmessage");
            entity.warningmessage = row.IsNull("warningmessage") ? string.Empty : row.Field <string>("warningmessage");
            entity.userfield      = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
コード例 #2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromVanonstockresults(ref DataRow row, Vanonstockresults entity)
 {
     row.SetField("shipprod", entity.shipprod);
     row.SetField("arpprodline", entity.arpprodline);
     row.SetField("arpvendno", entity.arpvendno);
     row.SetField("arpwhse", entity.arpwhse);
     row.SetField("cproddesc", entity.cproddesc);
     row.SetField("cprodnotes", entity.cprodnotes);
     row.SetField("cubes", entity.cubes);
     row.SetField("prodcat", entity.prodcat);
     row.SetField("prodcost", entity.prodcost);
     row.SetField("prodcostdspl", entity.prodcostdspl);
     row.SetField("proddesc", entity.proddesc);
     row.SetField("proddesc2", entity.proddesc2);
     row.SetField("rushfl", entity.rushfl);
     row.SetField("weight", entity.weight);
     row.SetField("usesettingsfl", entity.usesettingsfl);
     row.SetField("nonstkmessage", entity.nonstkmessage);
     row.SetField("prcavlmessage", entity.prcavlmessage);
     row.SetField("warningmessage", entity.warningmessage);
     row.SetField("userfield", entity.userfield);
 }