Пример #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromPdsprebateaddcriteria(ref DataRow row, Pdsprebateaddcriteria entity)
 {
     row.SetField("clevelcd", entity.clevelcd);
     row.SetField("prod", entity.prod);
     row.SetField("vendno", entity.vendno);
     row.SetField("custno", entity.custno);
     row.SetField("shipto", entity.shipto);
     row.SetField("rebtype", entity.rebtype);
     row.SetField("rebsubty", entity.rebsubty);
     row.SetField("rebcustty", entity.rebcustty);
     row.SetField("prodpricety", entity.prodpricety);
     row.SetField("prodline", entity.prodline);
     row.SetField("prodcat", entity.prodcat);
     row.SetField("rebatecd", entity.rebatecd);
     row.SetField("whse", entity.whse);
     row.SetField("startdt", entity.startdt);
     row.SetField("shiptype", entity.shiptype);
     row.SetField("contractNo", entity.contractNo);
     row.SetField("contractLine", entity.contractLine);
     row.SetField("capsellamount", entity.capsellamount);
     row.SetField("capselltypefl", entity.capselltypefl);
     row.SetField("sharepct", entity.sharepct);
     row.SetField("sharefl", entity.sharefl);
     row.SetField("lUseContractvfl", entity.lUseContractvfl);
     row.SetField("price", entity.price);
     row.SetField("prccurrencyty", entity.prccurrencyty);
     row.SetField("lUsePricevfl", entity.lUsePricevfl);
     row.SetField("userfield", entity.userfield);
 }
Пример #2
0
        public static Pdsprebateaddcriteria BuildPdsprebateaddcriteriaFromRow(DataRow row)
        {
            Pdsprebateaddcriteria entity = new Pdsprebateaddcriteria();

            entity.clevelcd        = row.IsNull("clevelcd") ? string.Empty : row.Field <string>("clevelcd");
            entity.prod            = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.vendno          = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno");
            entity.custno          = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno");
            entity.shipto          = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto");
            entity.rebtype         = row.IsNull("rebtype") ? string.Empty : row.Field <string>("rebtype");
            entity.rebsubty        = row.IsNull("rebsubty") ? string.Empty : row.Field <string>("rebsubty");
            entity.rebcustty       = row.IsNull("rebcustty") ? string.Empty : row.Field <string>("rebcustty");
            entity.prodpricety     = row.IsNull("prodpricety") ? string.Empty : row.Field <string>("prodpricety");
            entity.prodline        = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline");
            entity.prodcat         = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat");
            entity.rebatecd        = row.IsNull("rebatecd") ? string.Empty : row.Field <string>("rebatecd");
            entity.whse            = row.IsNull("whse") ? string.Empty : row.Field <string>("whse");
            entity.startdt         = row.Field <DateTime?>("startdt");
            entity.shiptype        = row.IsNull("shiptype") ? string.Empty : row.Field <string>("shiptype");
            entity.contractNo      = row.IsNull("contractNo") ? string.Empty : row.Field <string>("contractNo");
            entity.contractLine    = row.IsNull("contractLine") ? 0 : row.Field <int>("contractLine");
            entity.capsellamount   = row.IsNull("capsellamount") ? decimal.Zero : row.Field <decimal>("capsellamount");
            entity.capselltypefl   = row.IsNull("capselltypefl") ? string.Empty : row.Field <string>("capselltypefl");
            entity.sharepct        = row.IsNull("sharepct") ? decimal.Zero : row.Field <decimal>("sharepct");
            entity.sharefl         = row.Field <bool>("sharefl");
            entity.lUseContractvfl = row.Field <bool>("lUseContractvfl");
            entity.price           = row.IsNull("price") ? decimal.Zero : row.Field <decimal>("price");
            entity.prccurrencyty   = row.IsNull("prccurrencyty") ? string.Empty : row.Field <string>("prccurrencyty");
            entity.lUsePricevfl    = row.Field <bool>("lUsePricevfl");
            entity.userfield       = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }