Пример #1
0
 /// <summary>
 /// 高分学员详细页面
 /// </summary>
 /// <param name="Id"></param>
 /// <returns></returns>
 public JiaJiNewWebModel.LernerScore MaxStuContent(int LearnSorceID)
 {
     try
     {
         string sql = "update learnsorce set HeatHot=HeatHot+1 where learnsorce.LearnSorceID=" + LearnSorceID + ";";
         sql += "SELECT a.LearnSorceID,a.LearnerID,a.Sorce,a.LearnerGonsis,c.LearnName,c.LearnImage,a.LearnerContent,a.HeatHot,a.LanguageID,b.LanguageName from learnsorce a INNER JOIN `languages` b on a.LanguageID = b.LanguageID INNER JOIN learner c on a.LearnerID = c.LearnerID INNER JOIN country d on c.CountryID = d.CountryID where a.LearnSorceID = " + LearnSorceID + "";
         LernerScore la = new LernerScore();
         DataTable   dt = MySqlDB.GetDataTable(sql, CommandType.Text, null);
         la.LearnSorceID   = (int)dt.Rows[0]["LearnSorceID"];
         la.LearnerID      = (int)dt.Rows[0]["LearnerID"];
         la.Sorce          = dt.Rows[0]["Sorce"].ToString();
         la.LearnerGonsis  = dt.Rows[0]["LearnerGonsis"].ToString();
         la.LearnName      = dt.Rows[0]["LearnName"].ToString();
         la.LanguageID     = (int)dt.Rows[0]["LanguageID"];
         la.LanguageName   = dt.Rows[0]["LanguageName"].ToString();
         la.LearnImage     = dt.Rows[0]["LearnImage"].ToString();
         la.LearnerContent = dt.Rows[0]["LearnerContent"].ToString();
         la.HeatHot        = (int)dt.Rows[0]["HeatHot"];
         return(la);
     }
     catch (Exception ex)
     {
         Log4netHelper.WriteLog("错误报告", ex);
         throw ex;
     }
 }
Пример #2
0
        ///<summary>
        ///上一个导航标题
        ///<para>Id:导航标题Id</para>
        /// </summary>
        public NavInfoModel GetModelByIdPrev(int Id)
        {
            try
            {
                NavInfoModel model = new NavInfoModel();
                DataTable    dt1   = MySqlDB.GetDataTable("select min(NavId) from navinfo where NavTitleTwo!=''", CommandType.Text, null);
                int          Sid   = (int)dt1.Rows[0][0];

                if (Id == Sid)
                {
                    model.NavTitleTwo = "已是第一章了";
                    return(model);
                }
                else
                {
                    string           sql  = "select *  from navinfo where NavId <@Id and NavTitleTwo!='' order by NavId desc limit 1";
                    MySqlParameter[] para =
                    {
                        new MySqlParameter("@Id", Id)
                    };
                    DataTable dt = MySqlDB.GetDataTable(sql, CommandType.Text, para);
                    model.NavId       = (int)dt.Rows[0]["NavId"];
                    model.NavTitleTwo = dt.Rows[0]["NavTitleTwo"].ToString();
                    Log4netHelper.WriteLog("日志报告");
                    return(model);
                }
            }
            catch (Exception ex)
            {
                Log4netHelper.WriteLog("错误报告", ex);
                throw ex;
            }
        }
Пример #3
0
 ///<summary>
 ///下一个导航标题
 ///<para>Id:导航标题Id</para>
 /// </summary>
 public NavInfoModel GetModelByIdNext(int Id)
 {
     try
     {
         NavInfoModel infor = new NavInfoModel();
         DataTable    dt1   = MySqlDB.GetDataTable("select MAX(NavId) from navinfo where NavTitleTwo!=''", CommandType.Text, null);
         int          Sid   = (int)dt1.Rows[0][0];
         if (Id >= Sid)
         {
             infor.NavTitleTwo = "已经是最后一章了";
             return(infor);
         }
         else
         {
             string           sql  = "select *  from navinfo  where NavId >@Id and NavTitleTwo!='' LIMIT 1";
             MySqlParameter[] para =
             {
                 new MySqlParameter("@Id", Id)
             };
             DataTable dt = MySqlDB.GetDataTable(sql, CommandType.Text, para);
             infor.NavId       = (int)dt.Rows[0]["NavId"];
             infor.NavTitleTwo = dt.Rows[0]["NavTitleTwo"].ToString();
             Log4netHelper.WriteLog("日志报告");
             return(infor);
         }
     }
     catch (Exception ex)
     {
         Log4netHelper.WriteLog("错误报告", ex);
         throw ex;
     }
 }
