/// <summary>
        /// 通过数据读取器生成实体类
        /// </summary>
        /// <param name="rdr"></param>
        /// <returns></returns>
        private static ProductDataEntity GetEntityFromrdr(NullableDataReader rdr)
        {
            ProductDataEntity info = new ProductDataEntity();

            info.ID                = rdr.GetInt32("ID");
            info.ProductID         = rdr.GetInt32("ProductID");
            info.TableName         = rdr.GetString("TableName");
            info.PropertyValue     = rdr.GetString("PropertyValue");
            info.Stocks            = rdr.GetInt32("Stocks");
            info.OrderNum          = rdr.GetInt32("OrderNum");
            info.AlarmNum          = rdr.GetInt32("AlarmNum");
            info.BuyTimes          = rdr.GetInt32("BuyTimes");
            info.Weight            = rdr.GetDouble("Weight");
            info.Volume            = rdr.GetDouble("Volume");
            info.Price             = rdr.GetDecimal("Price");
            info.Price_Market      = rdr.GetDecimal("Price_Market");
            info.Price_Activity    = rdr.GetDecimal("Price_Activity");
            info.Price_Settlement  = rdr.GetDecimal("Price_Settlement");
            info.Price_Member      = rdr.GetDecimal("Price_Member");
            info.Price_Agent       = rdr.GetDecimal("Price_Agent");
            info.Price_Wholesale1  = rdr.GetDecimal("Price_Wholesale1");
            info.Price_Wholesale2  = rdr.GetDecimal("Price_Wholesale2");
            info.Price_Wholesale3  = rdr.GetDecimal("Price_Wholesale3");
            info.Number_Wholesale1 = rdr.GetInt32("Number_Wholesale1");
            info.Number_Wholesale2 = rdr.GetInt32("Number_Wholesale2");
            info.Number_Wholesale3 = rdr.GetInt32("Number_Wholesale3");
            info.IsValid           = rdr.GetBoolean("IsValid");
            return(info);
        }
 private static void DeliverChargeInfoFromrdr(DeliverChargeInfo deliverChargeInfo, NullableDataReader rdr)
 {
     deliverChargeInfo.ChargeMin     = rdr.GetDecimal("Charge_Min");
     deliverChargeInfo.WeightMin     = rdr.GetDouble("Weight_Min");
     deliverChargeInfo.ChargePerUnit = rdr.GetDecimal("ChargePerUnit");
     deliverChargeInfo.WeightPerUnit = rdr.GetDouble("WeightPerUnit");
     deliverChargeInfo.ChargeMax     = rdr.GetDecimal("Charge_Max");
     deliverChargeInfo.ArrArea       = rdr.GetString("arrArea");
 }
        private static ShoppingCartInfo ShoppingCartFromrdr(NullableDataReader rdr, bool isDetail)
        {
            ShoppingCartInfo info = new ShoppingCartInfo();

            info.UserName     = rdr.GetString("UserName");
            info.CartId       = rdr.GetString("CartID");
            info.ProductId    = rdr.GetInt32("ProductID");
            info.Quantity     = rdr.GetInt32("Quantity");
            info.IsPresent    = rdr.GetBoolean("IsPresent");
            info.UpdateTime   = rdr.GetDateTime("UpdateTime");
            info.TableName    = rdr.GetString("TableName");
            info.Property     = rdr.GetString("Property");
            info.InformResult = rdr.GetInt32("InformResult");
            if (isDetail)
            {
                info.ProductInfomation.ProductName                = rdr.GetString("ProductName");
                info.ProductInfomation.ProductType                = (ProductType)rdr.GetInt32("ProductType");
                info.ProductInfomation.ProductPic                 = rdr.GetString("ProductPic");
                info.ProductInfomation.ProductThumb               = rdr.GetString("ProductThumb");
                info.ProductInfomation.Unit                       = rdr.GetString("Unit");
                info.ProductInfomation.ServiceTermUnit            = (ServiceTermUnit)rdr.GetInt32("ServiceTermUnit");
                info.ProductInfomation.ServiceTerm                = rdr.GetInt32("ServiceTerm");
                info.ProductInfomation.PriceInfo.Price            = rdr.GetDecimal("Price");
                info.ProductInfomation.PriceMarket                = rdr.GetDecimal("Price_Market");
                info.ProductInfomation.PriceInfo.PriceMember      = rdr.GetDecimal("Price_Member");
                info.ProductInfomation.PriceInfo.PriceAgent       = rdr.GetDecimal("Price_Agent");
                info.ProductInfomation.EnableWholesale            = rdr.GetBoolean("EnableWholesale");
                info.ProductInfomation.PriceInfo.PriceWholesale1  = rdr.GetDecimal("Price_Wholesale1");
                info.ProductInfomation.PriceInfo.PriceWholesale2  = rdr.GetDecimal("Price_Wholesale2");
                info.ProductInfomation.PriceInfo.PriceWholesale3  = rdr.GetDecimal("Price_Wholesale3");
                info.ProductInfomation.PriceInfo.NumberWholesale1 = rdr.GetInt32("Number_Wholesale1");
                info.ProductInfomation.PriceInfo.NumberWholesale2 = rdr.GetInt32("Number_Wholesale2");
                info.ProductInfomation.PriceInfo.NumberWholesale3 = rdr.GetInt32("Number_Wholesale3");
                info.ProductInfomation.PresentId                  = rdr.GetInt32("PresentID");
                info.ProductInfomation.PresentNumber              = rdr.GetInt32("PresentNumber");
                info.ProductInfomation.PresentPoint               = rdr.GetInt32("PresentPoint");
                info.ProductInfomation.PresentExp                 = rdr.GetInt32("PresentExp");
                info.ProductInfomation.PresentMoney               = rdr.GetDecimal("PresentMoney");
                info.ProductInfomation.StocksProject              = (StocksProject)rdr.GetInt32("StocksProject");
                info.ProductInfomation.SalePromotionType          = rdr.GetInt32("SalePromotionType");
                info.ProductInfomation.MinNumber                  = rdr.GetInt32("MinNumber");
                info.ProductInfomation.Discount                   = rdr.GetDouble("Discount");
                info.ProductInfomation.IncludeTax                 = (TaxRateType)rdr.GetInt32("IncludeTax");
                info.ProductInfomation.TaxRate                    = rdr.GetDouble("TaxRate");
                info.ProductInfomation.Properties                 = rdr.GetString("Properties");
                info.ProductInfomation.Weight                     = rdr.GetDouble("Weight");
                info.ProductInfomation.LimitNum                   = rdr.GetInt32("LimitNum");
                info.ProductInfomation.EnableSingleSell           = rdr.GetBoolean("EnableSingleSell");
                info.ProductInfomation.DependentProducts          = rdr.GetString("DependentProducts");
                info.ProductInfomation.ProductKind                = (ProductKind)rdr.GetInt32("ProductKind");
                info.ProductInfomation.TableName                  = rdr.GetString("TableName");
                info.ProductInfomation.ProductId                  = rdr.GetInt32("ProductID");
                info.ProductInfomation.Stocks                     = rdr.GetInt32("Stocks");
                info.ProductInfomation.OrderNum                   = rdr.GetInt32("OrderNum");
            }
            return(info);
        }
