/// <summary> /// 获取前多少的值 /// </summary> /// <param name="strWhere">条件,可以为空</param> /// <param name="TopNumber">数量</param> /// <returns>返回DataTable</returns> public static DataTable Join_JiaoLvTestTopGet(string strWhere, int TopNumber) { string strSql; if (!string.IsNullOrEmpty(strWhere.Trim())) { strSql = "SELECT TOP " + TopNumber.ToString() + " * FROM [Join_JiaoLvTest] WHERE " + strWhere + ";"; } else { strSql = "SELECT TOP " + TopNumber.ToString() + " * FROM [Join_JiaoLvTest] ;"; } return(SqlDB.ExecuteDataset(strCon, CommandType.Text, strSql).Tables[0]); }
/// <summary> /// 获取前多少的值 /// </summary> /// <param name="strWhere">条件,可以为空</param> /// <param name="TopNumber">数量</param> /// <returns>返回DataTable</returns> public static DataTable ProfessionalArticleTopGet(string strWhere, int TopNumber) { string strSql; if (!string.IsNullOrEmpty(strWhere.Trim())) { strSql = "SELECT TOP " + TopNumber.ToString() + " * FROM [ProfessionalArticle] WHERE " + strWhere + ";"; } else { strSql = "SELECT TOP " + TopNumber.ToString() + " * FROM [ProfessionalArticle] ;"; } return(SqlDB.ExecuteDataset(CommandType.Text, strSql).Tables[0]); }
/// <summary> /// 获取所有的的值 /// </summary> /// <param name="strWhere">条件,可以为空</param> /// <returns>返回DataTable</returns> public static DataTable ProfessionalArticleList(string strWhere) { string strSql; if (!string.IsNullOrEmpty(strWhere.Trim())) { strSql = "SELECT * FROM [ProfessionalArticle] WHERE " + strWhere + ";"; } else { strSql = "SELECT * FROM [ProfessionalArticle] ;"; } return(SqlDB.ExecuteDataset(CommandType.Text, strSql).Tables[0]); }
///// <summary> ///// 暂停该值 ///// </summary> ///// <param name="TestTitle">自增id的值</param> ///// <returns>暂停成功返回ture,否则返回false</returns> //public static bool Join_TestPause(Entity.Join_Test info) //{ // int intReturnValue = 0; // intReturnValue = SqlDB.ExecuteNonQuery(strCon,CommandType.Text, "UPDATE [Join_Test] SET IsPause = "+ info.IsPause +" WHERE TestTitle = " + info.TestTitle); // if(intReturnValue == 1) // return true; // return false; //} /// <summary> /// 获取所有的的值 /// </summary> /// <param name="strWhere">条件,可以为空</param> /// <returns>返回DataTable</returns> public static DataTable Join_TestList(string strWhere) { string strSql; if (!string.IsNullOrEmpty(strWhere.Trim())) { strSql = "SELECT * FROM [Join_Test] WHERE " + strWhere + ";"; } else { strSql = "SELECT * FROM [Join_Test] ;"; } return(SqlDB.ExecuteDataset(strCon, CommandType.Text, strSql).Tables[0]); }
/// <summary> /// 暂停该值 /// </summary> /// <param name="id">自增id的值</param> /// <returns>暂停成功返回ture,否则返回false</returns> //public static bool StudentZhiYuanPause(Entity.StudentZhiYuan info) //{ // int intReturnValue = 0; // intReturnValue = SqlDB.ExecuteNonQuery(CommandType.Text, "UPDATE [StudentZhiYuan] SET IsPause = "+ info.IsPause +" WHERE id = " + info.id); // if(intReturnValue == 1) // return true; // return false; //} /// <summary> /// 获取所有的的值 /// </summary> /// <param name="strWhere">条件,可以为空</param> /// <returns>返回DataTable</returns> public static DataTable StudentZhiYuanList(string strWhere) { string strSql; if (!string.IsNullOrEmpty(strWhere.Trim())) { strSql = "SELECT * FROM [StudentZhiYuan] WHERE " + strWhere + ";"; } else { strSql = "SELECT * FROM [StudentZhiYuan] ;"; } return(SqlDB.ExecuteDataset(CommandType.Text, strSql).Tables[0]); }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="TestId">标识</param> /// <returns>返回Entity</returns> public static Entity.Join_QiZhiTest Join_QiZhiTestEntityGet(int TestId) { Entity.Join_QiZhiTest info = new Entity.Join_QiZhiTest(); DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.Text, "SELECT * FROM [Join_QiZhiTest] WHERE TestId = " + TestId + ";").Tables[0]; if (dt.Rows.Count > 0) { info.TestId = Basic.Utils.StrToInt(dt.Rows[0]["TestId"].ToString(), 0); info.TestNumber = Basic.Utils.StrToInt(dt.Rows[0]["TestNumber"].ToString(), 0); info.TestTitle = dt.Rows[0]["TestTitle"].ToString(); info.TestType = dt.Rows[0]["TestType"].ToString(); } return(info); }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="ProvinceID">标识</param> /// <returns>返回Entity</returns> public static Entity.S_District S_DistrictEntityGet(int CityID) { Entity.S_District info = new Entity.S_District(); DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.Text, "SELECT * FROM [S_District] WHERE CityID = " + CityID + ";").Tables[0]; if (dt.Rows.Count > 0) { info.DistrictName = dt.Rows[0]["DistrictName"].ToString(); return(info); } else { return(null); } }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="Id">标识</param> /// <returns>返回Entity</returns> public static Entity.ProfessionalZhiYeRelation ProfessionalZhiYeRelationEntityGet(int Id) { Entity.ProfessionalZhiYeRelation info = new Entity.ProfessionalZhiYeRelation(); DataTable dt = SqlDB.ExecuteDataset(CommandType.Text, "SELECT * FROM [ProfessionalZhiYeRelation] WHERE Id = " + Id + ";").Tables[0]; if (dt.Rows.Count > 0) { info.Id = Basic.Utils.StrToInt(dt.Rows[0]["Id"].ToString(), 0); info.ZhiYeId = Basic.Utils.StrToInt(dt.Rows[0]["ZhiYeId"].ToString(), 0); info.ProfessionalId = Basic.Utils.StrToInt(dt.Rows[0]["ProfessionalId"].ToString(), 0); info.ProfessionalCode = dt.Rows[0]["ProfessionalCode"].ToString(); info.ProfessionalName = dt.Rows[0]["ProfessionalName"].ToString(); } return(info); }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="ProvinceID">标识</param> /// <returns>返回Entity</returns> public static Entity.S_Province S_ProvinceEntityGet(int ProvinceID) { Entity.S_Province info = new Entity.S_Province(); DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.Text, "SELECT * FROM [S_Province] WHERE ProvinceID = " + ProvinceID + ";").Tables[0]; if (dt.Rows.Count > 0) { info.ProvinceName = dt.Rows[0]["ProvinceName"].ToString(); return(info); } else { return(null); } }
/// <summary> /// 加盟商所代理项目 /// </summary> /// <param name="Did"></param> /// <param name="PCid"></param> /// <param name="PageSize"></param> /// <param name="PageIndex"></param> /// <returns></returns> public static DataTable Join_ProjectPageListForDaiLiFenPei(int Did, int PCid, int PageSize, int PageIndex) { String strSQL = "SELECT P.ProjectId,P.ProjectName,P.Content,PR.* FROM [Join_Project] AS P,[Join_ProjectRelated] AS PR,[Join_JiaMengDianProject] AS JMDP WHERE P.ProjectId = PR.Pid AND PR.IsValid = 1 AND P.IsValid = 1 AND P.IsPause = 0 AND P.PCid = " + PCid + "AND P.ProjectId = JMDP.Pid AND JMDP.Did = " + Did; //strSQL = strSQL + " AND PR.Pid NOT IN (SELECT * FROM [Join_JiaMengDianProject] WHERE Did = "+ Did +")"; strSQL = strSQL + " ORDER BY PR.Pid DESC"; DataSet ds = new DataSet(); ds = SqlDB.ExecuteDataset((PageIndex - 1) * PageSize, PageSize, strCon, CommandType.Text, strSQL); if (ds.Tables.Count > 0) { return(ds.Tables[0]); } return(new DataTable()); }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="Id">标识</param> /// <returns>返回Entity</returns> public static Entity.SchoolDisciplines SchoolDisciplinesEntityGet(int Id) { Entity.SchoolDisciplines info = new Entity.SchoolDisciplines(); DataTable dt = SqlDB.ExecuteDataset(CommandType.Text, "SELECT * FROM [SchoolDisciplines] WHERE Id = " + Id + ";").Tables[0]; if (dt.Rows.Count > 0) { info.Id = Basic.Utils.StrToInt(dt.Rows[0]["Id"].ToString(), 0); info.SchoolId = Basic.Utils.StrToInt(dt.Rows[0]["SchoolId"].ToString(), 0); info.DisciplinesId = Basic.Utils.StrToInt(dt.Rows[0]["DisciplinesId"].ToString(), 0); info.ProfessionalCount = Basic.Utils.StrToInt(dt.Rows[0]["ProfessionalCount"].ToString(), 0); info.IsPause = Basic.Utils.StrToInt(dt.Rows[0]["IsPause"].ToString(), 0); } return(info); }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="AnswerId">标识</param> /// <returns>返回Entity</returns> public static Entity.Join_16PfAnswer Join_16PfAnswerEntityGet(int AnswerId) { Entity.Join_16PfAnswer info = new Entity.Join_16PfAnswer(); DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.Text, "SELECT * FROM [Join_16PfAnswer] WHERE AnswerId = " + AnswerId + ";").Tables[0]; if (dt.Rows.Count > 0) { info.AnswerId = Basic.Utils.StrToInt(dt.Rows[0]["AnswerId"].ToString(), 0); info.AnswerContent = dt.Rows[0]["AnswerContent"].ToString(); info.Fraction = Basic.Utils.StrToInt(dt.Rows[0]["Fraction"].ToString(), 0); info.TestId = Basic.Utils.StrToInt(dt.Rows[0]["TestId"].ToString(), 0); info.Option = dt.Rows[0]["Option"].ToString(); } return(info); }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="OldId">标识</param> /// <returns>返回Entity</returns> public static Entity.ShiJuan2TiMu ShiJuan2TiMuEntityGet(int OldId) { Entity.ShiJuan2TiMu info = new Entity.ShiJuan2TiMu(); DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.Text, "SELECT * FROM [ShiJuan2TiMu] WHERE OldId = " + OldId + ";").Tables[0]; if (dt.Rows.Count > 0) { info.OldId = Basic.Utils.StrToInt(dt.Rows[0]["OldId"].ToString(), 0); info.exam_id = Basic.Utils.StrToInt(dt.Rows[0]["exam_id"].ToString(), 0); info.question_id = dt.Rows[0]["question_id"].ToString(); info.q_index = Basic.Utils.StrToInt(dt.Rows[0]["q_index"].ToString(), 0); info.subject_id = Basic.Utils.StrToInt(dt.Rows[0]["subject_id"].ToString(), 0); info.Id = Basic.Utils.StrToInt(dt.Rows[0]["Id"].ToString(), 0); } return(info); }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="Id">标识</param> /// <returns>返回Entity</returns> public static Entity.StudentShouCang StudentShouCangEntityGet(int Id) { Entity.StudentShouCang info = new Entity.StudentShouCang(); DataTable dt = SqlDB.ExecuteDataset(CommandType.Text, "SELECT * FROM [StudentShouCang] WHERE Id = " + Id + ";").Tables[0]; if (dt.Rows.Count > 0) { info.Id = Basic.Utils.StrToInt(dt.Rows[0]["Id"].ToString(), 0); info.StudentId = Basic.Utils.StrToInt(dt.Rows[0]["StudentId"].ToString(), 0); info.SchoolId = Basic.Utils.StrToInt(dt.Rows[0]["SchoolId"].ToString(), 0); info.ZhuanYeId = Basic.Utils.StrToInt(dt.Rows[0]["ZhuanYeId"].ToString(), 0); info.SchoolName = dt.Rows[0]["SchoolName"].ToString(); info.ZhuanYeName = dt.Rows[0]["ZhuanYeName"].ToString(); } return(info); }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="id">标识</param> /// <returns>返回Entity</returns> public static Entity.edu_grade edu_gradeEntityGet(int id) { Entity.edu_grade info = new Entity.edu_grade(); DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.Text, "SELECT * FROM [edu_grade] WHERE id = " + id + ";").Tables[0]; if (dt.Rows.Count > 0) { info.id = Basic.Utils.StrToInt(dt.Rows[0]["id"].ToString(), 0); info.name = dt.Rows[0]["name"].ToString(); info.code = dt.Rows[0]["code"].ToString(); info.grade_index = Basic.Utils.StrToInt(dt.Rows[0]["grade_index"].ToString(), 0); info.display_flag = Basic.Utils.StrToInt(dt.Rows[0]["display_flag"].ToString(), 0); info.section_id = Basic.Utils.StrToInt(dt.Rows[0]["section_id"].ToString(), 0); } return(info); }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="Id">标识</param> /// <returns>返回Entity</returns> public static Entity.zhishidian zhishidianEntityGet(int Id) { Entity.zhishidian info = new Entity.zhishidian(); DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.Text, "SELECT * FROM [zhishidian] WHERE Id = " + Id + ";").Tables[0]; if (dt.Rows.Count > 0) { info.Id = Basic.Utils.StrToInt(dt.Rows[0]["Id"].ToString(), 0); info.subject_id = Basic.Utils.StrToInt(dt.Rows[0]["subject_id"].ToString(), 0); info.name = dt.Rows[0]["name"].ToString(); return(info); } else { return(null); } }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="SchoolId">标识</param> /// <returns>返回Entity</returns> public static Entity.SeniorMiddleSchool SeniorMiddleSchoolEntityGet(int SchoolId) { Entity.SeniorMiddleSchool info = new Entity.SeniorMiddleSchool(); DataTable dt = SqlDB.ExecuteDataset(CommandType.Text, "SELECT * FROM [SeniorMiddleSchool] WHERE SchoolId = " + SchoolId + ";").Tables[0]; if (dt.Rows.Count > 0) { info.SchoolId = Basic.Utils.StrToInt(dt.Rows[0]["SchoolId"].ToString(), 0); info.SchoolName = dt.Rows[0]["SchoolName"].ToString(); info.Address = dt.Rows[0]["Address"].ToString(); info.ProvinceId = Basic.Utils.StrToInt(dt.Rows[0]["ProvinceId"].ToString(), 0); info.CityId = Basic.Utils.StrToInt(dt.Rows[0]["CityId"].ToString(), 0); info.XianId = Basic.Utils.StrToInt(dt.Rows[0]["XianId"].ToString(), 0); info.IsCheck = Basic.Utils.StrToInt(dt.Rows[0]["IsCheck"].ToString(), 0); info.IsPause = Basic.Utils.StrToInt(dt.Rows[0]["IsPause"].ToString(), 0); } return(info); }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="Id">标识</param> /// <returns>返回Entity</returns> public static Entity.ShengKongXianArticle ShengKongXianArticleEntityGet(int Id) { Entity.ShengKongXianArticle info = new Entity.ShengKongXianArticle(); DataTable dt = SqlDB.ExecuteDataset(CommandType.Text, "SELECT * FROM [ShengKongXianArticle] WHERE Id = " + Id + ";").Tables[0]; if (dt.Rows.Count > 0) { info.Id = Basic.Utils.StrToInt(dt.Rows[0]["Id"].ToString(), 0); info.Title = dt.Rows[0]["Title"].ToString(); info.Metatitle = dt.Rows[0]["Metatitle"].ToString(); info.Metakeywords = dt.Rows[0]["Metakeywords"].ToString(); info.Metadescription = dt.Rows[0]["Metadescription"].ToString(); info.ProvinceId = Basic.Utils.StrToInt(dt.Rows[0]["ProvinceId"].ToString(), 0); info.DataYear = Basic.Utils.StrToInt(dt.Rows[0]["DataYear"].ToString(), 0); info.Content = dt.Rows[0]["Content"].ToString(); } return(info); }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="id">标识</param> /// <returns>返回Entity</returns> public static Entity.edu_subject edu_subjectEntityGet(int id) { Entity.edu_subject info = new Entity.edu_subject(); DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.Text, "SELECT * FROM [edu_subject] WHERE id = " + id + ";").Tables[0]; if (dt.Rows.Count > 0) { info.id = Basic.Utils.StrToInt(dt.Rows[0]["id"].ToString(), 0); info.name = dt.Rows[0]["name"].ToString(); info.subject_code = dt.Rows[0]["subject_code"].ToString(); info.subject_index = Basic.Utils.StrToInt(dt.Rows[0]["subject_index"].ToString(), 0); return(info); } else { return(null); } }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="Id">标识</param> /// <returns>返回Entity</returns> public static Entity.AdvantageProfessional AdvantageProfessionalEntityGet(int Id) { Entity.AdvantageProfessional info = new Entity.AdvantageProfessional(); DataTable dt = SqlDB.ExecuteDataset(CommandType.Text, "SELECT * FROM [AdvantageProfessional] WHERE Id = " + Id + ";").Tables[0]; if (dt.Rows.Count > 0) { info.Id = Basic.Utils.StrToInt(dt.Rows[0]["Id"].ToString(), 0); info.SchoolId = Basic.Utils.StrToInt(dt.Rows[0]["SchoolId"].ToString(), 0); info.ProfessionalId = Basic.Utils.StrToInt(dt.Rows[0]["ProfessionalId"].ToString(), 0); info.IsTeSe = Basic.Utils.StrToInt(dt.Rows[0]["IsTeSe"].ToString(), 0); info.TeSePiCi = dt.Rows[0]["TeSePiCi"].ToString(); info.IsXueKePaiMing = Basic.Utils.StrToInt(dt.Rows[0]["IsXueKePaiMing"].ToString(), 0); info.IsYiJiZhongDian = Basic.Utils.StrToInt(dt.Rows[0]["IsYiJiZhongDian"].ToString(), 0); info.IsErJiZhongDian = Basic.Utils.StrToInt(dt.Rows[0]["IsErJiZhongDian"].ToString(), 0); } return(info); }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="EvaluationUserId">标识</param> /// <returns>返回Entity</returns> public static Entity.Join_EvaluationUser Join_EvaluationUserEntityGet(int EvaluationUserId) { Entity.Join_EvaluationUser info = new Entity.Join_EvaluationUser(); DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.Text, "SELECT * FROM [Join_EvaluationUser] WHERE EvaluationUserId = " + EvaluationUserId + ";").Tables[0]; if (dt.Rows.Count > 0) { info.EvaluationUserId = Basic.Utils.StrToInt(dt.Rows[0]["EvaluationUserId"].ToString(), 0); info.EvaluationUserName = dt.Rows[0]["EvaluationUserName"].ToString(); info.EvaluationUserSex = Basic.Utils.StrToInt(dt.Rows[0]["EvaluationUserSex"].ToString(), 0); info.EvaluationUserBirthday = dt.Rows[0]["EvaluationUserBirthday"].ToString(); info.EvaluationUserGrade = dt.Rows[0]["EvaluationUserGrade"].ToString(); info.EvaluationUserMail = dt.Rows[0]["EvaluationUserMail"].ToString(); info.EvaluationUserTel = dt.Rows[0]["EvaluationUserTel"].ToString(); info.EvaluationUserPhone = dt.Rows[0]["EvaluationUserPhone"].ToString(); } return(info); }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="Id">标识</param> /// <returns>返回Entity</returns> public static Entity.OldProfessional OldProfessionalEntityGet(int Id) { Entity.OldProfessional info = new Entity.OldProfessional(); DataTable dt = SqlDB.ExecuteDataset(CommandType.Text, "SELECT * FROM [OldProfessional] WHERE Id = " + Id + ";").Tables[0]; if (dt.Rows.Count > 0) { info.Id = Basic.Utils.StrToInt(dt.Rows[0]["Id"].ToString(), 0); info.Code = dt.Rows[0]["Code"].ToString(); info.ProfessionalName = dt.Rows[0]["ProfessionalName"].ToString(); info.Remark = dt.Rows[0]["Remark"].ToString(); info.ProfessionalGrade = Basic.Utils.StrToInt(dt.Rows[0]["ProfessionalGrade"].ToString(), 0); info.ParentId = Basic.Utils.StrToInt(dt.Rows[0]["ParentId"].ToString(), 0); info.ProfessionalIntro = dt.Rows[0]["ProfessionalIntro"].ToString(); info.IsBen = Basic.Utils.StrToInt(dt.Rows[0]["IsBen"].ToString(), 0); info.NewProfessionalId = Basic.Utils.StrToInt(dt.Rows[0]["NewProfessionalId"].ToString(), 0); } return(info); }
/// /// <summary> /// 获取前多少的值 /// </summary> /// <param name="TopNumber">数量</param> /// <param name="PageSize">每页显示多少个</param> /// <param name="PageIndex">当前页码,最少为1</param> /// <returns>返回DataTable</returns> public static DataTable StudentShouCangPageList(string strWhere, int PageSize, int PageIndex) { StringBuilder sbSql = new StringBuilder(); sbSql.Append("SELECT * FROM StudentShouCang"); if (!string.IsNullOrEmpty(strWhere.Trim())) { sbSql.Append(" WHERE " + strWhere); } sbSql.Append(" ORDER BY Id DESC"); DataSet ds = new DataSet(); ds = SqlDB.ExecuteDataset((PageIndex - 1) * PageSize, PageSize, CommandType.Text, sbSql.ToString()); if (ds.Tables.Count > 0) { return(ds.Tables[0]); } return(new DataTable()); }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="Id">标识</param> /// <returns>返回Entity</returns> public static Entity.Log LogEntityGet(int Id) { Entity.Log info = new Entity.Log(); DataTable dt = SqlDB.ExecuteDataset(CommandType.Text, "SELECT * FROM [Log] WHERE Id = " + Id + ";").Tables[0]; if (dt.Rows.Count > 0) { info.Id = Basic.Utils.StrToInt(dt.Rows[0]["Id"].ToString(), 0); info.SchoolId = Basic.Utils.StrToInt(dt.Rows[0]["SchoolId"].ToString(), 0); info.SchoolName = dt.Rows[0]["SchoolName"].ToString(); info.Title = dt.Rows[0]["Title"].ToString(); info.UrlLink = dt.Rows[0]["UrlLink"].ToString(); info.CategoryName = dt.Rows[0]["CategoryName"].ToString(); info.BeiZhu = dt.Rows[0]["BeiZhu"].ToString(); info.CaoZuoLeiBie = dt.Rows[0]["CaoZuoLeiBie"].ToString(); info.AddWid = Basic.Utils.StrToInt(dt.Rows[0]["AddWid"].ToString(), 0); } return(info); }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="Id">标识</param> /// <returns>返回Entity</returns> public static Entity.cuotiben cuotibenEntityGet(int Id) { Entity.cuotiben info = new Entity.cuotiben(); DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.Text, "SELECT * FROM [cuotiben] WHERE Id = " + Id + ";").Tables[0]; if (dt.Rows.Count > 0) { info.Id = Basic.Utils.StrToInt(dt.Rows[0]["Id"].ToString(), 0); info.Wid = Basic.Utils.StrToInt(dt.Rows[0]["Wid"].ToString(), 0); info.TiMuId = Basic.Utils.StrToInt(dt.Rows[0]["TiMuId"].ToString(), 0); info.Answer = dt.Rows[0]["Answer"].ToString(); info.RightAnswer = dt.Rows[0]["RightAnswer"].ToString(); return(info); } else { return(null); } }
/// /// <summary> /// 获取前多少的值 /// </summary> /// <param name="TopNumber">数量</param> /// <param name="PageSize">每页显示多少个</param> /// <param name="PageIndex">当前页码,最少为1</param> /// <returns>返回DataTable</returns> public static DataTable Join_ProjectPageList(string strWhere, int PageSize, int PageIndex) { StringBuilder sbSql = new StringBuilder(); sbSql.Append("SELECT p.*,pc.ProjectCategoryName,pr.PPid FROM Join_Project as p left join Join_ProjectCategory as pc on p.PCid = pc.ProjectCategoryId left join Join_ProjectRelated as pr on p.ProjectId = pr.Pid WHERE pr.PPid > 0 and pr.IsValid = 1 "); if (!string.IsNullOrEmpty(strWhere.Trim())) { sbSql.Append(" AND " + strWhere); } sbSql.Append(" ORDER BY ProjectId DESC"); DataSet ds = new DataSet(); ds = SqlDB.ExecuteDataset((PageIndex - 1) * PageSize, PageSize, strCon, CommandType.Text, sbSql.ToString()); if (ds.Tables.Count > 0) { return(ds.Tables[0]); } return(new DataTable()); }
/// /// <summary> /// 获取前多少的值 /// </summary> /// <param name="TopNumber">数量</param> /// <param name="PageSize">每页显示多少个</param> /// <param name="PageIndex">当前页码,最少为1</param> /// <returns>返回DataTable</returns> public static DataTable FenShengYuanXiaoLuQuPageList(string strWhere, int PageSize, int PageIndex, string strDataYear) { StringBuilder sbSql = new StringBuilder(); sbSql.Append("SELECT * FROM [" + DAL.Common.GetYearTableName("FenShengYuanXiaoLuQu", strDataYear) + "]"); if (!string.IsNullOrEmpty(strWhere.Trim())) { sbSql.Append(" WHERE " + strWhere); } sbSql.Append(" ORDER BY Id DESC"); DataSet ds = new DataSet(); ds = SqlDB.ExecuteDataset((PageIndex - 1) * PageSize, PageSize, CommandType.Text, sbSql.ToString()); if (ds.Tables.Count > 0) { return(ds.Tables[0]); } return(new DataTable()); }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="Id">标识</param> /// <returns>返回Entity</returns> public static Entity.student2tm student2tmEntityGet(int Id) { Entity.student2tm info = new Entity.student2tm(); DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.Text, "SELECT * FROM [student2tm] WHERE Id = " + Id + ";").Tables[0]; if (dt.Rows.Count > 0) { info.Id = Basic.Utils.StrToInt(dt.Rows[0]["Id"].ToString(), 0); info.StudentId = Basic.Utils.StrToInt(dt.Rows[0]["StudentId"].ToString(), 0); info.Type = Basic.Utils.StrToInt(dt.Rows[0]["Type"].ToString(), 0); info.TiMuId = Basic.Utils.StrToInt(dt.Rows[0]["TiMuId"].ToString(), 0); info.Answer = dt.Rows[0]["Answer"].ToString(); info.RightAnswer = dt.Rows[0]["RightAnswer"].ToString(); info.Result = Basic.Utils.StrToInt(dt.Rows[0]["Result"].ToString(), 0); info.ZuBie = dt.Rows[0]["ZuBie"].ToString(); info.sx = Basic.Utils.StrToInt(dt.Rows[0]["sx"].ToString(), 0); } return(info); }
/// /// <summary> /// 获取前多少的值 /// </summary> /// <param name="TopNumber">数量</param> /// <param name="PageSize">每页显示多少个</param> /// <param name="PageIndex">当前页码,最少为1</param> /// <returns>返回DataTable</returns> public static DataTable Join_ProfessionTestPageList(string strWhere, int PageSize, int PageIndex) { StringBuilder sbSql = new StringBuilder(); sbSql.Append("SELECT * FROM Join_ProfessionTest"); if (!string.IsNullOrEmpty(strWhere.Trim())) { sbSql.Append(" WHERE " + strWhere); } sbSql.Append(" ORDER BY ProfessionId asc"); DataSet ds = new DataSet(); ds = SqlDB.ExecuteDataset((PageIndex - 1) * PageSize, PageSize, strCon, CommandType.Text, sbSql.ToString()); if (ds.Tables.Count > 0) { return(ds.Tables[0]); } return(new DataTable()); }
/// <summary> /// 获取某一个实体 /// </summary> /// <param name="Id">标识</param> /// <returns>返回Entity</returns> public static Entity.FenShuXian FenShuXianEntityGet(int ProvinceId, string strWhere) { Entity.FenShuXian info = new Entity.FenShuXian(); DataTable dt = SqlDB.ExecuteDataset(CommandType.Text, "SELECT TOP 1 * FROM [FenShuXian] WHERE ProvinceId = " + ProvinceId + strWhere + " ORDER BY DataYear DESC;").Tables[0]; if (dt.Rows.Count > 0) { info.Id = Basic.Utils.StrToInt(dt.Rows[0]["Id"].ToString(), 0); info.Province = dt.Rows[0]["Province"].ToString(); info.ProvinceId = Basic.Utils.StrToInt(dt.Rows[0]["ProvinceId"].ToString(), 0); info.KeLei = Basic.Utils.StrToInt(dt.Rows[0]["KeLei"].ToString(), 0); info.DataYear = Basic.Utils.StrToInt(dt.Rows[0]["DataYear"].ToString(), 0); info.PcFirst = Basic.Utils.StrToInt(dt.Rows[0]["PcFirst"].ToString(), 0); info.PcSecond = Basic.Utils.StrToInt(dt.Rows[0]["PcSecond"].ToString(), 0); info.PcThird = Basic.Utils.StrToInt(dt.Rows[0]["PcThird"].ToString(), 0); info.ZkFirst = Basic.Utils.StrToInt(dt.Rows[0]["ZkFirst"].ToString(), 0); info.ZkSecond = Basic.Utils.StrToInt(dt.Rows[0]["ZkSecond"].ToString(), 0); } return(info); }