Пример #4
0
        ///<summary>
        ///上一个攻略
        ///<para>Id:攻略Id</para>
        /// </summary>
        public JiaJiNewWebModel.Strategy StrategyPrev(int Id)
        {
            try
            {
                Strategy  model = new Strategy();
                DataTable dt1   = MySqlDB.GetDataTable("select min(StrategyID) from strategy", CommandType.Text, null);
                int       Sid   = (int)dt1.Rows[0][0];

                if (Id == Sid)
                {
                    model.StrategyTitle = "已是第一章了";
                    return(model);
                }
                else
                {
                    string           sql  = "select *  from strategy where StrategyID <@Id order by StrategyID desc limit 1";
                    MySqlParameter[] para =
                    {
                        new MySqlParameter("@Id", Id)
                    };
                    DataTable dt = MySqlDB.GetDataTable(sql, CommandType.Text, para);
                    model.StrategyID    = (int)dt.Rows[0]["StrategyID"];
                    model.StrategyTitle = dt.Rows[0]["StrategyTitle"].ToString();
                    Log4netHelper.WriteLog("日志报告");
                    return(model);
                }
            }
            catch (Exception ex)
            {
                Log4netHelper.WriteLog("错误报告", ex);
                throw ex;
            }
        }
Пример #5
0
        ///<summary>
        ///上一个留学资讯
        ///<para>Id:成功案列Id</para>
        /// </summary>
        public Information InforPrev(int Id)
        {
            try
            {
                Information model = new Information();
                DataTable   dt1   = MySqlDB.GetDataTable("select min(InformationID) from information", CommandType.Text, null);
                int         Sid   = (int)dt1.Rows[0][0];

                if (Id == Sid)
                {
                    model.Title = "已是第一章了";
                    return(model);
                }
                else
                {
                    string           sql  = "select *  from information where InformationID <@Id order by InformationID desc limit 1";
                    MySqlParameter[] para =
                    {
                        new MySqlParameter("@Id", Id)
                    };
                    DataTable dt = MySqlDB.GetDataTable(sql, CommandType.Text, para);
                    model.InformationID = (int)dt.Rows[0]["InformationID"];
                    model.Title         = dt.Rows[0]["Title"].ToString();
                    Log4netHelper.WriteLog("日志报告");
                    return(model);
                }
            }
            catch (Exception ex)
            {
                Log4netHelper.WriteLog("错误报告", ex);
                throw ex;
            }
        }
Пример #6
0
        ///<summary>
        ///上一个背景提升项目
        ///<para>Id:背景提升项目Id</para>
        /// </summary>
        public JiaJiNewWebModel.projectItem ProjectItemPrev(int Id)
        {
            try
            {
                projectItem model = new projectItem();
                DataTable   dt1   = MySqlDB.GetDataTable("select min(Pro_ID) from projectitem", CommandType.Text, null);
                int         Sid   = (int)dt1.Rows[0][0];

                if (Id == Sid)
                {
                    model.Pro_Name = "已是第一章了";
                    return(model);
                }
                else
                {
                    string           sql  = "select *  from projectitem  where Pro_ID <@Id order by Pro_ID desc limit 1";
                    MySqlParameter[] para =
                    {
                        new MySqlParameter("@Id", Id)
                    };
                    DataTable dt = MySqlDB.GetDataTable(sql, CommandType.Text, para);
                    model.Pro_ID   = (int)dt.Rows[0]["Pro_ID"];
                    model.Pro_Name = dt.Rows[0]["Pro_Name"].ToString();
                    Log4netHelper.WriteLog("日志报告");
                    return(model);
                }
            }
            catch (Exception ex)
            {
                Log4netHelper.WriteLog("错误报告", ex);
                throw ex;
            }
        }
Пример #7
0
        ///<summary>
        ///观点详情
        /// </summary>
        public Option OptionShow(int Id)
        {
            try
            {
                string sql1 = "update `optioninfo` set OptionHot=OptionHot+1 where OptionID='" + Id + "'";
                MySqlDB.nonquery(sql1, CommandType.Text, null);
                string    sql = "select * from `optioninfo` where OptionID='" + Id + "' ";
                DataTable dt  = MySqlDB.GetDataTable(sql, CommandType.Text, null);
                Option    op  = MySqlDB.fanshemodel <Option>(dt);
                //DataTable dt = MySqlDB.GetDataTable(sql, CommandType.Text, null);
                //Option op = new Option();
                //op.OptionTitle = dt.Rows[0]["OptionTitle"].ToString();
                //op.OptionContent = dt.Rows[0]["OptionContent"].ToString();
                //op.Author = dt.Rows[0]["Author"].ToString();
                //op.Source = dt.Rows[0]["Source"].ToString();
                //op.Date = dt.Rows[0]["Date"].ToString();
                //op.OptionHot = (int)dt.Rows[0]["OptionHot"];

                return(op);
            }
            catch (Exception ex)
            {
                Log4netHelper.WriteLog("错误报告", ex);
                throw ex;
            }
        }
Пример #8
0
        ///<summary>
        ///上一个成功案列
        ///<para>Id:成功案列Id</para>
        /// </summary>
        public SuccessInfor SuccessPrev(int Id)
        {
            try
            {
                SuccessInfor infor = new SuccessInfor();
                DataTable    dt1   = MySqlDB.GetDataTable("select min(SRelationID) from successful_relation", CommandType.Text, null);
                int          Sid   = (int)dt1.Rows[0][0];

                if (Id == Sid)
                {
                    infor.SuccessTitle = "已是第一章了";
                    return(infor);
                }
                else
                {
                    string           sql  = "select *  from successful_relation a INNER JOIN successful e ON a.SuccessID = e.SuccessID  where SRelationID <@Id order by SRelationID desc limit 1";
                    MySqlParameter[] para =
                    {
                        new MySqlParameter("@Id", Id)
                    };
                    DataTable dt = MySqlDB.GetDataTable(sql, CommandType.Text, para);
                    infor.SuccessID    = (int)dt.Rows[0]["SRelationID"];
                    infor.SuccessTitle = dt.Rows[0]["SuccessTitle"].ToString();
                    Log4netHelper.WriteLog("日志报告");
                    return(infor);
                }
            }
            catch (Exception ex)
            {
                Log4netHelper.WriteLog("错误报告", ex);
                throw ex;
            }
        }
