public MailConfirmation(Service.Profile profile, string hashpassword) { string data1 = Environment.CurrentDirectory + "\\Content\\maets.cur"; var cursor = new Cursor(data1); this.Cursor = cursor; client = new Service.WCFServiceClient(new System.ServiceModel.InstanceContext(new CallbackClass()), "NetTcpBinding_IWCFService"); this.Title = "Maets"; List <Service.Profile> profiles = client.GetAllUsers().ToList(); for (int i = 0; i < profiles.Count; i++) { if (profiles[i].Login == profile.Login) { throw new Exception("Этот логин занят!"); } } this.profile = profile; this.hashpassword = hashpassword; InitializeComponent(); tb.Text = "Введите код подтвержения, отправленный на почту " + profile.Mail; code = client.CheckMailRegister(profile.Mail); }
public ResetPassword(string Login) { string data1 = Environment.CurrentDirectory + "\\Content\\maets.cur"; var cursor = new Cursor(data1); this.Cursor = cursor; this.Title = "Maets"; client = new Service.WCFServiceClient(new System.ServiceModel.InstanceContext(new CallbackClass()), "NetTcpBinding_IWCFService"); List <Service.Profile> profiles = client.GetAllUsers().ToList(); for (int i = 0; i < profiles.Count; i++) { if (profiles[i].Login == Login) { profile = profiles[i]; break; } ; } if (profile.Login != Login) { throw new Exception("Такого пользовaтеля не существует"); } InitializeComponent(); profile = client.CheckProfile(profile.ID); tb.Text = "Введите код подтвержения, отправленный на почту " + profile.Mail; code = client.CheckMailResetPassword(profile.Mail); }