示例#4
0
        private static StatIPInfo StatIPInfoListFromrdr(NullableDataReader rdr)
        {
            StatIPInfo info = new StatIPInfo();

            info.StartIP = rdr.GetDouble("StartIp");
            info.EndIP   = rdr.GetDouble("EndIp");
            info.Address = rdr.GetString("Address");
            return(info);
        }
        /// <summary>
        /// 通过数据读取器生成实体类
        /// </summary>
        /// <param name="rdr"></param>
        /// <returns></returns>
        private static StatIpInfoEntity GetEntityFromrdr(NullableDataReader rdr)
        {
            StatIpInfoEntity info = new StatIpInfoEntity();

            info.ID      = rdr.GetInt32("ID");
            info.StartIp = rdr.GetDouble("StartIp");
            info.EndIp   = rdr.GetDouble("EndIp");
            info.Address = rdr.GetString("Address");
            return(info);
        }
示例#6
0
        private static PackageInfo PackageFromrdr(NullableDataReader rdr)
        {
            PackageInfo info = new PackageInfo();

            info.PackageId      = rdr.GetInt32("PackageId");
            info.PackageName    = rdr.GetString("PackageName");
            info.PackageWeight  = rdr.GetDouble("PackageWeight");
            info.GoodsWeightMin = rdr.GetDouble("GoodsWeightMin");
            info.GoodsWeightMax = rdr.GetDouble("GoodsWeightMax");
            return(info);
        }
        private static DeliverChargeInfo CreateInfo(NullableDataReader rdr)
        {
            DeliverChargeInfo info = new DeliverChargeInfo();

            info.Id            = rdr.GetInt32("Id");
            info.DeliverTypeId = rdr.GetInt32("DeliverTypeId");
            info.AreaType      = rdr.GetInt32("AreaType");
            info.ArrArea       = rdr["arrArea"].ToString();
            info.ChargeMin     = rdr.GetDecimal("Charge_Min");
            info.WeightMin     = rdr.GetDouble("Weight_Min");
            info.ChargePerUnit = rdr.GetDecimal("ChargePerUnit");
            info.WeightPerUnit = rdr.GetDouble("WeightPerUnit");
            info.ChargeMax     = rdr.GetDecimal("Charge_Max");
            return(info);
        }
        /// <summary>
        /// 通过数据读取器生成实体类
        /// </summary>
        /// <param name="rdr"></param>
        /// <returns></returns>
        private static DeliverChargeEntity GetEntityFromrdr(NullableDataReader rdr)
        {
            DeliverChargeEntity info = new DeliverChargeEntity();

            info.ID            = rdr.GetInt32("ID");
            info.DeliverTypeID = rdr.GetInt32("DeliverTypeID");
            info.AreaType      = rdr.GetInt32("AreaType");
            info.ArrArea       = rdr.GetString("arrArea");
            info.Charge_Min    = rdr.GetDecimal("Charge_Min");
            info.Weight_Min    = rdr.GetDouble("Weight_Min");
            info.ChargePerUnit = rdr.GetDecimal("ChargePerUnit");
            info.WeightPerUnit = rdr.GetDouble("WeightPerUnit");
            info.Charge_Max    = rdr.GetDecimal("Charge_Max");
            return(info);
        }