Пример #9
0
        ///// <summary>
        ///// 根据热度显示资讯列表(分页)
        ///// </summary>
        ///// <param name="pageindex"></param>
        ///// <returns></returns>
        //public List<Information> GetInformationList(int pageindex, int pagesize, out int rowcounts)
        //{
        //    string sql = "SELECT SQL_CALC_FOUND_ROWS * FROM information ORDER BY ReadCount DESC LIMIT " + (pageindex - 1) * pagesize + ", " + pagesize + ";SELECT FOUND_ROWS(); ";
        //    List<Information> list = MySqlDB.GetList<Information>(sql, System.Data.CommandType.Text, null);
        //    foreach (var item in list)
        //    {
        //        if (item.Content.Length > 50)
        //        {
        //            item.Content = item.Content.ToString().Substring(0, 25);
        //        }
        //    }
        //    string sql2 = "select count(1) from information";
        //    rowcounts = MySqlDB.scalar(sql2, System.Data.CommandType.Text, null);
        //    return list;
        //}


        /// <summary>
        /// 活动详情
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public Active ActiveShow(int Id)
        {
            try
            {
                string           sql1 = "update active set HeatID=HeatID+1 where ActiveID=@Id ";
                string           sql  = "select * from active left join areases on active.Site=areases.AreaID where ActiveID=@Id";
                MySqlParameter[] para =
                {
                    new MySqlParameter("@Id", Id)
                };
                MySqlDB.nonquery(sql1, CommandType.Text, para);
                DataTable dt     = MySqlDB.GetDataTable(sql, CommandType.Text, para);
                Active    active = new Active();
                active.ActiveID      = (int)dt.Rows[0]["ActiveID"];
                active.ActiveTitle   = dt.Rows[0]["ActiveTitle"].ToString();
                active.ActiveDate    = dt.Rows[0]["ActiveDate"].ToString();
                active.Site          = Convert.ToInt32(dt.Rows[0]["Site"]);
                active.Datails       = dt.Rows[0]["Datails"].ToString();
                active.ActivePhone   = dt.Rows[0]["ActivePhone"].ToString();
                active.HeatID        = (int)dt.Rows[0]["HeatID"];
                active.AreaID        = (int)dt.Rows[0]["AreaID"];
                active.AreaName      = dt.Rows[0]["AreaName"].ToString();
                active.ActiveKeyWord = dt.Rows[0]["ActiveKeyWord"].ToString();

                Log4netHelper.WriteLog("日至报告");
                return(active);
            }
            catch (Exception ex)
            {
                Log4netHelper.WriteLog("错误日志", ex);
                return(null);
            }
        }
Пример #10
0
        ///<summary>
        ///规划详情
        ///<para>Id:规划ID</para>
        /// </summary>
        public StudentProgram StudentShow(int Id)
        {
            try
            {
                string sql1 = "update `studentprogram` set ReadCount=ReadCount+1 where StudentProgramID=" + Id + "";
                MySqlDB.nonquery(sql1, CommandType.Text, null);
                string           sql  = "select * from studentprogram left join country on studentprogram.CountryID=country.CountryID left join educationtype on studentprogram.EducationID=educationtype.EducationID where StudentProgramID = @Id";
                MySqlParameter[] para =
                {
                    new MySqlParameter("@Id", Id)
                };
                DataTable      dt      = MySqlDB.GetDataTable(sql, CommandType.Text, para);
                StudentProgram student = new StudentProgram();
                student.Author = dt.Rows[0]["Author"].ToString();
                //student.Image = Convert.ToBase64String((byte[])dt.Rows[0]["Image"]);
                student.CountryName           = dt.Rows[0]["CountryName"].ToString();
                student.EducationName         = dt.Rows[0]["EducationName"].ToString();
                student.ReadCount             = (int)dt.Rows[0]["ReadCount"];
                student.StudentProgramContent = dt.Rows[0]["StudentProgramContent"].ToString();
                student.StudentProgramTitle   = dt.Rows[0]["StudentProgramTitle"].ToString();
                student.Source         = dt.Rows[0]["Source"].ToString();
                student.StudentKeyWord = dt.Rows[0]["StudentKeyWord"].ToString();
                student.StudentProfile = dt.Rows[0]["StudentProfile"].ToString();
                student.Imageurl       = dt.Rows[0]["Imageurl"].ToString();

                Log4netHelper.WriteLog("日志报告");
                return(student);
            }
            catch (Exception ex)
            {
                Log4netHelper.WriteLog("错误日志", ex);
                throw ex;
            }
        }
