public DataTable GetAdDetailsDT(UserAdpost adpostDetails)
 {
     try
     {
         DALComponent objDALComponent1 = new DALComponent();
         objDALComponent1.SetParameters("@adpostId", SqlDbType.Int, 4, adpostDetails.AdPostId);
         objDALComponent1.SetParameters("@userId", SqlDbType.Int, 4, adpostDetails.UserId);
         objDALComponent1.SqlCommandText = "[GetAdDetails]";
         return objDALComponent1.SelectRecord();
     }
     catch (SqlException sqlEx)
     {
         throw new ApplicationException("Data error=" + sqlEx.Message.ToString());
     }
     catch (Exception ex)
     {
         throw new ApplicationException("Error=" + ex.Message.ToString());
     }
 }
 public void AdPostDeleteById(UserAdpost uAdpost)
 {
     try
     {
         objDALComponent.SetParameters("@adpostId", SqlDbType.Int, 4, uAdpost.AdPostId);
         objDALComponent.SqlCommandText = "AdPostDeleteById";
         int x = objDALComponent.DeleteRecord();
     }
     catch (SqlException sqlEx)
     {
         throw new ApplicationException("Data error=" + sqlEx.Message.ToString());
     }
     catch (Exception ex)
     {
         throw new ApplicationException("Error=" + ex.Message.ToString());
     }
 }