示例#9
0
        /// <summary>
        /// 通过数据读取器生成实体类
        /// </summary>
        /// <param name="rdr"></param>
        /// <returns></returns>
        private static PresentEntity GetEntityFromrdr(NullableDataReader rdr)
        {
            PresentEntity info = new PresentEntity();

            info.PresentID        = rdr.GetInt32("PresentID");
            info.PresentName      = rdr.GetString("PresentName");
            info.PresentPic       = rdr.GetString("PresentPic");
            info.Unit             = rdr.GetString("Unit");
            info.PresentNum       = rdr.GetString("PresentNum");
            info.ServiceTermUnit  = rdr.GetInt32("ServiceTermUnit");
            info.ServiceTerm      = rdr.GetInt32("ServiceTerm");
            info.Price            = rdr.GetDecimal("Price");
            info.Price_Market     = rdr.GetDecimal("Price_Market");
            info.Weight           = rdr.GetDouble("Weight");
            info.Stocks           = rdr.GetInt32("Stocks");
            info.StocksProject    = rdr.GetInt32("StocksProject");
            info.OrderNum         = rdr.GetInt32("OrderNum");
            info.AlarmNum         = rdr.GetInt32("AlarmNum");
            info.ProductCharacter = rdr.GetInt32("ProductCharacter");
            info.DownloadUrl      = rdr.GetString("DownloadUrl");
            info.Remark           = rdr.GetString("Remark");
            info.PresentThumb     = rdr.GetString("PresentThumb");
            info.PresentIntro     = rdr.GetString("PresentIntro");
            info.PresentExplain   = rdr.GetString("PresentExplain");
            return(info);
        }