Пример #11
0
        ///<summary>
        ///上一个活动
        ///<para>Id:活动Id</para>
        /// </summary>
        public JiaJiNewWebModel.Active activePrev(int Id)
        {
            try
            {
                Active    model = new Active();
                DataTable dt1   = MySqlDB.GetDataTable("select min(ActiveID) from active", CommandType.Text, null);
                int       Sid   = (int)dt1.Rows[0][0];

                if (Id == Sid)
                {
                    model.ActiveTitle = "已是第一章了";
                    return(model);
                }
                else
                {
                    string           sql  = "select *  from active left join areases on active.Site=areases.AreaID where ActiveID <@Id order by ActiveID desc limit 1";
                    MySqlParameter[] para =
                    {
                        new MySqlParameter("@Id", Id)
                    };
                    DataTable dt = MySqlDB.GetDataTable(sql, CommandType.Text, para);
                    model.ActiveID    = (int)dt.Rows[0]["ActiveID"];
                    model.ActiveTitle = dt.Rows[0]["ActiveTitle"].ToString();
                    Log4netHelper.WriteLog("日志报告");
                    return(model);
                }
            }
            catch (Exception ex)
            {
                Log4netHelper.WriteLog("错误报告", ex);
                throw ex;
            }
        }
Пример #12
0
 ///<summary>
 ///下一个规划
 ///<para>Id:成功案列Id</para>
 /// </summary>
 public StudentProgram StudentNext(int Id)
 {
     try
     {
         StudentProgram infor = new StudentProgram();
         DataTable      dt1   = MySqlDB.GetDataTable("select MAX(StudentProgramID) from studentprogram", CommandType.Text, null);
         int            Sid   = (int)dt1.Rows[0][0];
         if (Id >= Sid)
         {
             infor.StudentProgramTitle = "已经是最后一章了";
             return(infor);
         }
         else
         {
             string           sql  = "select *  from studentprogram where StudentProgramID >@Id LIMIT 1";
             MySqlParameter[] para =
             {
                 new MySqlParameter("@Id", Id)
             };
             DataTable dt = MySqlDB.GetDataTable(sql, CommandType.Text, para);
             infor.StudentProgramID    = (int)dt.Rows[0]["StudentProgramID"];
             infor.StudentProgramTitle = dt.Rows[0]["StudentProgramTitle"].ToString();
             Log4netHelper.WriteLog("日志报告");
             return(infor);
         }
     }
     catch (Exception ex)
     {
         Log4netHelper.WriteLog("错误报告", ex);
         return(null);
     }
 }
Пример #13
0
        ///<summary>
        ///上一个规划
        ///<para>Id:成功案列Id</para>
        /// </summary>
        public StudentProgram StudentPrev(int Id)
        {
            try
            {
                StudentProgram stu = new StudentProgram();
                DataTable      dt1 = MySqlDB.GetDataTable("select min(StudentProgramID) from studentprogram", CommandType.Text, null);
                int            Sid = (int)dt1.Rows[0][0];

                if (Id == Sid)
                {
                    stu.StudentProgramTitle = "已是第一章了";
                    return(stu);
                }
                else
                {
                    string           sql  = "select *  from studentprogram where StudentProgramID <@Id order by StudentProgramID desc limit 1";
                    MySqlParameter[] para =
                    {
                        new MySqlParameter("@Id", Id)
                    };

                    DataTable dt = MySqlDB.GetDataTable(sql, CommandType.Text, para);
                    stu.StudentProgramID    = (int)dt.Rows[0]["StudentProgramID"];
                    stu.StudentProgramTitle = dt.Rows[0]["StudentProgramTitle"].ToString();
                    Log4netHelper.WriteLog("日志报告");
                    return(stu);
                }
            }
            catch (Exception ex)
            {
                Log4netHelper.WriteLog("错误报告", ex);
                throw ex;
            }
        }
Пример #14
0
 ///<summary>
 ///下一个高分学员
 ///<para>Id:高分学员Id</para>
 /// </summary>
 public JiaJiNewWebModel.LernerScore MaxStuContentNext(int Id)
 {
     try
     {
         LernerScore infor = new LernerScore();
         DataTable   dt1   = MySqlDB.GetDataTable("select MAX(LearnSorceID) from learnsorce", CommandType.Text, null);
         int         Sid   = (int)dt1.Rows[0][0];
         if (Id >= Sid)
         {
             infor.LearnerGonsis = "已经是最后一章了";
             return(infor);
         }
         else
         {
             string           sql  = "SELECT a.LearnSorceID,a.LearnerID,a.Sorce,a.LearnerGonsis,c.LearnName,c.LearnImage,a.LearnerContent,a.HeatHot from learnsorce a INNER JOIN `languages` b on a.LanguageID=b.LanguageID INNER JOIN learner c on a.LearnerID = c.LearnerID where a.LearnSorceID >@Id LIMIT 1";
             MySqlParameter[] para =
             {
                 new MySqlParameter("@Id", Id)
             };
             DataTable dt = MySqlDB.GetDataTable(sql, CommandType.Text, para);
             infor.LearnSorceID  = (int)dt.Rows[0]["LearnSorceID"];
             infor.LearnerGonsis = dt.Rows[0]["LearnerGonsis"].ToString();
             Log4netHelper.WriteLog("日志报告");
             return(infor);
         }
     }
     catch (Exception ex)
     {
         Log4netHelper.WriteLog("错误报告", ex);
         throw ex;
     }
 }
