public ActionResult AddSvn(AddSvnModel model)
        {
            this.CheckPermission(UserRoleAction.SourceVersionsManage);

            if (!this.ModelState.IsValid)
            {
                return(this.View(model));
            }

            SourceControl sourceControl = new SourceControl
            {
                Type       = SourceControlType.Svn,
                Name       = model.Name,
                IsDeleted  = false,
                OrderIndex = this.Entities.SourceControl.Count()
            };

            sourceControl.SetStringProperty("URL", model.Url.Trim());
            sourceControl.SetStringProperty("Login", model.Login.Trim());
            sourceControl.SetStringProperty("Password", model.Password.Trim());

            SourceControlVersion sourceControlVersion = new SourceControlVersion();

            sourceControlVersion.SourceControl = sourceControl;
            sourceControlVersion.SetStringProperty("URL", "/");

            TestSourceResult testSourceResult = this.sourceControlManager.TestConnection(sourceControlVersion);

            if (!testSourceResult.IsSuccess)
            {
                this.ModelState.AddModelError("URL", testSourceResult.ErrorMessage);
                return(this.View(model));
            }

            sourceControlVersion.SourceControl = null;

            this.Entities.SourceControl.Add(sourceControl);
            this.Entities.SaveChanges();

            return(this.RedirectToAction("List"));
        }