コード例 #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromPdsaloadresults(ref DataRow row, Pdsaloadresults entity)
 {
     row.SetField("autotype", entity.autotype);
     row.SetField("vendno", entity.vendno);
     row.SetField("prodline", entity.prodline);
     row.SetField("notesfl", entity.notesfl);
     row.SetField("prodcat", entity.prodcat);
     row.SetField("priceonty", entity.priceonty);
     row.SetField("priceontydesc", entity.priceontydesc);
     row.SetField("pricetype", entity.pricetype);
     row.SetField("pricety", entity.pricety);
     row.SetField("pricetydesc", entity.pricetydesc);
     row.SetField("basefactor", entity.basefactor);
     row.SetField("listty", entity.listty);
     row.SetField("listtydesc", entity.listtydesc);
     row.SetField("listfactor", entity.listfactor);
     row.SetField("stndty", entity.stndty);
     row.SetField("stndtydesc", entity.stndtydesc);
     row.SetField("costty", entity.costty);
     row.SetField("costtydesc", entity.costtydesc);
     row.SetField("prodprefix", entity.prodprefix);
     row.SetField("addtype", entity.addtype);
     row.SetField("addtypedesc", entity.addtypedesc);
     row.SetField("decimalfl", entity.decimalfl);
     row.SetField("pdcreatefl", entity.pdcreatefl);
     row.SetField("xrefprodfl", entity.xrefprodfl);
     row.SetField("pdsarowid", entity.pdsarowid.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }
コード例 #2
0
        public static Pdsaloadresults BuildPdsaloadresultsFromRow(DataRow row)
        {
            Pdsaloadresults entity = new Pdsaloadresults();

            entity.autotype      = row.IsNull("autotype") ? string.Empty : row.Field <string>("autotype");
            entity.vendno        = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno");
            entity.prodline      = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline");
            entity.notesfl       = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl");
            entity.prodcat       = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat");
            entity.priceonty     = row.IsNull("priceonty") ? string.Empty : row.Field <string>("priceonty");
            entity.priceontydesc = row.IsNull("priceontydesc") ? string.Empty : row.Field <string>("priceontydesc");
            entity.pricetype     = row.IsNull("pricetype") ? string.Empty : row.Field <string>("pricetype");
            entity.pricety       = row.IsNull("pricety") ? string.Empty : row.Field <string>("pricety");
            entity.pricetydesc   = row.IsNull("pricetydesc") ? string.Empty : row.Field <string>("pricetydesc");
            entity.basefactor    = row.IsNull("basefactor") ? decimal.Zero : row.Field <decimal>("basefactor");
            entity.listty        = row.IsNull("listty") ? string.Empty : row.Field <string>("listty");
            entity.listtydesc    = row.IsNull("listtydesc") ? string.Empty : row.Field <string>("listtydesc");
            entity.listfactor    = row.IsNull("listfactor") ? decimal.Zero : row.Field <decimal>("listfactor");
            entity.stndty        = row.IsNull("stndty") ? string.Empty : row.Field <string>("stndty");
            entity.stndtydesc    = row.IsNull("stndtydesc") ? string.Empty : row.Field <string>("stndtydesc");
            entity.costty        = row.IsNull("costty") ? string.Empty : row.Field <string>("costty");
            entity.costtydesc    = row.IsNull("costtydesc") ? string.Empty : row.Field <string>("costtydesc");
            entity.prodprefix    = row.IsNull("prodprefix") ? string.Empty : row.Field <string>("prodprefix");
            entity.addtype       = row.IsNull("addtype") ? string.Empty : row.Field <string>("addtype");
            entity.addtypedesc   = row.IsNull("addtypedesc") ? string.Empty : row.Field <string>("addtypedesc");
            entity.decimalfl     = row.Field <bool>("decimalfl");
            entity.pdcreatefl    = row.Field <bool>("pdcreatefl");
            entity.xrefprodfl    = row.Field <bool>("xrefprodfl");
            entity.pdsarowid     = row.Field <byte[]>("pdsarowid").ToStringEncoded();
            entity.userfield     = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }