Exemple #1
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);
        }
Exemple #2
0
        /// <summary>
        /// 通过数据读取器生成实体类
        /// </summary>
        /// <param name="rdr"></param>
        /// <returns></returns>
        private static CommentEntity GetEntityFromrdr(NullableDataReader rdr)
        {
            CommentEntity info = new CommentEntity();

            info.CommentID      = rdr.GetInt32("CommentID");
            info.GeneralID      = rdr.GetInt32("GeneralID");
            info.NodeID         = rdr.GetInt32("NodeID");
            info.TopicID        = rdr.GetInt32("TopicID");
            info.CommentTitle   = rdr.GetString("CommentTitle");
            info.Email          = rdr.GetString("Email");
            info.Content        = rdr.GetString("Content");
            info.Face           = rdr.GetString("Face");
            info.UpdateDateTime = rdr.GetNullableDateTime("UpdateDateTime");
            info.Position       = rdr.GetInt32("Position");
            info.IsPassed       = rdr.GetBoolean("IsPassed");
            info.Agree          = rdr.GetInt32("Agree");
            info.Oppose         = rdr.GetInt32("Oppose");
            info.Neutral        = rdr.GetInt32("Neutral");
            info.Score          = rdr.GetInt32("Score");
            info.IP             = rdr.GetString("IP");
            info.IsElite        = rdr.GetBoolean("IsElite");
            info.IsPrivate      = rdr.GetBoolean("IsPrivate");
            info.UserName       = rdr.GetString("UserName");
            info.Reply          = rdr.GetString("Reply");
            info.ReplyAdmin     = rdr.GetString("ReplyAdmin");
            info.ReplyDatetime  = rdr.GetNullableDateTime("ReplyDatetime");
            info.ReplyIsPrivate = rdr.GetBoolean("ReplyIsPrivate");
            info.ReplyUserName  = rdr.GetString("ReplyUserName");
            return(info);
        }
        private static QuestionInfo GetInfoByReader(NullableDataReader rdr, bool getAll)
        {
            QuestionInfo info = new QuestionInfo();

            info.Id                 = rdr.GetInt32("ID");
            info.TypeId             = rdr.GetInt32("TypeID");
            info.TypeName           = rdr.GetString("TypeName");
            info.QuestionTitle      = rdr.GetString("QuestionTitle");
            info.QuestionCreateTime = rdr.GetDateTime("QuestionCreateTime");
            info.QuestionCreator    = rdr.GetString("QuestionCreator");
            info.ReplyCreator       = rdr.GetString("ReplyCreator");
            info.ReplyTime          = rdr.GetNullableDateTime("ReplyTime");
            info.Score              = rdr.GetInt32("Score");
            info.IsPublic           = rdr.GetBoolean("IsPublic");
            info.IsReply            = rdr.GetBoolean("IsReply");
            info.IsSolved           = rdr.GetBoolean("IsSolved");
            if (getAll)
            {
                info.AntiVirus       = rdr.GetString("AntiVirus");
                info.ErrorCode       = rdr.GetString("ErrorCode");
                info.ErrorText       = rdr.GetString("ErrorText");
                info.FireWall        = rdr.GetString("FireWall");
                info.IP              = rdr.GetString("IP");
                info.ProductDBType   = rdr.GetString("ProductDBType");
                info.ProductVersion  = rdr.GetString("ProductVersion");
                info.QuestionContent = rdr.GetString("QuestionContent");
                info.SystemType      = rdr.GetString("SystemType");
                info.Url             = rdr.GetString("Url");
                info.LastUpdateTime  = rdr.GetDateTime("LastUpdateTime");
            }
            return(info);
        }
        private static AdvertisementInfo AdvertisementFromrdr(NullableDataReader rdr)
        {
            AdvertisementInfo info = new AdvertisementInfo();

            info.ADId        = rdr.GetInt32("ADID");
            info.UserId      = rdr.GetInt32("UserID");
            info.ADType      = rdr.GetInt32("ADType");
            info.ADName      = rdr.GetString("ADName");
            info.ImgUrl      = rdr.GetString("ImgUrl");
            info.ImgWidth    = rdr.GetInt32("ImgWidth");
            info.ImgHeight   = rdr.GetInt32("ImgHeight");
            info.FlashWmode  = rdr.GetInt32("FlashWmode");
            info.ADIntro     = rdr.GetString("ADIntro");
            info.LinkUrl     = rdr.GetString("LinkUrl");
            info.LinkTarget  = rdr.GetInt32("LinkTarget");
            info.LinkAlt     = rdr.GetString("LinkAlt");
            info.Priority    = rdr.GetInt32("Priority");
            info.Setting     = rdr.GetString("Setting");
            info.CountView   = rdr.GetBoolean("CountView");
            info.Views       = rdr.GetInt32("Views");
            info.CountClick  = rdr.GetBoolean("CountClick");
            info.Clicks      = rdr.GetInt32("Clicks");
            info.Passed      = rdr.GetBoolean("Passed");
            info.OverdueDate = rdr.GetDateTime("OverdueDate");
            return(info);
        }
        private static CommentInfo CommentInfoCommonFromDataReader(NullableDataReader dr)
        {
            CommentInfo info = new CommentInfo();

            info.CommentId      = dr.GetInt32("CommentId");
            info.Agree          = dr.GetInt32("Agree");
            info.CommentTitle   = dr.GetString("CommentTitle");
            info.Content        = dr.GetString("Content");
            info.GeneralId      = dr.GetInt32("GeneralId");
            info.IP             = dr.GetString("IP");
            info.IsElite        = dr.GetBoolean("IsElite");
            info.IsPrivate      = dr.GetBoolean("IsPrivate");
            info.Neutral        = dr.GetInt32("Neutral");
            info.Oppose         = dr.GetInt32("Oppose");
            info.Position       = dr.GetInt32("Position");
            info.Reply          = dr.GetString("Reply");
            info.ReplyAdmin     = dr.GetString("ReplyAdmin");
            info.ReplyDateTime  = dr.GetDateTime("ReplyDateTime");
            info.ReplyIsPrivate = dr.GetBoolean("ReplyIsPrivate");
            info.Status         = dr.GetBoolean("Status");
            info.TopicId        = dr.GetInt32("TopicId");
            info.UpdateDateTime = dr.GetDateTime("UpdateDateTime");
            info.UserName       = dr.GetString("UserName");
            info.NodeId         = dr.GetInt32("NodeId");
            info.Score          = dr.GetInt32("Score");
            info.Face           = dr.GetString("Face");
            info.ReplyUserName  = dr.GetString("ReplyUserName");
            return(info);
        }
