Ejemplo n.º 1
0
        public Message AddOrEdit(FAQ FAQ)
        {
            var message = new Message();
            var ID      = FAQ.FAQId;
            int result  = _iFAQRepository.AddOrEdit(FAQ);

            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);
        }