Пример #15
0
        ///<summary>
        ///获取资讯详情
        ///informationID:资讯ID
        /// </summary>
        public Information InformationShow(int InformationID)
        {
            try
            {
                string           sql1 = "UPDATE information set ReadCount=ReadCount+1 where InformationID=@Id";
                string           sql  = "select * from information where InformationID=@Id";
                MySqlParameter[] para =
                {
                    new MySqlParameter("@Id", InformationID)
                };
                MySqlDB.nonquery(sql1, CommandType.Text, para);
                DataTable   dt   = MySqlDB.GetDataTable(sql, CommandType.Text, para);
                Information info = new Information();
                info.InformationID     = (int)dt.Rows[0]["InformationID"];
                info.Title             = dt.Rows[0]["Title"].ToString();
                info.content           = dt.Rows[0]["Content"].ToString();
                info.InfoDate          = dt.Rows[0]["InfoDate"].ToString();
                info.Source            = dt.Rows[0]["Source"].ToString();
                info.Author            = dt.Rows[0]["Author"].ToString();
                info.ReadCount         = (int)dt.Rows[0]["ReadCount"];
                info.InfoKeyWord       = dt.Rows[0]["InfoKeyWord"].ToString();
                info.InformationImgUrl = dt.Rows[0]["InformationImgUrl"].ToString();

                Log4netHelper.WriteLog("日志报告");
                return(info);
            }
            catch (Exception ex)
            {
                Log4netHelper.WriteLog("错误报告", ex);
                return(null);
            }
        }
Пример #16
0
        /// <summary>
        /// 顾问内容
        /// </summary>
        /// <param name="Id">顾问ID</param>
        /// <returns></returns>
        public List <TeamInfor> ContentShow(int Id)
        {
            try
            {
                string           sql  = "select d.TitleName,c.Content from  team a INNER JOIN term_relation b on a.TeamID = b.TeamID INNER JOIN team_content c on b.ContentID = c.ContentID INNER JOIN team_title d on b.TeamTitleID = d.TeamTitleID where a.TeamID = @Id";
                MySqlParameter[] para =
                {
                    new MySqlParameter("@Id", Id)
                };
                List <TeamInfor> list = new List <TeamInfor>();
                DataTable        dt   = MySqlDB.GetDataTable(sql, CommandType.Text, para);
                foreach (DataRow item in dt.Rows)
                {
                    TeamInfor team = new TeamInfor();
                    team.Title   = item["TitleName"].ToString();
                    team.Content = item["Content"].ToString();
                    list.Add(team);
                }

                Log4netHelper.WriteLog("日志报告");
                return(list);
            }
            catch (Exception ex)
            {
                Log4netHelper.WriteLog("错误报告", ex);
                throw ex;
            }
        }
Пример #17
0
 ///<summary>
 ///下一个活动
 ///<para>Id:活动Id</para>
 /// </summary>
 public JiaJiNewWebModel.Strategy StrategyNext(int Id)
 {
     try
     {
         Strategy  infor = new Strategy();
         DataTable dt1   = MySqlDB.GetDataTable("select MAX(StrategyID) from strategy", CommandType.Text, null);
         int       Sid   = (int)dt1.Rows[0][0];
         if (Id >= Sid)
         {
             infor.StrategyTitle = "已经是最后一章了";
             return(infor);
         }
         else
         {
             string           sql  = "select *  from strategy where StrategyID >@Id LIMIT 1";
             MySqlParameter[] para =
             {
                 new MySqlParameter("@Id", Id)
             };
             DataTable dt = MySqlDB.GetDataTable(sql, CommandType.Text, para);
             infor.StrategyID    = (int)dt.Rows[0]["StrategyID"];
             infor.StrategyTitle = dt.Rows[0]["StrategyTitle"].ToString();
             Log4netHelper.WriteLog("日志报告");
             return(infor);
         }
     }
     catch (Exception ex)
     {
         Log4netHelper.WriteLog("错误报告", ex);
         throw ex;
     }
 }
Пример #18
0
 ///<summary>
 ///下一个留学资讯
 ///<para>Id:成功案列Id</para>
 /// </summary>
 public Information InforNext(int Id)
 {
     try
     {
         Information infor = new Information();
         DataTable   dt1   = MySqlDB.GetDataTable("select MAX(InformationID) from information", CommandType.Text, null);
         int         Sid   = (int)dt1.Rows[0][0];
         if (Id >= Sid)
         {
             infor.Title = "已经是最后一章了";
             return(infor);
         }
         else
         {
             string           sql  = "select *  from information  where InformationID >@Id LIMIT 1";
             MySqlParameter[] para =
             {
                 new MySqlParameter("@Id", Id)
             };
             DataTable dt = MySqlDB.GetDataTable(sql, CommandType.Text, para);
             infor.InformationID = (int)dt.Rows[0]["InformationID"];
             infor.Title         = dt.Rows[0]["Title"].ToString();
             Log4netHelper.WriteLog("日志报告");
             return(infor);
         }
     }
     catch (Exception ex)
     {
         Log4netHelper.WriteLog("错误报告", ex);
         throw ex;
     }
 }