Exemple #6
0
        private static AuthorInfo AuthorFromrdr(NullableDataReader rdr)
        {
            AuthorInfo info = new AuthorInfo();

            info.Id          = rdr.GetInt32("ID");
            info.UserId      = rdr.GetInt32("UserID");
            info.Type        = rdr.GetString("Type");
            info.Name        = rdr.GetString("Name");
            info.Passed      = rdr.GetBoolean("Passed");
            info.OnTop       = rdr.GetBoolean("onTop");
            info.Elite       = rdr.GetBoolean("IsElite");
            info.Hits        = rdr.GetInt32("Hits");
            info.LastUseTime = rdr.GetDateTime("LastUseTime");
            info.TemplateId  = rdr.GetInt32("TemplateID");
            info.Photo       = rdr.GetString("Photo");
            info.Intro       = rdr.GetString("Intro");
            info.Address     = rdr.GetString("Address");
            info.Tel         = rdr.GetString("Tel");
            info.Fax         = rdr.GetString("Fax");
            info.Mail        = rdr.GetString("Mail");
            info.Email       = rdr.GetString("Email");
            info.ZipCode     = rdr.GetInt32("ZipCode");
            info.HomePage    = rdr.GetString("HomePage");
            info.Imeeting    = rdr.GetString("Im");
            info.Sex         = rdr.GetInt16("Sex");
            info.BirthDay    = rdr.GetDateTime("BirthDay");
            info.Company     = rdr.GetString("Company");
            info.Department  = rdr.GetString("Department");
            return(info);
        }
