private static string getOldPass(int p_3) { string sql = "select customerpwd from CusUsers where customerid=@ID"; SqlParameter pa = new SqlParameter("@ID", SqlDbType.Int); pa.Value = p_3; return(DBHelp.ExecuteScalar(sql, pa).ToString()); }
public static bool Vld_UserName(global::ENTITY.CusUsers userlogin) { string sql = @"select customerid from CusUsers where Customername =@Customername"; SqlParameter[] para = new SqlParameter[] { new SqlParameter("@Customername", SqlDbType.VarChar) }; para[0].Value = userlogin.Customername; return((DBHelp.ExecuteScalar(sql, para) != null) ? true : false); }
public static bool ulogin(global::ENTITY.CusUsers userlogin) { string sql = @"select customerid from CusUsers where Customername =@Customername and customerpwd =@customerpwd and IsCusAdmin=@IsCusAdmin"; SqlParameter[] para = new SqlParameter[] { new SqlParameter("@Customername", SqlDbType.VarChar), new SqlParameter("@customerpwd", SqlDbType.VarChar), new SqlParameter("@IsCusAdmin", SqlDbType.Int) }; para[0].Value = userlogin.Customername; para[1].Value = userlogin.customerpwd; para[2].Value = userlogin.IsCusAdmin; return((DBHelp.ExecuteScalar(sql, para) != null) ? true : false); }
/// <summary> /// 查询用户名是否存在 /// </summary> /// <param name="U_Id"></param> /// <returns></returns> public int ExistsName(string U_Name) { StringBuilder strSql = new StringBuilder(); strSql.Append("select count(1) from U_UserInfo"); strSql.Append(" where "); strSql.Append(" U_Name2 = @U_Name "); SqlParameter[] parameters = { new SqlParameter("@U_Name", SqlDbType.VarChar, 50) }; parameters[0].Value = U_Name; return(Convert.ToInt32(DBHelp.ExecuteScalar(strSql.ToString(), parameters))); }