Beispiel #1
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;
            }
        }
Beispiel #2
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;
     }
 }
Beispiel #3
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;
     }
 }