Пример #19
0
 ///<summary>
 ///下一个背景提升项目
 ///<para>Id:背景提升项目Id</para>
 /// </summary>
 public JiaJiNewWebModel.projectItem ProjectItemNext(int Id)
 {
     try
     {
         projectItem infor = new projectItem();
         DataTable   dt1   = MySqlDB.GetDataTable("select MAX(Pro_ID) from projectitem", CommandType.Text, null);
         int         Sid   = (int)dt1.Rows[0][0];
         if (Id >= Sid)
         {
             infor.Pro_Name = "已经是最后一章了";
             return(infor);
         }
         else
         {
             string           sql  = "select *  from projectitem WHERE Pro_ID >@Id LIMIT 1";
             MySqlParameter[] para =
             {
                 new MySqlParameter("@Id", Id)
             };
             DataTable dt = MySqlDB.GetDataTable(sql, CommandType.Text, para);
             infor.Pro_ID   = (int)dt.Rows[0]["Pro_ID"];
             infor.Pro_Name = dt.Rows[0]["Pro_Name"].ToString();
             Log4netHelper.WriteLog("日志报告");
             return(infor);
         }
     }
     catch (Exception ex)
     {
         Log4netHelper.WriteLog("错误报告", ex);
         throw ex;
     }
 }
Пример #20
0
 /// <summary>
 /// 团队显示成功案例文章
 /// </summary>
 /// <param name="Id"></param>
 /// <returns></returns>
 public Team TeamSuccessContent(int Id)
 {
     try
     {
         string           sql  = "select * from team where TeamID=@Id";
         MySqlParameter[] para =
         {
             new MySqlParameter("@Id", Id)
         };
         DataTable dt = MySqlDB.GetDataTable(sql, CommandType.Text, para);
         Team      t  = new Team();
         t.Name           = dt.Rows[0][1].ToString();
         t.Position       = dt.Rows[0][2].ToString();
         t.ShenQing       = dt.Rows[0][4].ToString();
         t.WorkDate       = dt.Rows[0][3].ToString();
         t.Image2         = dt.Rows[0][6].ToString();
         t.SuccessCount   = dt.Rows[0]["SuccessCount"].ToString();
         t.SuccessContent = dt.Rows[0]["SuccessContent"].ToString();
         t.SuccessKeyWord = dt.Rows[0]["SuccessKeyWord"].ToString();
         Log4netHelper.WriteLog("日志报告");
         return(t);
     }
     catch (Exception ex)
     {
         Log4netHelper.WriteLog("错误报告", ex);
         throw ex;
     }
 }
Пример #21
0
 ///<summary>
 ///攻略详情
 /// </summary>
 /// <param name="Id"></param>
 /// <returns></returns>
 public Strategy StrategyShow(int Id)
 {
     try
     {
         string sql = "update strategy set StrategyReadCount=StrategyReadCount+1 where StrategyID=" + Id + ";";
         sql += "select * from strategy where StrategyID=" + Id + "";
         DataTable dt       = MySqlDB.GetDataTable(sql, CommandType.Text, null);
         Strategy  strategy = new Strategy();
         strategy.StrategyTitle     = dt.Rows[0]["StrategyTitle"].ToString();
         strategy.StrategyDate      = dt.Rows[0]["StrategyDate"].ToString();
         strategy.StrategyProfile   = dt.Rows[0]["StrategyProfile"].ToString();
         strategy.StrategyKeyWord   = dt.Rows[0]["StrategyKeyWord"].ToString();
         strategy.StrategyReadCount = Convert.ToInt32(dt.Rows[0]["StrategyReadCount"]);
         strategy.StrategyAuthor    = dt.Rows[0]["StrategyAuthor"].ToString();
         strategy.StrategyContent   = dt.Rows[0]["StrategyContent"].ToString();
         strategy.Img = dt.Rows[0]["Img"].ToString();
         Log4netHelper.WriteLog("日志报告");
         return(strategy);
     }
     catch (Exception ex)
     {
         Log4netHelper.WriteLog("错误报告", ex);
         throw ex;
     }
 }
Пример #22
0
 ///<summary>
 ///下一个活动
 ///<para>Id:活动Id</para>
 /// </summary>
 public JiaJiNewWebModel.Active activeNext(int Id)
 {
     try
     {
         Active    infor = new Active();
         DataTable dt1   = MySqlDB.GetDataTable("select MAX(ActiveID) from active", CommandType.Text, null);
         int       Sid   = (int)dt1.Rows[0][0];
         if (Id >= Sid)
         {
             infor.ActiveTitle = "已经是最后一章了";
             return(infor);
         }
         else
         {
             string           sql  = "select *  from active left join areases on active.Site=areases.AreaID where ActiveID >@Id LIMIT 1";
             MySqlParameter[] para =
             {
                 new MySqlParameter("@Id", Id)
             };
             DataTable dt = MySqlDB.GetDataTable(sql, CommandType.Text, para);
             infor.ActiveID    = (int)dt.Rows[0]["ActiveID"];
             infor.ActiveTitle = dt.Rows[0]["ActiveTitle"].ToString();
             Log4netHelper.WriteLog("日志报告");
             return(infor);
         }
     }
     catch (Exception ex)
     {
         Log4netHelper.WriteLog("错误报告", ex);
         throw ex;
     }
 }
