public ActionResult DataConnection_TestConnection(ConnectorDTO _dtoConnector)
        {
            try
            {
                objConnectorRepository = new ConnectorRepository(_dtoConnector);
                objConnectorRepository.TestConnection();

                return(Json(new { success = true, message = Resources.Resources.ConnectorTestMessage }));
            }
            catch (Exception ex)
            {
                return(Json(new { success = false, message = ex.Message + " " + ex.InnerException.Message }));
            }
        }
        public ActionResult CreateDatabaseConnector(ConnectorsDTO objDCDTO)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    objDCDTO.SessionId     = Session.SessionID;
                    objConnectorRepository = new ConnectorRepository(objDCDTO);

                    if (Request.Form["btnTest"] != null)
                    {
                        objConnectorRepository.TestConnection();
                        return(Json(new { success = true, message = Resources.Resources.ConnectorTestMessage }));
                    }
                    else
                    {
                        objConnectorRepository.SaveConnection();
                        GetAllExistingConnections();
                        return(Json(new { success = true, message = Resources.Resources.ConnectorSaveMessage }));
                    }
                }
                catch (Exception ex)
                {
                    //ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists, see your system administrator.");
                    //Response.StatusCode = 400;
                    //ModelState.AddModelError(string.Empty, ex.Message + ex.InnerException.Message);
                    //return Content(ex.Message + ex.InnerException.Message);

                    return(Json(new { success = false, message = ex.Message + ex.InnerException.Message }));
                }
            }
            else
            {
                return(Content(Resources.Resources.ConnectorValidationFailed));
            }
        }