Exemple #7
0
        /// <summary>
        /// 通过数据读取器生成实体类
        /// </summary>
        /// <param name="rdr"></param>
        /// <returns></returns>
        private static AuthorEntity GetEntityFromrdr(NullableDataReader rdr)
        {
            AuthorEntity info = new AuthorEntity();

            info.ID          = rdr.GetInt32("ID");
            info.UserID      = rdr.GetInt32("UserID");
            info.Type        = rdr.GetString("Type");
            info.Name        = rdr.GetString("Name");
            info.IsPassed    = rdr.GetBoolean("IsPassed");
            info.IsTop       = rdr.GetBoolean("IsTop");
            info.IsElite     = rdr.GetBoolean("IsElite");
            info.Hits        = rdr.GetInt32("Hits");
            info.LastUseTime = rdr.GetNullableDateTime("LastUseTime");
            info.TemplateID  = rdr.GetInt32("TemplateID");
            info.AuthorPic   = rdr.GetString("AuthorPic");
            info.AuthorIntro = rdr.GetString("AuthorIntro");
            info.Address     = rdr.GetString("Address");
            info.Tel         = rdr.GetString("Tel");
            info.Fax         = rdr.GetString("Fax");
            info.Mail        = rdr.GetString("Mail");
            info.Email       = rdr.GetString("Email");
            info.ZipCode     = rdr.GetInt32("ZipCode");
            info.HomePage    = rdr.GetString("HomePage");
            info.Im          = rdr.GetString("Im");
            info.Sex         = rdr.GetInt16("Sex");
            info.BirthDay    = rdr.GetNullableDateTime("BirthDay");
            info.Company     = rdr.GetString("Company");
            info.Department  = rdr.GetString("Department");
            return(info);
        }
        /// <summary>
        /// 通过数据读取器生成实体类
        /// </summary>
        /// <param name="rdr"></param>
        /// <returns></returns>
        private static SourceEntity GetEntityFromrdr(NullableDataReader rdr)
        {
            SourceEntity info = new SourceEntity();

            info.ID          = rdr.GetInt32("ID");
            info.Type        = rdr.GetString("Type");
            info.Name        = rdr.GetString("Name");
            info.IsPassed    = rdr.GetBoolean("IsPassed");
            info.IsTop       = rdr.GetBoolean("IsTop");
            info.IsElite     = rdr.GetBoolean("IsElite");
            info.Hits        = rdr.GetInt32("Hits");
            info.LastUseTime = rdr.GetNullableDateTime("LastUseTime");
            info.Photo       = rdr.GetString("Photo");
            info.Intro       = rdr.GetString("Intro");
            info.Address     = rdr.GetString("Address");
            info.Tel         = rdr.GetString("Tel");
            info.Fax         = rdr.GetString("Fax");
            info.Mail        = rdr.GetString("Mail");
            info.Email       = rdr.GetString("Email");
            info.ZipCode     = rdr.GetInt32("ZipCode");
            info.HomePage    = rdr.GetString("HomePage");
            info.Im          = rdr.GetString("Im");
            info.Contacter   = rdr.GetString("Contacter");
            return(info);
        }
Exemple #9
0
 private void Fill(out Pais oObj, NullableDataReader dr)
 {
     oObj = new Pais(dr.GetInt16("codigoPais"),
                     dr.GetNullableString("descripcion") == null ? "" : dr.GetString("descripcion"),
                     dr.GetNullableString("gentilicio") == null ? "" : dr.GetString("gentilicio"),
                     dr.GetBoolean("tieneConvenio"),
                     dr.GetBoolean("mercosur")
                     );
 }
        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);
        }
        public IList <QuestionInfo> GetQuestonsByUser(string userName, int startRowIndex, int maximumRows, int searchType, string keyword)
        {
            Database  database          = DatabaseFactory.CreateDatabase();
            DbCommand storedProcCommand = database.GetStoredProcCommand("PR_Common_GetListBySortColumn");

            database.AddInParameter(storedProcCommand, "@StartRows", DbType.Int32, startRowIndex);
            database.AddInParameter(storedProcCommand, "@PageSize", DbType.Int32, maximumRows);
            database.AddInParameter(storedProcCommand, "@PrimaryColumn", DbType.String, "ID");
            database.AddInParameter(storedProcCommand, "@SortColumnDbType", DbType.String, "DateTime");
            database.AddInParameter(storedProcCommand, "@SortColumn", DbType.String, "LastUpdateTime");
            database.AddInParameter(storedProcCommand, "@StrColumn", DbType.String, "ID, QuestionTitle, LastUpdateTime, ReplyTime,ReplyCreator, IsReply, IsSolved");
            database.AddInParameter(storedProcCommand, "@Sorts", DbType.String, "DESC");
            database.AddInParameter(storedProcCommand, "@TableName", DbType.String, "PE_Question");
            database.AddInParameter(storedProcCommand, "@Filter", DbType.String);
            database.AddOutParameter(storedProcCommand, "@Total", DbType.Int32, maximumRows);
            string str = " QuestionCreator = '" + DBHelper.FilterBadChar(userName) + "' ";

            switch (searchType)
            {
            case 1:
                str = str + " AND IsReply = 1 AND IsSolved = 0 ";
                storedProcCommand.Parameters["@SortColumn"].Value = "ReplyTime";
                break;

            case 2:
                str = str + " AND IsSolved = 1 ";
                break;

            case 3:
                if (!string.IsNullOrEmpty(keyword))
                {
                    str = str + " AND QuestionTitle LIKE '%" + DBHelper.FilterBadChar(keyword) + "%' ";
                }
                break;
            }
            storedProcCommand.Parameters["@Filter"].Value = str;
            IList <QuestionInfo> list = new List <QuestionInfo>();

            using (NullableDataReader reader = new NullableDataReader(database.ExecuteReader(storedProcCommand)))
            {
                while (reader.Read())
                {
                    QuestionInfo item = new QuestionInfo();
                    item.Id                 = reader.GetInt32("ID");
                    item.QuestionTitle      = reader.GetString("QuestionTitle");
                    item.QuestionCreateTime = reader.GetDateTime("LastUpdateTime");
                    item.ReplyTime          = reader.GetNullableDateTime("ReplyTime");
                    item.IsReply            = reader.GetBoolean("IsReply");
                    item.IsSolved           = reader.GetBoolean("IsSolved");
                    item.ReplyCreator       = reader.GetString("ReplyCreator");
                    list.Add(item);
                }
            }
            this.m_TotalCount = (int)database.GetParameterValue(storedProcCommand, "@Total");
            return(list);
        }