Пример #23
0
        public List <NavInfoModel> GetNavInfo(string GuoJia, int ParentId, string BuWei)
        {
            List <NavInfoModel> list     = new List <NavInfoModel>();
            DataTable           dt       = new DataTable();
            NavInfoModel        NavModel = null;

            try
            {
                string           sql  = "select * from NavInfo where GuoJia=@GuoJia and NavParentID=@NavParentID and BuWei=@BuWei order by PaiXu";
                MySqlParameter[] para =
                {
                    new MySqlParameter("@GuoJia",      GuoJia),
                    new MySqlParameter("@NavParentID", ParentId),
                    new MySqlParameter("@BuWei",       BuWei)
                };
                dt = MySqlDB.GetDataTable(sql, System.Data.CommandType.Text, para);
                foreach (DataRow dr in dt.Rows)
                {
                    NavModel               = new NavInfoModel();
                    NavModel.NavId         = Convert.ToInt32(dr["NavID"]);//NavID NavTitleOne  NavContentOne   NavParentID  NavTypeID  NavIsLevel    NavDate    NavCreateBy   NavHeat   NavTitleTwo   NavContentTwo  GuoJia  BuWei   PaiXu  depth   LinkFor
                    NavModel.NavTitleOne   = dr["NavTitleOne"].ToString();
                    NavModel.NavContentOne = dr["NavContentOne"].ToString();
                    NavModel.NavParentId   = Convert.ToInt32(dr["NavParentID"]);
                    NavModel.NavType       = dr["NavTypeID"].ToString();
                    NavModel.NavIsLevel    = Convert.ToInt32(dr["NavIsLevel"]);
                    if (!string.IsNullOrEmpty(dr["NavDate"].ToString()))
                    {
                        NavModel.NavDate = Convert.ToDateTime(dr["NavDate"]);
                    }
                    NavModel.NavCreateBy = dr["NavCreateBy"].ToString();
                    if (!string.IsNullOrEmpty(dr["NavHeat"].ToString()))
                    {
                        NavModel.NavHeat = Convert.ToInt32(dr["NavHeat"]);
                    }
                    NavModel.NavTitleTwo   = dr["NavTitleTwo"].ToString();
                    NavModel.NavContentTwo = dr["NavContentTwo"].ToString();
                    NavModel.GuoJia        = dr["GuoJia"].ToString();
                    NavModel.BuWei         = dr["BuWei"].ToString();
                    NavModel.PaiXu         = Convert.ToInt32(dr["PaiXu"]);
                    NavModel.Depth         = Convert.ToInt32(dr["depth"]);
                    NavModel.LinkFor       = dr["LinkFor"].ToString();
                    NavModel.KeyWord       = dr["KeyWord"].ToString();
                    list.Add(NavModel);
                }
            }
            catch (Exception ex)
            {
                Log4netHelper.WriteLog("错误报告", ex);
                throw ex;
            }
            return(list);
        }
