Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            try
            {
                ContactInfoViewModel deleteViewModel = _iContactInfoService.GetContactInfo(id);
                if (deleteViewModel != null)
                {
                    if (_iContactInfoService.Delete(deleteViewModel) > 0)
                    {
                        InformLog("Data deleted successfully.", "Contact deleted.");
                        return(Json(new { msg = "Data deleted successfully.", status = MessageType.success.ToString() }, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        InformLog("Data could not deleted.", "Contact could not deleted.");
                        return(Json(new { msg = "Data could not deleted.", status = MessageType.notice.ToString() }, JsonRequestBehavior.AllowGet));
                    }
                }

                InformLog("This data are missing.", "Contact could not deleted.");
                return(Json(new { msg = "This data are missing.", status = MessageType.notice.ToString() }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                ErrorLog(ex);
                return(Json(new { msg = ExceptionHelper.ExceptionMessageFormat(ex, log: true), status = MessageType.error.ToString() }, JsonRequestBehavior.AllowGet));
            }
        }