示例#10
0
        private static OrderItemInfo OrderItemFromrdr(NullableDataReader rdr)
        {
            OrderItemInfo info = new OrderItemInfo();

            info.ItemId           = rdr.GetInt32("ItemID");
            info.OrderId          = rdr.GetInt32("OrderID");
            info.ProductId        = rdr.GetInt32("ProductID");
            info.TableName        = rdr.GetString("TableName");
            info.Property         = rdr.GetString("Property");
            info.SaleType         = rdr.GetInt32("SaleType");
            info.PriceMarket      = rdr.GetDecimal("Price_Market");
            info.Price            = rdr.GetDecimal("Price");
            info.TruePrice        = rdr.GetDecimal("TruePrice");
            info.Amount           = rdr.GetInt32("Amount");
            info.SubTotal         = rdr.GetDecimal("SubTotal");
            info.BeginDate        = rdr.GetDateTime("BeginDate");
            info.ServiceTerm      = rdr.GetInt32("ServiceTerm");
            info.Remark           = rdr.GetString("Remark");
            info.PresentMoney     = rdr.GetDecimal("PresentMoney");
            info.PresentPoint     = rdr.GetInt32("PresentPoint");
            info.PresentExp       = rdr.GetInt32("PresentExp");
            info.ServiceTermUnit  = (ServiceTermUnit)rdr.GetInt32("ServiceTermUnit");
            info.ProductCharacter = (ProductCharacter)rdr.GetInt32("ProductCharacter");
            info.ProductName      = rdr.GetString("ProductName");
            info.Unit             = rdr.GetString("Unit");
            info.Weight           = rdr.GetDouble("Weight");
            return(info);
        }
示例#11
0
        /// <summary>
        /// 通过数据读取器生成实体类
        /// </summary>
        /// <param name="rdr"></param>
        /// <returns></returns>
        private static DeliverTypeEntity GetEntityFromrdr(NullableDataReader rdr)
        {
            DeliverTypeEntity info = new DeliverTypeEntity();

            info.TypeID         = rdr.GetInt32("TypeID");
            info.TypeName       = rdr.GetString("TypeName");
            info.Intro          = rdr.GetString("Intro");
            info.ChargeType     = rdr.GetInt32("ChargeType");
            info.IsDefault      = rdr.GetBoolean("IsDefault");
            info.IsDisabled     = rdr.GetBoolean("IsDisabled");
            info.OrderSort      = rdr.GetInt32("OrderSort");
            info.ReleaseType    = rdr.GetInt32("ReleaseType");
            info.MinMoney1      = rdr.GetDecimal("MinMoney1");
            info.ReleaseCharge  = rdr.GetDecimal("ReleaseCharge");
            info.Minmoney2      = rdr.GetDecimal("Minmoney2");
            info.MaxCharge      = rdr.GetDecimal("MaxCharge");
            info.MinMoney3      = rdr.GetDecimal("MinMoney3");
            info.Charge_Min     = rdr.GetDecimal("Charge_Min");
            info.Charge_Max     = rdr.GetDecimal("Charge_Max");
            info.Charge_Percent = rdr.GetInt16("Charge_Percent");
            info.IncludeTax     = rdr.GetInt32("IncludeTax");
            info.TaxRate        = rdr.GetDouble("TaxRate");
            info.StoreID        = rdr.GetInt32("StoreID");
            return(info);
        }
示例#12
0
        /// <summary>
        /// 通过数据读取器生成实体类
        /// </summary>
        /// <param name="rdr"></param>
        /// <returns></returns>
        private static U_AwardEntity GetEntityFromrdr(NullableDataReader rdr)
        {
            U_AwardEntity info = new U_AwardEntity();

            info.ID     = rdr.GetInt32("ID");
            info.Weight = rdr.GetDouble("Weight");
            info.Number = rdr.GetString("Number");
            return(info);
        }
