public Message AddOrEdit(ProductCategory productCategory) { var message = new Message(); var ID = productCategory.ProductCategoryId; int result = _iProductCategoryRepository.AddOrEdit(productCategory); try { if (result > 0) { if (Convert.ToInt32(ID) > 0) { message = Message.SetMessages.SetSuccessMessage("Submission Updated Successfully!"); } 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); }