public Message AddOrEdit(Designation designation) { var message = new Message(); var ID = designation.DesignationId; int result = _iDesignationRepository.AddOrEdit(designation); try { if (result > 0) { if (Convert.ToInt32(ID) > 0) { message = Message.SetMessages.SetSuccessMessage("Submission Updated Successful!"); } else { message = Message.SetMessages.SetSuccessMessage("Submission Successful!"); } } else { message = Message.SetMessages.SetErrorMessage("Could not be submitted!"); } } catch (Exception e) { message = Message.SetMessages.SetWarningMessage(e.Message.ToString()); } return(message); }