private void btnSellerSignup_Click(object sender, EventArgs e) { Seller seller = new Seller { SellerId = tbxSellerSignupId.Text, CompanyName = tbxSellerSignupCompanyName.Text, Password = tbxSellerSignupPassword.Text, Cash = 0 }; SellerSignupState sellerSignupState = SignupManager.SellerSignup(seller); switch (sellerSignupState) { case SellerSignupState.IdExists: MessageBox.Show("This ID already exists!"); break; case SellerSignupState.CompanyNameExists: MessageBox.Show("This company already exist"); break; case SellerSignupState.Successful: MessageBox.Show("Signup Successful"); break; case SellerSignupState.Failed: MessageBox.Show("Signup Failed"); break; default: break; } }
private void btnCustomerSignup_Click(object sender, EventArgs e) { Customer customer = new Customer { CustomerId = tbxCustomerSignupId.Text, FirstName = tbxCustomerSignupFirstName.Text, LastName = tbxCustomerSignupLastName.Text, Password = tbxCustomerSignupPassword.Text, Cash = 0 }; CustomerSignupState customerSignupState = SignupManager.CustomerSignup(customer); switch (customerSignupState) { case CustomerSignupState.IdExists: MessageBox.Show("This ID already exists!"); break; case CustomerSignupState.Successful: MessageBox.Show("Signup Successful"); break; case CustomerSignupState.Failed: MessageBox.Show("Signup Failed!"); break; default: break; } }
IObservable <string> SignUp() => SignupManager.SignUp(api, null) .ObserveOn(SynchronizationContext.Current) .Catch <string, Exception>(ex => { Failed(ex.Message); return(Observable.Empty <string>()); });
public SignupManagerViewModel(SignupManager signupManagerOpen) { signupManager = signupManagerOpen; serviceManager = new ServiceManager(); Manager = new vwManager(); hintPasswordValidation = new HintPasswordValidation(); }
public void Server_response(string message) { List <string> lServerData = new List <string>(); lServerData = message.Split(';').ToList(); //MessageBox.Show(message); switch (lServerData[0].ToString()) { case "#103": LoginManager.LoginReceive(lServerData, this); break; case "#105": SignupManager.SignUp_Receive(lServerData, this); break; default: break; } }
public override void ViewDidLoad() { base.ViewDidLoad(); TableView.BackgroundColor = UIColor.FromRGB(238 / 255.0f, 91 / 255.0f, 51 / 255.0f); TableView.RegisterClassForCellReuse(typeof(TextFieldCell), "TextFieldCell"); TableView.RowHeight = UITableView.AutomaticDimension; TableView.TableFooterView = new UIView(); logoCell = new ImageCell(); logoCell .CloseStream .Subscribe(_ => PresentingViewController.DismissViewController(true, null)) .AddTo(disposables); buttonCell = new ButtonCell(); buttonCell .ActionStream .SelectMany(_ => SignupManager.SignUp(api, null)) .ObserveOn(SynchronizationContext.Current) .Subscribe(Succeed) .AddTo(disposables); }
private void SubmitCommandExecute(object obj) { try { string passwordFile = ReadPasswordFromFile(); string password = (obj as PasswordBox).Password; if (password.Equals(passwordFile)) { MessageBox.Show("Password correct!"); SignupManager manager = new SignupManager(); passwordFromFile.Close(); manager.ShowDialog(); } else { counter--; if (counter != 0) { MessageBox.Show("Wrong password. You have " + counter + " more attempts!"); } if (counter == 0) { MessageBox.Show("You have no more attemps! Signup as Employee..."); SignupEmployee employee = new SignupEmployee(); passwordFromFile.Close(); employee.ShowDialog(); } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void Btn_SignUp_SignUp_Click(object sender, RoutedEventArgs e) { SignupManager.SignUp_Btn_Click(ref TCPClient, this); }