Exemple #12
0
        private static UserInfo UsersFromrdr(NullableDataReader rdr)
        {
            UserInfo info = new UserInfo();

            info.UserId                              = rdr.GetInt32("UserID");
            info.GroupId                             = rdr.GetInt32("GroupID");
            info.CompanyId                           = rdr.GetInt32("CompanyID");
            info.ClientId                            = rdr.GetInt32("ClientID");
            info.UserType                            = (UserType)rdr.GetInt32("UserType");
            info.UserName                            = rdr.GetString("UserName");
            info.UserPassword                        = rdr.GetString("UserPassword");
            info.LastPassword                        = rdr.GetString("LastPassword");
            info.PayPassword                         = rdr.GetString("PayPassword");
            info.Question                            = rdr.GetString("Question");
            info.Answer                              = rdr.GetString("Answer");
            info.Email                               = rdr.GetString("Email");
            info.Sex                                 = (UserSexType)rdr.GetInt32("Sex");
            info.RegTime                             = rdr.GetDateTime("RegTime");
            info.JoinTime                            = rdr.GetDateTime("JoinTime");
            info.LogOnTimes                          = rdr.GetInt32("LoginTimes");
            info.LastLogOnTime                       = rdr.GetNullableDateTime("LastLoginTime");
            info.LastPresentTime                     = rdr.GetNullableDateTime("LastPresentTime");
            info.LastLogOnIP                         = rdr.GetString("LastLoginIP");
            info.LastPasswordChangedTime             = rdr.GetNullableDateTime("LastPasswordChangedTime");
            info.LastLockoutTime                     = rdr.GetNullableDateTime("LastLockoutTime");
            info.FailedPasswordAttemptCount          = rdr.GetInt32("FailedPasswordAttemptCount");
            info.FirstFailedPasswordAttempTime       = rdr.GetNullableDateTime("FirstFailedPasswordAttempTime");
            info.FailedPasswordAnswerAttempCount     = rdr.GetInt32("FailedPasswordAnswerAttempCount");
            info.FirstFailedPasswordAnswerAttempTime = rdr.GetNullableDateTime("FirstFailedPasswordAnswerAttempTime");
            info.Status                              = (UserStatus)rdr.GetInt32("Status");
            info.CheckNum                            = rdr.GetString("CheckNum");
            info.EnableResetPassword                 = rdr.GetBoolean("EnableResetPassword");
            info.UserFace                            = rdr.GetString("UserFace");
            info.FaceWidth                           = rdr.GetInt32("FaceWidth");
            info.FaceHeight                          = rdr.GetInt32("FaceHeight");
            info.Sign                                = rdr.GetString("Sign");
            info.PrivacySetting                      = rdr.GetInt32("PrivacySetting");
            info.Balance                             = rdr.GetDecimal("Balance");
            info.UserPoint                           = rdr.GetInt32("UserPoint");
            info.UserExp                             = rdr.GetInt32("UserExp");
            info.ConsumeMoney                        = rdr.GetInt32("ConsumeMoney");
            info.ConsumePoint                        = rdr.GetInt32("ConsumePoint");
            info.ConsumeExp                          = rdr.GetInt32("ConsumeExp");
            info.PostItems                           = rdr.GetInt32("PostItems");
            info.PassedItems                         = rdr.GetInt32("PassedItems");
            info.RejectItems                         = rdr.GetInt32("RejectItems");
            info.DelItems                            = rdr.GetInt32("DelItems");
            info.EndTime                             = rdr.GetNullableDateTime("EndTime");
            info.IsInheritGroupRole                  = rdr.GetBoolean("IsInheritGroupRole");
            info.UserSetting                         = rdr.GetString("UserSetting");
            info.UserFriendGroup                     = rdr.GetString("UserFriendGroup");
            info.UserTrueName                        = rdr.GetString("TrueName");
            return(info);
        }
