The SqlHelper class is intended to encapsulate high performance, scalable best practices for common uses of SqlClient
Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     DAL.SqlHelper sqlHelper = new DAL.SqlHelper();
     if (!IsPostBack)
     {
         DataList1.DataSource = sqlHelper.GetdataSet("select * from Brand");
         DataList1.DataBind();
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     DAL.SqlHelper sqlHelper=new DAL.SqlHelper();
     if (!IsPostBack)
     {
         DataList1.DataSource =sqlHelper.GetdataSet("select * from Brand");
         DataList1.DataBind();
     } 
 }
Пример #3
0
        public IList <LoanChoose> GetAll()
        {
            string sql = "select * from LoanChoose where LoanChoose_DeleteId = 1 order by LoanChoose_CreateTime ";

            return(SqlHelper <LoanChoose> .Query(sql, null));
        }
Пример #4
0
        public int Edit(LoanChoose model)
        {
            string sql = "update LoanChoose set LoanType_Id=@LoanType_Id,LoanChoose_Detail=@LoanChoose_Detail,LoanChoose_UpdateTime=@LoanChoose_UpdateTime where LoanChoose_Id = @LoanChoose_Id";

            return(SqlHelper <LoanChoose> .ExceuteNonQuery(sql, model));
        }
Пример #5
0
        public int Add(LoanChoose model)
        {
            string sql = "insert into LoanChoose(LoanChoose_Id,LoanType_Id,LoanChoose_Detail,LoanChoose_DeleteId,LoanChoose_CreateTime,LoanChoose_UpdateTime) values(@LoanChoose_Id,@LoanType_Id,@LoanChoose_Detail,@LoanChoose_DeleteId,@LoanChoose_CreateTime,@LoanChoose_UpdateTime)";

            return(SqlHelper <LoanChoose> .ExceuteNonQuery(sql, model));
        }
Пример #6
0
        public DataSet GetCandidateSearchResults(CandidateSearchBOL objCandidateSearchBOL)
        {
            SqlParameter[] param = new SqlParameter[8];

            param[0] = new SqlParameter("@name", SqlDbType.VarChar);
            if (objCandidateSearchBOL.Name != null)
            {
                param[0].Value = objCandidateSearchBOL.Name;
            }
            else
            {
                param[0].Value = DBNull.Value;
            }


            //param[1] = new SqlParameter("@work_ex", SqlDbType.VarChar);
            //if (candidatemodel.WorkExp!= null)
            //param[1].Value = candidatemodel.WorkExp;
            //else
            //param[1].Value = DBNull.Value;

            param[1] = new SqlParameter("@years", SqlDbType.Int);
            if (objCandidateSearchBOL.Years != -1)
            {
                param[1].Value = objCandidateSearchBOL.Years;
            }
            else
            {
                param[1].Value = DBNull.Value;
            }

            param[2] = new SqlParameter("@uptoyears", SqlDbType.Int);
            if (objCandidateSearchBOL.UptoYears != -1)
            {
                param[2].Value = objCandidateSearchBOL.UptoYears;
            }
            else
            {
                param[2].Value = DBNull.Value;
            }


            param[3] = new SqlParameter("@qualification", SqlDbType.Int);
            if (objCandidateSearchBOL.Qualifications != -1)
            {
                param[3].Value = objCandidateSearchBOL.Qualifications;
            }
            else
            {
                param[3].Value = DBNull.Value;
            }


            param[4] = new SqlParameter("@notice", SqlDbType.Int);
            if (objCandidateSearchBOL.NoticePeriod != -1)
            {
                param[4].Value = objCandidateSearchBOL.NoticePeriod;
            }
            else
            {
                param[4].Value = DBNull.Value;
            }


            param[5] = new SqlParameter("@status", SqlDbType.Int);
            if (objCandidateSearchBOL.Status != -1)
            {
                param[5].Value = objCandidateSearchBOL.Status;
            }
            else
            {
                param[5].Value = DBNull.Value;
            }

            param[6]       = new SqlParameter("@SearchMode", SqlDbType.VarChar);
            param[6].Value = "SearchForRecruiter";

            param[7]       = new SqlParameter("@RRFID", SqlDbType.Int);
            param[7].Value = objCandidateSearchBOL.RRFID;

            return(SqlHelper.ExecuteDataset(AppConfiguration.ConnectionString, CommandType.StoredProcedure, "sp_GetCandidateSearchResults", param));
        }
Пример #7
0
 public DataSet GetCandidateQualification()
 {
     return(SqlHelper.ExecuteDataset(AppConfiguration.ConnectionString, CommandType.StoredProcedure, "sp_GetCandidateQualification_Courses"));
 }
 public static string GetSkillName(string skillId)
 {
     string sql = string.Format("select SkillName from Skill where SkillId={0}", skillId);
     return Convert.ToString(SqlHelper.ExecuteScalar(CommandType.Text, sql));
 }
 public static bool DelSkillData(string skillName) 
 {
     SqlParameter[] p = {new SqlParameter("@SkillName",skillName)};
     string sql = string.Format("delete from Skill where SkillName='{0}'", skillName);
     return SqlHelper.ExecuteNonQuery(CommandType.Text, sql,p) == 0 ? false : true;
 }
Пример #10
0
 public static DataSet GetSkillId(string heroId)
 {
     string sql = string.Format("select SkillId from Skill where HeroId='{0}'", heroId);
     return SqlHelper.GetDataSet(CommandType.Text, sql);
 }
Пример #11
0
        public IList <Seos> GetAllInTrash()
        {
            string sql = "select * from Seos where Seos_DeleteId = 0 order by Seos_UpdateTime desc";

            return(SqlHelper <Seos> .Query(sql, null));
        }
Пример #12
0
        public int Edit(Seos model)
        {
            string sql = "update Seos set Seos_Title=@Seos_Title,Seos_Keyword=@Seos_Keyword,Seos_Description=@Seos_Description,Seos_WebMenuId=@Seos_WebMenuId,Seos_UpdateTime=@Seos_UpdateTime where Seots_Id=@Seos_Id";

            return(SqlHelper <Seos> .ExecuteNonQuery(sql, model));
        }
Пример #13
0
        public int Add(Seos model)
        {
            string sql = "insert into Seos(Seos_Id,Seos_Title,Seos_Keyword,Seos_Description,Seos_WebMenuId,Seos_DeleteId,Seos_CreateTime,Seos_UpdateTime) values(@Seos_Id,@Seos_Title,@Seos_Keyword,@Seos_Description,@Seos_WebMenuId,@Seos_DeleteId,@Seos_CreateTime,@Seos_UpdateTime)";

            return(SqlHelper <Seos> .ExecuteNonQuery(sql, model));
        }