private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) { saveFileDialog1.Filter = "(BookmarkFiles *.dat)|*.dat"; saveFileDialog1.FileName = "bookmarks.dat"; saveFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); var userControl = new SelectPassword(); Form paswordForm = FormFactory.CreateModalForm(userControl); paswordForm.Controls.Add(userControl); paswordForm.StartPosition = FormStartPosition.CenterParent; paswordForm.ShowInTaskbar = false; paswordForm.FormBorderStyle = FormBorderStyle.FixedSingle; if (paswordForm.ShowDialog(this) == DialogResult.OK) { string password = userControl.SelectedPassword; if (saveFileDialog1.ShowDialog(this) == DialogResult.OK) { string filename = saveFileDialog1.FileName; _bookmarkManager.SaveToFile(filename, password); MessageBox.Show("Save was sussessful", "Bookmarks", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
public ContentResult SignInUser(UserModel user) { if (ModelState.IsValid) { var model = SelectPassword.ValidateUser(user); if (model != null) { return(new ContentResult { Content = JsonSerializer.Serialize(model), ContentType = "application/json", StatusCode = (int)HttpStatusCode.OK }); } return(new ContentResult { StatusCode = (int)HttpStatusCode.NotFound }); } return(new ContentResult { StatusCode = (int)HttpStatusCode.InternalServerError }); }
public void CreateNewUser(string name, string email, string password) { CreateNewUserButton.ClickElement(); EnterNameText.EnterText(name + DateTime.Now.ToString("yyyyMMddHHmmssfff")); EnterSurNameText.EnterText(name); EnterEmailText.EnterText(email + DateTime.Now.ToString("yyyyMMddHHmmssfff") + "@test.com"); EnterUserNameText.EnterText(name + DateTime.Now.ToString("yyyyMMddHHmmssfff")); SelectPassword.ClickElement(); EnterPasswordText.EnterText(password); RepetPasswordText.EnterText(password); SaveButton.ClickElement(); }