Exemple #13
0
        public bool ImportData(string zoneId, string importDatabase)
        {
            bool          flag;
            Database      db      = DatabaseFactory.CreateDatabase();
            StringBuilder builder = new StringBuilder("");

            builder.Append(" SELECT ZoneID, ZoneName, ZoneJSName, ZoneIntro, ZoneType, DefaultSetting, ZoneSetting, ZoneWidth, ZoneHeight, ShowType, Active, UpdateTime FROM PE_AdZone ");
            OleDbConnection connection = new OleDbConnection("Provider = Microsoft.Jet.OleDb.4.0;Data Source = " + importDatabase);

            try
            {
                connection.Open();
                builder.Append("Where ZoneID IN (" + zoneId + ") ORDER BY ZoneID");
                OleDbCommand       command = new OleDbCommand(builder.ToString(), connection);
                NullableDataReader reader  = new NullableDataReader(command.ExecuteReader(CommandBehavior.CloseConnection));
                while (reader.Read())
                {
                    ADZoneInfo adZoneInfo = new ADZoneInfo();
                    adZoneInfo.ZoneId         = GetMaxADZoneId();
                    adZoneInfo.ZoneName       = reader.GetString("ZoneName");
                    adZoneInfo.ZoneJSName     = reader.GetString("ZoneJSName");
                    adZoneInfo.ZoneIntro      = reader.GetString("ZoneIntro");
                    adZoneInfo.ZoneType       = (ADZoneType)reader.GetInt32("ZoneType");
                    adZoneInfo.DefaultSetting = reader.GetBoolean("DefaultSetting");
                    adZoneInfo.Setting        = reader.GetString("ZoneSetting");
                    adZoneInfo.ZoneWidth      = reader.GetInt32("ZoneWidth");
                    adZoneInfo.ZoneHeight     = reader.GetInt32("ZoneHeight");
                    adZoneInfo.ShowType       = reader.GetInt32("ShowType");
                    adZoneInfo.Active         = reader.GetBoolean("Active");
                    adZoneInfo.UpdateTime     = reader.GetDateTime("UpdateTime");
                    DbCommand command2 = GetProcdbComm(db, "PR_Ad_ADZone_ADD", adZoneInfo);
                    try
                    {
                        db.ExecuteNonQuery(command2);
                        continue;
                    }
                    catch
                    {
                        reader.Close();
                        return(false);
                    }
                }
                flag = true;
            }
            catch
            {
                flag = false;
            }
            finally
            {
                connection.Close();
            }
            return(flag);
        }
Exemple #14
0
        /// <summary>
        /// 通过数据读取器生成实体类
        /// </summary>
        /// <param name="rdr"></param>
        /// <returns></returns>
        private static SiteLinkEntity GetEntityFromrdr(NullableDataReader rdr)
        {
            SiteLinkEntity info = new SiteLinkEntity();

            info.InsideLinkID = rdr.GetInt32("InsideLinkID");
            info.Source       = rdr.GetString("Source");
            info.ReplaceUrl   = rdr.GetString("ReplaceUrl");
            info.Priority     = rdr.GetInt32("Priority");
            info.ReplaceTimes = rdr.GetInt32("ReplaceTimes");
            info.IsNewOpen    = rdr.GetBoolean("IsNewOpen");
            info.IsEnabled    = rdr.GetBoolean("IsEnabled");
            return(info);
        }