示例#13
0
        /// <summary>
        /// 通过数据读取器生成实体类
        /// </summary>
        /// <param name="rdr"></param>
        /// <returns></returns>
        private static OrderItemEntity GetEntityFromrdr(NullableDataReader rdr)
        {
            OrderItemEntity info = new OrderItemEntity();

            info.ItemID            = rdr.GetInt32("ItemID");
            info.OrderID           = rdr.GetInt32("OrderID");
            info.ProductID         = rdr.GetInt32("ProductID");
            info.TableName         = rdr.GetString("TableName");
            info.Property          = rdr.GetString("Property");
            info.SaleType          = rdr.GetInt32("SaleType");
            info.Price_Market      = rdr.GetDecimal("Price_Market");
            info.Price             = rdr.GetDecimal("Price");
            info.Price_Activity    = rdr.GetDecimal("Price_Activity");
            info.Price_Settlement  = rdr.GetDecimal("Price_Settlement");
            info.TruePrice         = rdr.GetDecimal("TruePrice");
            info.Amount            = rdr.GetInt32("Amount");
            info.SubTotal          = rdr.GetDecimal("SubTotal");
            info.BeginDate         = rdr.GetNullableDateTime("BeginDate");
            info.ServiceTerm       = rdr.GetDouble("ServiceTerm");
            info.ServiceTermUnit   = rdr.GetInt32("ServiceTermUnit");
            info.Remark            = rdr.GetString("Remark");
            info.PresentMoney      = rdr.GetDecimal("PresentMoney");
            info.PresentPoint      = rdr.GetInt32("PresentPoint");
            info.PresentExp        = rdr.GetInt32("PresentExp");
            info.ProductCharacter  = rdr.GetInt32("ProductCharacter");
            info.ProductName       = rdr.GetString("ProductName");
            info.Unit              = rdr.GetString("Unit");
            info.Weight            = rdr.GetDouble("Weight");
            info.ChargeDeliverItem = rdr.GetDecimal("ChargeDeliverItem");
            info.DeliverStatusItem = rdr.GetInt32("DeliverStatusItem");
            info.PayStatusItem     = rdr.GetInt32("PayStatusItem");
            info.DownPayment       = rdr.GetDecimal("DownPayment");
            info.YearRate          = rdr.GetDecimal("YearRate");
            info.Fee            = rdr.GetDecimal("Fee");
            info.MerchantRebate = rdr.GetDecimal("MerchantRebate");
            info.Deadline       = rdr.GetInt32("Deadline");
            info.SubTotalHP     = rdr.GetDecimal("SubTotalHP");
            return(info);
        }
示例#14
0
        private static PayPlatformInfo PayPlatformFromDataReader(NullableDataReader rdr)
        {
            PayPlatformInfo info = new PayPlatformInfo();

            info.PayPlatformId   = rdr.GetInt32("PayPlatformID");
            info.PayPlatformName = rdr.GetString("PayPlatformName");
            info.Rate            = rdr.GetDouble("Rate");
            info.MD5             = rdr.GetString("MD5");
            info.AccountsId      = rdr.GetString("AccountsId");
            info.OrderId         = rdr.GetInt32("OrderID");
            info.IsDisabled      = rdr.GetBoolean("IsDisabled");
            info.IsDefault       = rdr.GetBoolean("IsDefault");
            return(info);
        }
        /// <summary>
        /// 通过数据读取器生成实体类
        /// </summary>
        /// <param name="rdr"></param>
        /// <returns></returns>
        private static PayPlatFormEntity GetEntityFromrdr(NullableDataReader rdr)
        {
            PayPlatFormEntity info = new PayPlatFormEntity();

            info.PayPlatformID   = rdr.GetInt32("PayPlatformID");
            info.PayPlatformName = rdr.GetString("PayPlatformName");
            info.AccountsID      = rdr.GetString("AccountsID");
            info.MD5             = rdr.GetString("MD5");
            info.Rate            = rdr.GetDouble("Rate");
            info.OrderSort       = rdr.GetInt32("OrderSort");
            info.IsDisabled      = rdr.GetBoolean("IsDisabled");
            info.IsDefault       = rdr.GetBoolean("IsDefault");
            return(info);
        }
示例#16
0
        /// <summary>
        /// 通过数据读取器生成实体类
        /// </summary>
        /// <param name="rdr"></param>
        /// <returns></returns>
        private static PaymentTypeEntity GetEntityFromrdr(NullableDataReader rdr)
        {
            PaymentTypeEntity info = new PaymentTypeEntity();

            info.TypeID     = rdr.GetInt32("TypeID");
            info.TypeName   = rdr.GetString("TypeName");
            info.Intro      = rdr.GetString("Intro");
            info.Discount   = rdr.GetDouble("Discount");
            info.OrderSort  = rdr.GetInt32("OrderSort");
            info.IsDefault  = rdr.GetBoolean("IsDefault");
            info.IsDisabled = rdr.GetBoolean("IsDisabled");
            info.Category   = rdr.GetInt32("Category");
            return(info);
        }
