Exemple #1
0
 public bool adminLoginCheck(adminLoginBO adminLoginBO)
 {
     try
     {
         if (con.State == ConnectionState.Closed)
         {
             con.Open();
         }
         query           = "adminLoginCheck";
         cmd             = new SqlCommand(query, con);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.AddWithValue("@adminId", adminLoginBO.adminId);
         cmd.Parameters.AddWithValue("@password", adminLoginBO.password);
         SqlParameter result = cmd.Parameters.Add("@res", SqlDbType.Bit);
         result.Direction = ParameterDirection.Output;
         cmd.ExecuteNonQuery();
         return(bool.Parse(result.Value.ToString()));
     }
     catch
     {
         throw;
     }
     finally
     {
         if (con.State == ConnectionState.Open)
         {
             con.Close();
         }
     }
 }
Exemple #2
0
 public bool AdminLoginCheck(adminLoginBO AdminLoginBO)
 {
     try
         {
             query = "SELECT * FROM adminLogin WHERE username=@username AND password=@password";
             cmd = new SqlCommand(query, con);
             if (con.State == ConnectionState.Closed)
             {
                 con.Open();
             }
             cmd.Parameters.AddWithValue("@username", AdminLoginBO.username);
             cmd.Parameters.AddWithValue("@password", AdminLoginBO.password);
             drd = cmd.ExecuteReader();
             if (drd.HasRows)
             {
                 drd.Read();
                 return true;
             }
             else
             {
                 return false;
             }
         }
         catch
         {
             throw;
         }
         finally
         {
             con.Close();
         }
 }
Exemple #3
0
 public bool adminLoginCheck(adminLoginBO adminLoginBO)
 {
     try
     {
         if(con.State==ConnectionState.Closed)
         {
             con.Open();
         }
         query = "adminLoginCheck";
         cmd = new SqlCommand(query, con);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.AddWithValue("@adminId", adminLoginBO.adminId);
         cmd.Parameters.AddWithValue("@password", adminLoginBO.password);
         SqlParameter result = cmd.Parameters.Add("@res", SqlDbType.Bit);
         result.Direction = ParameterDirection.Output;
         cmd.ExecuteNonQuery();
         return (bool.Parse(result.Value.ToString()));
     }
     catch
     {
         throw;
     }
     finally
     {
         if(con.State==ConnectionState.Open)
         {
             con.Close();
         }
     }
 }
Exemple #4
0
 public bool adminLoginCheck(adminLoginBO adminLoginBO)
 {
     try
     {
         return(adminLoginDAL.adminLoginCheck(adminLoginBO));
     }
     catch
     {
         throw;
     }
     finally
     {
     }
 }
Exemple #5
0
    public bool adminLoginCheck(adminLoginBO adminLoginBO)
    {
        try
        {
            return (adminLoginDAL.adminLoginCheck(adminLoginBO));
        }
        catch
        {
            throw;
        }
        finally
        {

        }
    }
Exemple #6
0
    public void ChangePassword(adminLoginBO AdminLoginBO)
    {
        try
            {
                AdminLoginDAL.ChangePassword(AdminLoginBO);
            }
            catch
            {
                throw;
            }
            finally
            {

            }
    }
Exemple #7
0
    public bool AdminLoginCheck(adminLoginBO AdminLoginBO)
    {
        try
            {
                return AdminLoginDAL.AdminLoginCheck(AdminLoginBO);
            }
            catch
            {
                throw;
            }
            finally
            {

            }
    }
Exemple #8
0
 public void ChangePassword(adminLoginBO AdminLoginBO)
 {
     try
         {
             query = "UPDATE adminLogin SET password=@password WHERE username=@username";
             cmd = new SqlCommand(query, con);
             if (con.State == ConnectionState.Closed)
             {
                 con.Open();
             }
             cmd.Parameters.AddWithValue("@username", AdminLoginBO.username);
             cmd.Parameters.AddWithValue("@password", AdminLoginBO.password);
             cmd.ExecuteNonQuery();
         }
         catch
         {
             throw;
         }
         finally
         {
             con.Close();
         }
 }