Exemple #15
0
 private static EasyOne.Model.Collection.CollectionListRuleInfo CollectionListRuleInfo(NullableDataReader rdr)
 {
     EasyOne.Model.Collection.CollectionListRuleInfo info = new EasyOne.Model.Collection.CollectionListRuleInfo();
     info.ItemId                = rdr.GetInt32("ItemId");
     info.ListBeginCode         = rdr.GetString("ListBeginCode");
     info.ListEndCode           = rdr.GetString("ListEndCode");
     info.LinkBeginCode         = rdr.GetString("LinkBeginCode");
     info.LinkEndCode           = rdr.GetString("LinkEndCode");
     info.IsLinkSpecialSolution = rdr.GetBoolean("IsLinkSpecialSolution");
     info.RedirectUrl           = rdr.GetString("RedirectUrl");
     info.UsePaging             = rdr.GetBoolean("UsePaging");
     return(info);
 }
        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);
        }
        /// <summary>
        /// 通过数据读取器生成实体类
        /// </summary>
        /// <param name="rdr"></param>
        /// <returns></returns>
        private static CollectionListRulesEntity GetEntityFromrdr(NullableDataReader rdr)
        {
            CollectionListRulesEntity info = new CollectionListRulesEntity();

            info.ItemID                = rdr.GetInt32("ItemID");
            info.ListBeginCode         = rdr.GetString("ListBeginCode");
            info.ListEndCode           = rdr.GetString("ListEndCode");
            info.LinkBeginCode         = rdr.GetString("LinkBeginCode");
            info.LinkEndCode           = rdr.GetString("LinkEndCode");
            info.IsLinkSpecialSolution = rdr.GetBoolean("IsLinkSpecialSolution");
            info.RedirectUrl           = rdr.GetString("RedirectUrl");
            info.IsUsePaging           = rdr.GetBoolean("IsUsePaging");
            return(info);
        }
Exemple #19
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);
        }
Exemple #20
0
 private static EasyOne.Model.Accessories.WordReplaceInfo WordReplaceInfo(NullableDataReader rdr)
 {
     EasyOne.Model.Accessories.WordReplaceInfo info = new EasyOne.Model.Accessories.WordReplaceInfo();
     info.ItemId       = rdr.GetInt32("ItemId");
     info.SourceWord   = rdr.GetString("SourceWord");
     info.TargetWord   = rdr.GetString("TargetWord");
     info.ReplaceType  = rdr.GetInt32("ReplaceType");
     info.Priority     = rdr.GetInt32("Priority");
     info.ReplaceTimes = rdr.GetInt32("ReplaceTimes");
     info.OpenType     = rdr.GetBoolean("OpenType");
     info.IsEnabled    = rdr.GetBoolean("IsEnabled");
     info.Title        = rdr.GetString("Title");
     return(info);
 }
Exemple #21
0
        private static PaymentTypeInfo PaymentTypeFromrdr(NullableDataReader rdr)
        {
            PaymentTypeInfo info = new PaymentTypeInfo();

            info.TypeId     = rdr.GetInt32("TypeId");
            info.TypeName   = rdr.GetString("TypeName");
            info.Intro      = rdr.GetString("Intro");
            info.Discount   = Convert.IsDBNull(rdr["Discount"]) ? 0f : float.Parse(rdr["Discount"].ToString(), (IFormatProvider)null);
            info.IsDefault  = rdr.GetBoolean("IsDefault");
            info.IsDisabled = rdr.GetBoolean("IsDisabled");
            info.OrderId    = rdr.GetInt32("OrderId");
            info.Category   = rdr.GetInt32("Category");
            return(info);
        }