示例#17
0
        /// <summary>
        /// 通过数据读取器生成实体类
        /// </summary>
        /// <param name="rdr"></param>
        /// <returns></returns>
        private static U_ArticleEntity GetEntityFromrdr(NullableDataReader rdr)
        {
            U_ArticleEntity info = new U_ArticleEntity();

            info.ID             = rdr.GetInt32("ID");
            info.Intro          = rdr.GetString("Intro");
            info.PaginationType = rdr.GetString("PaginationType");
            info.MaxCharPerPage = rdr.GetDouble("MaxCharPerPage");
            info.Content        = rdr.GetString("Content");
            info.SEO_Keyword    = rdr.GetString("SEO_Keyword");
            info.SEO_Desc       = rdr.GetString("SEO_Desc");
            info.SEO_Title      = rdr.GetString("SEO_Title");
            return(info);
        }
示例#18
0
        /// <summary>
        /// 通过数据读取器生成实体类
        /// </summary>
        /// <param name="rdr"></param>
        /// <returns></returns>
        private static U_UserTextEntity GetEntityFromrdr(NullableDataReader rdr)
        {
            U_UserTextEntity info = new U_UserTextEntity();

            info.ID            = rdr.GetInt32("ID");
            info.Nominate      = rdr.GetString("Nominate");
            info.RegIP         = rdr.GetString("RegIP");
            info.QQOpenID      = rdr.GetString("QQOpenID");
            info.QQWeiboOpenID = rdr.GetString("QQWeiboOpenID");
            info.RenrenOpenID  = rdr.GetString("RenrenOpenID");
            info.SinaOpenID    = rdr.GetString("SinaOpenID");
            info.SharingRatio  = rdr.GetDouble("SharingRatio");
            info.WxOpenID      = rdr.GetString("WxOpenID");
            return(info);
        }
示例#19
0
        public IList <CompareHitsOrderNumberInfo> GetCompareHitsOrderNumberList(int startRowIndexId, int maxNumberRows, int orderType)
        {
            string    str;
            Database  database          = DatabaseFactory.CreateDatabase();
            DbCommand storedProcCommand = database.GetStoredProcCommand("PR_Shop_Statistics_GetList");

            switch (orderType)
            {
            case 1:
                str = "SUM(M.Hits)";
                break;

            case 2:
                str = "SUM(P.BuyTimes)";
                break;

            default:
                str = "(SUM(P.BuyTimes)*1.0)/(SUM(M.Hits))";
                break;
            }
            database.AddInParameter(storedProcCommand, "@StartRows", DbType.Int32, startRowIndexId);
            database.AddInParameter(storedProcCommand, "@PageSize", DbType.Int32, maxNumberRows);
            database.AddInParameter(storedProcCommand, "@SortColumn", DbType.String, str);
            database.AddInParameter(storedProcCommand, "@StrColumn", DbType.String, "Max(P.ProductName) AS ProductName, SUM(M.Hits) AS Hits, SUM(P.BuyTimes) AS BuyTimes, CONVERT(float,(SUM(P.BuyTimes)*1.0)/(SUM(M.Hits))) AS CompareRate");
            database.AddInParameter(storedProcCommand, "@Sorts", DbType.String, "DESC");
            database.AddInParameter(storedProcCommand, "@TableName", DbType.String, "PE_CommonProduct P INNER JOIN PE_CommonModel M ON P.TableName = M.TableName AND P.ProductID = M.ItemID");
            database.AddInParameter(storedProcCommand, "@Filter", DbType.String, "M.Hits > 0");
            database.AddInParameter(storedProcCommand, "@ID", DbType.String, "P.ProductID");
            database.AddInParameter(storedProcCommand, "@Group", DbType.String, "Group by P.ProductID");
            database.AddOutParameter(storedProcCommand, "@Total", DbType.Int32, maxNumberRows);
            IList <CompareHitsOrderNumberInfo> list = new List <CompareHitsOrderNumberInfo>();

            using (NullableDataReader reader = new NullableDataReader(database.ExecuteReader(storedProcCommand)))
            {
                while (reader.Read())
                {
                    CompareHitsOrderNumberInfo item = new CompareHitsOrderNumberInfo();
                    item.ProductName = reader.GetString("ProductName");
                    item.Hits        = reader.GetInt32("Hits");
                    item.OrderNumber = reader.GetInt32("BuyTimes");
                    item.CompareRate = reader.GetDouble("CompareRate");
                    list.Add(item);
                }
            }
            this.m_TotalOfCompareHitsOrderNumber = (int)database.GetParameterValue(storedProcCommand, "@Total");
            return(list);
        }
