public TestingUserControl()
 {
     InitializeComponent();
     DragAndDropControl.RegisteredTypes = new FileTypeModel(NetBuilderViewModel.DirtyNetModel);
     ListControlHelper.RegisterAutoSelect(this.ComboBox);
     this.DataContextChanged += OnDataContextChanged;
 }
Example #2
0
        public async Task <ActionResult> SignUp(SignupModel signupModel)
        {
            if (!ModelState.IsValid)
            {
                return(new HttpStatusCodeResult(500, "The form was not filled out correctly. Please check the inputs."));
            }

            // Create the user model.
            User user = new User
            {
                UserName      = signupModel.UserName,
                FirstName     = signupModel.FirstName,
                LastName      = signupModel.LastName,
                SecurityStamp = Guid.NewGuid().ToString(),
                TeamId        = signupModel.Team
            };

            // Check if the user already exists.
            User existingUser = await userManager.FindByNameAsync(user.UserName);

            if (existingUser != null && existingUser.Id != user.Id)
            {
                return(new HttpStatusCodeResult(500, "That user already exists"));
            }

            // Add the user to the database.
            var result = await userManager.CreateAsync(user, signupModel.Password);

            if (result.Succeeded)
            {
                // Add them to the correct role.
                userManager.AddToRole(user.Id, ListControlHelper.GetRole(signupModel.Role));
                return(Redirect(Request.UrlReferrer.PathAndQuery));
            }
            return(new HttpStatusCodeResult(500, "Error adding the user: " + result.Errors));
        }
 public BatchTesterControl()
 {
     InitializeComponent();
     this.DataContextChanged += OnDataContextChanged;
     ListControlHelper.RegisterAutoSelect(this.SupportedDataSetsComboBox);
 }
 public LoadedNeuralNetsUserControl()
 {
     InitializeComponent();
     ListControlHelper.RegisterAutoSelect(this.LoadedNetsListView);
 }
 public TrainingSettingsUserControl()
 {
     InitializeComponent();
     ListControlHelper.RegisterAutoSelect(this.Gpus, this.NetModels, this.TrainingDataSets);
 }
Example #6
0
 public SingleTrainingUserControl()
 {
     InitializeComponent();
     ListControlHelper.RegisterAutoSelect(ComboBox);
 }
Example #7
0
 public DatasetLoaderUserControl()
 {
     InitializeComponent();
     ListControlHelper.RegisterAutoSelect(this.ListView);
 }
Example #8
0
 public DataSetInfoUserControl()
 {
     InitializeComponent();
     ListControlHelper.RegisterAutoSelect(this.CategoryComboBox, this.PhotosListBox);
 }
 public NetBuilderUserControl()
 {
     InitializeComponent();
     DataContextChanged += OnDataContextChanged;
     ListControlHelper.RegisterAutoSelect(LayersListView, SupportedComboBox);
 }