Exemple #22
0
        private static NodeInfo NodesFromrdr(NullableDataReader rdr)
        {
            NodeInfo info = new NodeInfo();

            info.NodeId                   = rdr.GetInt32("NodeID");
            info.NodeIdentifier           = rdr.GetString("NodeIdentifier");
            info.NodeType                 = (NodeType)rdr.GetInt32("NodeType");
            info.ParentId                 = rdr.GetInt32("ParentID");
            info.ParentPath               = rdr.GetString("ParentPath");
            info.Depth                    = rdr.GetInt32("Depth");
            info.RootId                   = rdr.GetInt32("RootID");
            info.Child                    = rdr.GetInt32("Child");
            info.ArrChildId               = rdr.GetString("ArrChildID");
            info.PrevId                   = rdr.GetInt32("PrevID");
            info.NextId                   = rdr.GetInt32("NextID");
            info.OrderId                  = rdr.GetInt32("OrderID");
            info.NodeDir                  = rdr.GetString("NodeDir");
            info.ParentDir                = rdr.GetString("ParentDir");
            info.NodeName                 = rdr.GetString("NodeName");
            info.Tips                     = rdr.GetString("Tips");
            info.Description              = rdr.GetString("Description");
            info.NodePicUrl               = rdr.GetString("NodePicUrl");
            info.MetaKeywords             = rdr.GetString("Meta_Keywords");
            info.MetaDescription          = rdr.GetString("Meta_Description");
            info.ShowOnMenu               = rdr.GetBoolean("ShowOnMenu");
            info.ShowOnPath               = rdr.GetBoolean("ShowOnPath");
            info.ShowOnMap                = rdr.GetBoolean("ShowOnMap");
            info.ShowOnListIndex          = rdr.GetBoolean("ShowOnList_Index");
            info.ShowOnListParent         = rdr.GetBoolean("ShowOnList_Parent");
            info.PurviewType              = rdr.GetInt32("PurviewType");
            info.Creater                  = rdr.GetString("Creater");
            info.InheritPurviewFromParent = rdr.GetInt32("InheritPurviewFromParent");
            info.WorkFlowId               = rdr.GetInt32("WorkFlowID");
            info.HitsOfHot                = rdr.GetInt32("HitsOfHot");
            info.OpenType                 = rdr.GetInt32("OpenType");
            info.ItemCount                = rdr.GetInt32("ItemCount");
            info.ItemChecked              = rdr.GetInt32("ItemChecked");
            info.CommentCount             = rdr.GetInt32("CommentCount");
            info.CustomContent            = rdr.GetString("Custom_Content");
            info.IsCreateContentPage      = rdr.GetBoolean("IsCreateContentPage");
            info.IsCreateListPage         = rdr.GetBoolean("IsCreateListPage");
            info.AutoCreateHtmlType       = (AutoCreateHtmlType)rdr.GetInt32("AutoCreateHtmlType");
            info.ContentPageHtmlRule      = rdr.GetString("ContentPageHtmlRule");
            info.ListPageHtmlRule         = rdr.GetString("ListPageHtmlRule");
            info.ListPageSavePathType     = (ListPagePathType)rdr.GetInt32("ListPageSavePathType");
            info.ListPagePostfix          = rdr.GetString("ListPagePostFix");
            info.RelateNode               = rdr.GetString("RelateNode");
            info.RelateSpecial            = rdr.GetString("RelateSpecial");
            info.ItemAspxFileName         = rdr.GetString("ItemAspxFileName");
            info.DefaultTemplateFile      = rdr.GetString("DefaultTemplateFile");
            info.ContainChildTemplateFile = rdr.GetString("ContainChildTemplateFile");
            info.ItemOpenType             = rdr.GetInt32("ItemOpenType");
            info.ItemListOrderType        = rdr.GetInt32("ItemListOrderType");
            info.ItemPageSize             = rdr.GetInt32("ItemPageSize");
            info.LinkUrl                  = rdr.GetString("LinkUrl");
            info.Settings                 = DeserializeSettings(rdr.GetString("Settings"));
            info.NeedCreateHtml           = rdr.GetBoolean("NeedCreateHtml");
            return(info);
        }
Exemple #23
0
        private static TrademarkInfo trademarkInfoFromrdataReader(NullableDataReader dataReader)
        {
            TrademarkInfo info = new TrademarkInfo();

            info.TrademarkId    = dataReader.GetInt32("TrademarkID");
            info.TrademarkType  = dataReader.GetInt32("TrademarkType");
            info.ProducerId     = dataReader.GetInt32("ProducerID");
            info.TrademarkName  = dataReader.GetString("TrademarkName");
            info.TrademarkIntro = dataReader.GetString("TrademarkIntro");
            info.Passed         = dataReader.GetBoolean("Passed");
            info.OnTop          = dataReader.GetBoolean("OnTop");
            info.IsElite        = dataReader.GetBoolean("IsElite");
            info.TrademarkPhoto = dataReader.GetString("TrademarkPhoto");
            return(info);
        }
Exemple #24
0
        public static List <Estado> TraerEstadosRegBajaPorPerfil(string perfil, bool esBaja)
        {
            string        sql          = "RelacionTipoPerfilEstadoReg_TxPerfil";
            Database      db           = DatabaseFactory.CreateDatabase("DAT_V01");
            DbCommand     dbCommand    = db.GetStoredProcCommand(sql);
            List <Estado> oListEstados = new List <Estado>();

            try
            {
                db.AddInParameter(dbCommand, "@perfil", DbType.String, perfil);
                db.AddInParameter(dbCommand, "@esBaja", DbType.Boolean, esBaja);

                using (NullableDataReader dr = new NullableDataReader(db.ExecuteReader(dbCommand)))
                {
                    while (dr.Read())
                    {
                        oListEstados.Add(new Estado(dr.GetByte("IdEstadoReg"),
                                                    dr.GetString("DescripcionEstadoReg"),
                                                    dr.GetBoolean("EsBaja")));
                    }
                }
                return(oListEstados);
            }
            catch (Exception ex)
            {
                log.Error(string.Format("{0}->{1}-> - Error:{2}->{3}", DateTime.Now, System.Reflection.MethodBase.GetCurrentMethod(), ex.Source, ex.Message));
                throw ex;
            }
            finally
            {
            }
        }
        /// <summary>
        /// 通过数据读取器生成实体类
        /// </summary>
        /// <param name="rdr"></param>
        /// <returns></returns>
        private static WordReplaceItemEntity GetEntityFromrdr(NullableDataReader rdr)
        {
            WordReplaceItemEntity info = new WordReplaceItemEntity();

            info.ItemID       = rdr.GetInt32("ItemID");
            info.SourceWord   = rdr.GetString("SourceWord");
            info.TargetWord   = rdr.GetString("TargetWord");
            info.ReplaceType  = rdr.GetInt32("ReplaceType");
            info.ScopesType   = rdr.GetInt32("ScopesType");
            info.ReplaceTimes = rdr.GetInt32("ReplaceTimes");
            info.Priority     = rdr.GetInt32("Priority");
            info.IsNewOpen    = rdr.GetBoolean("IsNewOpen");
            info.IsEnabled    = rdr.GetBoolean("IsEnabled");
            info.Title        = rdr.GetString("Title");
            return(info);
        }
        /// <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);
        }