示例#20
0
        private static OrderInfo OrderFromrdr(NullableDataReader rdr, string action)
        {
            OrderInfo info = new OrderInfo();

            info.OrderId       = rdr.GetInt32("OrderID");
            info.OrderNum      = rdr.GetString("OrderNum");
            info.UserName      = rdr.GetString("UserName");
            info.ClientId      = rdr.GetInt32("ClientID");
            info.ClientName    = rdr.GetString("ClientName");
            info.MoneyTotal    = rdr.GetDecimal("MoneyTotal");
            info.NeedInvoice   = rdr.GetBoolean("NeedInvoice");
            info.Invoiced      = rdr.GetBoolean("Invoiced");
            info.Remark        = rdr.GetString("Remark");
            info.MoneyReceipt  = rdr.GetDecimal("MoneyReceipt");
            info.InputTime     = rdr.GetDateTime("InputTime");
            info.Status        = (OrderStatus)rdr.GetInt32("Status");
            info.DeliverStatus = (DeliverStatus)rdr.GetInt32("DeliverStatus");
            if (string.IsNullOrEmpty(action))
            {
                info.EnableDownload  = rdr.GetBoolean("EnableDownload");
                info.PresentMoney    = rdr.GetDecimal("PresentMoney");
                info.PresentPoint    = rdr.GetInt32("PresentPoint");
                info.PresentExp      = rdr.GetInt32("PresentExp");
                info.DiscountPayment = rdr.GetDouble("Discount_Payment");
                info.ChargeDeliver   = rdr.GetDecimal("Charge_Deliver");
            }
            info.AgentName         = rdr.GetString("AgentName");
            info.Functionary       = rdr.GetString("Functionary");
            info.InvoiceContent    = rdr.GetString("InvoiceContent");
            info.BeginDate         = rdr.GetDateTime("BeginDate");
            info.ContacterName     = rdr.GetString("ContacterName");
            info.Address           = rdr.GetString("Address");
            info.ZipCode           = rdr.GetString("ZipCode");
            info.Mobile            = rdr.GetString("Mobile");
            info.Phone             = rdr.GetString("Phone");
            info.Email             = rdr.GetString("Email");
            info.PaymentType       = rdr.GetInt32("PaymentType");
            info.DeliverType       = rdr.GetInt32("DeliverType");
            info.Memo              = rdr.GetString("Memo");
            info.OutOfStockProject = (OutOfStockProject)rdr.GetInt32("OutOfStockProject");
            info.OrderType         = rdr.GetInt32("OrderType");
            info.CouponId          = rdr.GetInt32("CouponID");
            info.DeliveryTime      = rdr.GetString("DeliveryTime");
            return(info);
        }
