Beispiel #1
0
 public async Task <IActionResult> Delete(int companyId)
 {
     try
     {
         if (!(await _company.CheckCompanyExist(companyId)))
         {
             return(BadRequest(Messages.CompanyNotExist));
         }
         return(Ok(await _company.Delete(companyId)));
     }
     catch (Exception ex)
     {
         return(BadRequest(Messages.GeneralError));
     }
 }
Beispiel #2
0
        public IActionResult Delete(int id)
        {
            User currentAdmin = HttpContext.Session.Get <User>("currentUser");

            try
            {
                companyBLL.Delete(id);
                this._logger.LogInformation($"AdminID : {currentAdmin.ID} is updated  CompanyID : {id}.");
            }
            catch (Exception)
            {
                throw;
            }
            return(View("Index"));
        }
 public IActionResult Delete(int id)
 {
     companyBLL.Delete(id);
     return(Ok());
 }