Пример #24
0
 /// <summary>
 /// 分公司信息
 /// </summary>
 /// <param name="FilialeId">公司id</param>
 /// <returns></returns>
 public filialetext GetFilialetext(int FilialeId)
 {
     try
     {
         //string sql = "select  FilialeId,FilialeName,FilialeTexts,FilialeTextAddr,FilialeTextPhone from filiale INNER JOIN filialetext on filiale.FilialeTextId = filialetext.FilialeTextId where FilialeId = "+FilialeId;
         string    sql   = "SELECT * from filialetext LEFT JOIN filiale on filialetext.FilialeId=filiale.FilialeId where filialetext.FilialeId =" + FilialeId + " LIMIT 1";
         DataTable model = MySqlDB.GetDataTable(sql, CommandType.Text, null);
         return(MySqlDB.fanshemodel <filialetext>(model));
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
Пример #25
0
 ///<summary>
 ///获取移民项目详情
 /// </summary>
 /// <para>Id:项目ID</para>
 /// <returns></returns>
 public Project ImmigrantShow(int Id)
 {
     try
     {
         string sql = "update project set ProjectReadCount=ProjectReadCount+1 where ProjectID=" + Id + ";";
         sql += "select * from project where ProjectID='" + Id + "'";
         DataTable dt  = MySqlDB.GetDataTable(sql, CommandType.Text, null);
         Project   pro = MySqlDB.fanshemodel <Project>(dt);
         return(pro);
     }
     catch (Exception ex)
     {
         Log4netHelper.WriteLog("错误报告", ex);
         throw ex;
     }
 }
Пример #26
0
 ///<summary>
 ///获取背景提升项目详情
 /// </summary>
 /// <para>Id:项目ID</para>
 /// <returns></returns>
 public projectItem ProjectItemShow(int Id)
 {
     try
     {
         string sql = "update projectitem set Pro_ReadCount=Pro_ReadCount+1 where Pro_ID=" + Id + ";";
         sql += "select * from projectitem where Pro_ID=" + Id + "";
         DataTable   dt  = MySqlDB.GetDataTable(sql, CommandType.Text, null);
         projectItem pro = MySqlDB.fanshemodel <projectItem>(dt);
         return(pro);
     }
     catch (Exception ex)
     {
         Log4netHelper.WriteLog("错误报告", ex);
         throw ex;
     }
 }
Пример #27
0
        /// <summary>
        /// 获取成功案列详细信息
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public SuccessInfor SuccessfulShow(int Id)
        {
            try
            {
                //string sql = "select * from successful_relation " +
                //    "INNER JOIN student d ON a.StudentID = d.StudentID " +
                //    "INNER JOIN country b ON d.CountryID = b.CountryID " +
                //     "INNER JOIN educationtype c ON d.EducationID = c.EducationID " +
                //     "INNER JOIN successful e ON a.SuccessID = e.SuccessID " +
                //     "INNER JOIN college f ON a.CollegeID = f.CollegeID where a.SRelationID=@Id";

                StringBuilder sql = new StringBuilder();
                sql.Append(" select * from successful_relation ");
                sql.Append(" left join successful on successful_relation.SuccessID=successful.SuccessID ");
                sql.Append(" left join student on student.StudentID=successful_relation.StudentID ");
                sql.Append(" LEFT JOIN college on college.CollegeID=student.CollegeID ");
                sql.Append(" left join educationtype on educationtype.EducationID=student.EducationID ");
                sql.Append(" left join country on country.CountryID=student.CountryID ");
                sql.Append(" where successful_relation.SRelationID=@Id ");

                MySqlParameter[] para =
                {
                    new MySqlParameter("@Id", Id)
                };
                DataTable    dt    = MySqlDB.GetDataTable(sql.ToString(), CommandType.Text, para);
                SuccessInfor infor = new SuccessInfor();
                infor.StudentName = dt.Rows[0]["StudentName"].ToString();
                //infor.CollegeID =(int)dt.Rows[0]["CollegeID"];
                infor.CollegeName    = dt.Rows[0]["CollegeName"].ToString();
                infor.CountryName    = dt.Rows[0]["CountryName"].ToString();
                infor.EducationName  = dt.Rows[0]["EducationName"].ToString();
                infor.JiuDuXueyuan   = dt.Rows[0]["JiuDuXueyuan"].ToString();
                infor.Score          = dt.Rows[0]["Score"].ToString();
                infor.SuccessContent = dt.Rows[0]["SuccessContent"].ToString();
                infor.SuccessDate    = dt.Rows[0]["SuccessDate"].ToString();
                infor.SuccessTitle   = dt.Rows[0]["SuccessTitle"].ToString();

                Log4netHelper.WriteLog("日志报告");
                return(infor);
            }
            catch (Exception ex)
            {
                Log4netHelper.WriteLog("错误报告", ex);
                throw ex;
            }
        }
Пример #28
0
 /// <summary>
 /// 语言类别
 /// <para>Id:语言ID</para>
 /// </summary>
 /// <returns></returns>
 public Language LanguageShow(int Id)
 {
     try
     {
         string    sql = "select * from Languages where LanguageID='" + Id + "'";
         Language  la  = new Language();
         DataTable dt  = MySqlDB.GetDataTable(sql, CommandType.Text, null);
         la.LanguageName    = dt.Rows[0]["LanguageName"].ToString();
         la.LanguageTitle   = dt.Rows[0]["LanguageTitle"].ToString();
         la.LanguageContent = dt.Rows[0]["LanguageContent"].ToString();
         return(la);
     }
     catch (Exception ex)
     {
         Log4netHelper.WriteLog("错误报告", ex);
         throw ex;
     }
 }
Пример #29
0
        /// <summary>
        /// 通过团队ID查找其成功案例
        /// </summary>
        /// <param name="teamid">团队ID</param>
        /// <returns></returns>
        public List <SuccessfulAnLi> GetAnliByTeam(int teamid)
        {
            //    string sql = @"SELECT * from successful where SuccessID in
            //(SELECT SuccessID from team_anli where TeamID = " + teamid + ")";

            string                sql  = @"SELECT * from successful where successful.SuccessID in
        (SELECT SuccessID from team_anli where TeamID = " + teamid + ")";
            DataTable             dt   = MySqlDB.GetDataTable(sql, CommandType.Text, default(MySqlParameter[]));
            List <SuccessfulAnLi> list = new List <SuccessfulAnLi>();

            foreach (DataRow item in dt.Rows)
            {
                SuccessfulAnLi anLi = new SuccessfulAnLi();
                anLi.SuccessID    = Convert.ToInt32(item["SuccessID"]);
                anLi.SuccessTitle = item["SuccessTitle"].ToString();
                list.Add(anLi);
            }
            return(list);
        }
Пример #30
0
        ///<summary>
        ///成功案列
        ///<param name="Id">顾问ID</param>
        /// </summary>
        public string SuccessCount(int Id)
        {
            try
            {
                string           sql  = @"SELECT count(1) as 'count' FROM successful_relation WHERE StudentID in
(select StudentID from teamrelation where TeamID = @Id)";
                MySqlParameter[] para =
                {
                    new MySqlParameter("@Id", Id)
                };
                DataTable dt    = MySqlDB.GetDataTable(sql, CommandType.Text, para);
                string    count = dt.Rows[0][0].ToString();
                Log4netHelper.WriteLog("日志报告");
                return(count);
            }
            catch (Exception ex)
            {
                Log4netHelper.WriteLog("错误报告", ex);
                throw ex;
            }
        }