示例#21
0
 private static void ProductFromrdr <T>(NullableDataReader rdr, T productInfo) where T : ProductInfo
 {
     productInfo.ProductId                  = rdr.GetInt32("ProductId");
     productInfo.TableName                  = rdr.GetString("TableName");
     productInfo.ProductName                = rdr.GetString("ProductName");
     productInfo.ProductType                = (ProductType)rdr.GetInt32("ProductType");
     productInfo.ProductPic                 = rdr.GetString("ProductPic");
     productInfo.ProductThumb               = rdr.GetString("ProductThumb");
     productInfo.Unit                       = rdr.GetString("Unit");
     productInfo.ProductNum                 = rdr.GetString("ProductNum");
     productInfo.ServiceTermUnit            = (ServiceTermUnit)rdr.GetInt32("ServiceTermUnit");
     productInfo.ServiceTerm                = rdr.GetInt32("ServiceTerm");
     productInfo.PriceInfo.Price            = rdr.GetDecimal("Price");
     productInfo.PriceMarket                = rdr.GetDecimal("Price_Market");
     productInfo.PriceInfo.PriceMember      = rdr.GetDecimal("Price_Member");
     productInfo.PriceInfo.PriceAgent       = rdr.GetDecimal("Price_Agent");
     productInfo.EnableWholesale            = rdr.GetBoolean("EnableWholesale");
     productInfo.PriceInfo.PriceWholesale1  = rdr.GetDecimal("Price_Wholesale1");
     productInfo.PriceInfo.PriceWholesale2  = rdr.GetDecimal("Price_Wholesale2");
     productInfo.PriceInfo.PriceWholesale3  = rdr.GetDecimal("Price_Wholesale3");
     productInfo.PriceInfo.NumberWholesale1 = rdr.GetInt32("Number_Wholesale1");
     productInfo.PriceInfo.NumberWholesale2 = rdr.GetInt32("Number_Wholesale2");
     productInfo.PriceInfo.NumberWholesale3 = rdr.GetInt32("Number_Wholesale3");
     productInfo.PresentId                  = rdr.GetInt32("PresentID");
     productInfo.PresentNumber              = rdr.GetInt32("PresentNumber");
     productInfo.PresentPoint               = rdr.GetInt32("PresentPoint");
     productInfo.PresentExp                 = rdr.GetInt32("PresentExp");
     productInfo.PresentMoney               = rdr.GetDecimal("PresentMoney");
     productInfo.StocksProject              = (StocksProject)rdr.GetInt32("StocksProject");
     productInfo.SalePromotionType          = rdr.GetInt32("SalePromotionType");
     productInfo.MinNumber                  = rdr.GetInt32("MinNumber");
     productInfo.Discount                   = rdr.GetDouble("Discount");
     productInfo.IncludeTax                 = (TaxRateType)rdr.GetInt32("IncludeTax");
     productInfo.TaxRate                    = rdr.GetDouble("TaxRate");
     productInfo.Properties                 = rdr.GetString("Properties");
     productInfo.Weight                     = rdr.GetDouble("Weight");
     productInfo.LimitNum                   = rdr.GetInt32("LimitNum");
     productInfo.EnableSingleSell           = rdr.GetBoolean("EnableSingleSell");
     productInfo.DependentProducts          = rdr.GetString("DependentProducts");
     productInfo.ProductKind                = (ProductKind)rdr.GetInt32("ProductKind");
     productInfo.OrderNum                   = rdr.GetInt32("OrderNum");
     productInfo.Stocks                     = rdr.GetInt32("Stocks");
     productInfo.EnableSale                 = rdr.GetBoolean("EnableSale");
     productInfo.EnableBuyWhenOutofstock    = rdr.GetBoolean("EnableBuyWhenOutofstock");
     productInfo.BarCode                    = rdr.GetString("BarCode");
     productInfo.ProductExplain             = rdr.GetString("ProductExplain");
     productInfo.ProducerName               = rdr.GetString("ProducerName");
     productInfo.TrademarkName              = rdr.GetString("TrademarkName");
     productInfo.Keyword                    = rdr.GetString("Keyword");
     productInfo.Stars                      = rdr.GetInt32("Stars");
     productInfo.ProductIntro               = rdr.GetString("ProductIntro");
     productInfo.IsNew                      = rdr.GetBoolean("IsNew");
     productInfo.IsHot                      = rdr.GetBoolean("IsHot");
     productInfo.IsBest                     = rdr.GetBoolean("IsBest");
     productInfo.ProductCharacter           = (ProductCharacter)rdr.GetInt32("ProductCharacter");
     productInfo.DownloadUrl                = rdr.GetString("DownloadUrl");
     productInfo.Remark                     = rdr.GetString("Remark");
     productInfo.AlarmNum                   = rdr.GetInt32("AlarmNum");
     productInfo.BuyTimes                   = rdr.GetInt32("BuyTimes");
     productInfo.Minimum                    = rdr.GetInt32("Minimum");
 }