Exemple #27
0
 private void Fill(out Banco oObj, NullableDataReader dr)
 {
     oObj = new Banco(dr.GetInt16("id_Banco"),
                      dr.GetNullableString("descripcion") == null  ? "" : dr.GetString("descripcion"),
                      dr.GetBoolean("frecuente"),
                      dr.GetNullableString("webSite") == null ?"":dr.GetString("webSite")
                      );
 }
Exemple #28
0
        /// <summary>
        /// 通过数据读取器生成实体类
        /// </summary>
        /// <param name="rdr"></param>
        /// <returns></returns>
        private static BankEntity GetEntityFromrdr(NullableDataReader rdr)
        {
            BankEntity info = new BankEntity();

            info.BankID        = rdr.GetInt32("BankID");
            info.BankShortName = rdr.GetString("BankShortName");
            info.BankName      = rdr.GetString("BankName");
            info.Accounts      = rdr.GetString("Accounts");
            info.CardNum       = rdr.GetString("CardNum");
            info.HolderName    = rdr.GetString("HolderName");
            info.BankIntro     = rdr.GetString("BankIntro");
            info.BankPic       = rdr.GetString("BankPic");
            info.OrderSort     = rdr.GetInt32("OrderSort");
            info.IsDefault     = rdr.GetBoolean("IsDefault");
            info.IsDisabled    = rdr.GetBoolean("IsDisabled");
            return(info);
        }
Exemple #29
0
        /// <summary>
        /// 通过数据读取器生成实体类
        /// </summary>
        /// <param name="rdr"></param>
        /// <returns></returns>
        private static SpecialCategoryEntity GetEntityFromrdr(NullableDataReader rdr)
        {
            SpecialCategoryEntity info = new SpecialCategoryEntity();

            info.SpecialCategoryID   = rdr.GetInt32("SpecialCategoryID");
            info.SpecialCategoryName = rdr.GetString("SpecialCategoryName");
            info.SpecialCategoryDir  = rdr.GetString("SpecialCategoryDir");
            info.SpecialTemplatePath = rdr.GetString("SpecialTemplatePath");
            info.OrderSort           = rdr.GetInt32("OrderSort");
            info.IsNewOpen           = rdr.GetBoolean("IsNewOpen");
            info.Description         = rdr.GetString("Description");
            info.IsCreateHtml        = rdr.GetBoolean("IsCreateHtml");
            info.PagePostfix         = rdr.GetString("PagePostfix");
            info.SearchTemplatePath  = rdr.GetString("SearchTemplatePath");
            info.IsNeedCreateHtml    = rdr.GetBoolean("IsNeedCreateHtml");
            return(info);
        }
Exemple #30
0
        private static SpecialCategoryInfo SpecialCategoryInfoFromrdr(NullableDataReader rdr)
        {
            SpecialCategoryInfo info = new SpecialCategoryInfo();

            info.SpecialCategoryId   = rdr.GetInt32("SpecialCategoryID");
            info.SpecialCategoryDir  = rdr.GetString("SpecialCategoryDir");
            info.SpecialCategoryName = rdr.GetString("SpecialCategoryName");
            info.SpecialTemplatePath = rdr.GetString("SpecialTemplatePath");
            info.SearchTemplatePath  = rdr.GetString("SearchTemplatePath");
            info.OrderId             = rdr.GetInt32("OrderId");
            info.OpenType            = rdr.GetBoolean("OpenType");
            info.Description         = rdr.GetString("Description");
            info.IsCreateHtml        = rdr.GetBoolean("IsCreateHtml");
            info.PagePostfix         = rdr.GetString("PagePostfix");
            info.NeedCreateHtml      = rdr.GetBoolean("NeedCreateHtml");
            return(info);
        }