Beispiel #1
0
        void ReleaseDesignerOutlets()
        {
            if (EmailText != null)
            {
                EmailText.Dispose();
                EmailText = null;
            }

            if (PasswordText != null)
            {
                PasswordText.Dispose();
                PasswordText = null;
            }

            if (RegisterButton != null)
            {
                RegisterButton.Dispose();
                RegisterButton = null;
            }

            if (UsernameText != null)
            {
                UsernameText.Dispose();
                UsernameText = null;
            }
        }
Beispiel #2
0
        void ReleaseDesignerOutlets()
        {
            if (HeadImage != null)
            {
                HeadImage.Dispose();
                HeadImage = null;
            }

            if (EmailLabel != null)
            {
                EmailLabel.Dispose();
                EmailLabel = null;
            }

            if (EmailText != null)
            {
                EmailText.Dispose();
                EmailText = null;
            }

            if (InputLayout != null)
            {
                InputLayout.Dispose();
                InputLayout = null;
            }
        }
Beispiel #3
0
 private void EmailText_Enter(object sender, EventArgs e)
 {
     if (EmailText.Text.Equals("Email"))
     {
         EmailText.Clear();
     }
 }
Beispiel #4
0
 private void AcceptButton_Click(object sender, EventArgs e)
 {
     IsValidEmail(EmailText.Text);
     IsValidName(FirstNameTextBox.Text);
     IsValidName(SurnameText.Text);
     if (PhoneNumberText.Text.Length != 11)
     {
         MessageBox.Show("The length of your phone number must be 11 digits");
         PhoneNumberText.Clear();
     }
     if (FirstNameTextBox.Text != "" && SurnameText.Text != "" && EmailText.Text != "" && PhoneNumberText.Text != "")
     {
         if (CustomersSelectionFormcs.edit == false)
         {
             ReadInTextFile();
         }
         ListofCustomers.Add(new SnippetsBackend.Customers((FirstNameTextBox.Text), SurnameText.Text, EmailText.Text, PhoneNumberText.Text));
         //Add to textfile
         using (StreamWriter tw = new StreamWriter("ListofCustomers.txt", false))
         {
             foreach (SnippetsBackend.Customers s in ListofCustomers)
             {
                 tw.WriteLine(s.FirstName + "," + s.LastName + "," + s.Email + "," + s.PhoneNumber);
             }
             tw.Close();
         }
         MessageBox.Show("Customer has been added/edited");
         FirstNameTextBox.Clear();
         SurnameText.Clear();
         EmailText.Clear();
         PhoneNumberText.Clear();
         CustomerAppointments.Items.Clear();
     }
 }
        void ReleaseDesignerOutlets()
        {
            if (EmailText != null)
            {
                EmailText.Dispose();
                EmailText = null;
            }

            if (LoginBtn != null)
            {
                LoginBtn.Dispose();
                LoginBtn = null;
            }

            if (LoginUpperIamge != null)
            {
                LoginUpperIamge.Dispose();
                LoginUpperIamge = null;
            }

            if (PasswordText != null)
            {
                PasswordText.Dispose();
                PasswordText = null;
            }

            if (SignupBtn != null)
            {
                SignupBtn.Dispose();
                SignupBtn = null;
            }
        }
Beispiel #6
0
        void ReleaseDesignerOutlets()
        {
            if (ActivityIndicator != null)
            {
                ActivityIndicator.Dispose();
                ActivityIndicator = null;
            }

            if (EmailText != null)
            {
                EmailText.Dispose();
                EmailText = null;
            }

            if (LoginButton != null)
            {
                LoginButton.Dispose();
                LoginButton = null;
            }

            if (PasswordText != null)
            {
                PasswordText.Dispose();
                PasswordText = null;
            }
        }
Beispiel #7
0
        void ReleaseDesignerOutlets()
        {
            if (ConfirmPasswordText != null)
            {
                ConfirmPasswordText.Dispose();
                ConfirmPasswordText = null;
            }

            if (EmailText != null)
            {
                EmailText.Dispose();
                EmailText = null;
            }

            if (PasswordText != null)
            {
                PasswordText.Dispose();
                PasswordText = null;
            }

            if (SignUpButton != null)
            {
                SignUpButton.Dispose();
                SignUpButton = null;
            }

            if (UsernameText != null)
            {
                UsernameText.Dispose();
                UsernameText = null;
            }
        }
Beispiel #8
0
 public bool IsValidEmail(string email)
 {
     try
     {
         int indexofat  = EmailText.Text.IndexOf("@");
         int indexofdot = EmailText.Text.IndexOf(".");
         {
             if (Regex.IsMatch(email, @"^[^0-9]+$") == false)
             {
                 MessageBox.Show("An email should only contain numbers");
                 EmailText.Clear();
             }
             if (indexofat > indexofdot)
             {
                 return(false);
             }
             else
             {
                 return(true);
             }
         }
     }
     catch
     {
         return(false);
     }
 }
Beispiel #9
0
 private void ClearForm()
 {
     UserNameText.Clear();
     EmailText.Clear();
     NameText.Clear();
     PasswordText.Clear();
     ChangePasswordChk.Checked = false;
     ActiveChk.Checked         = false;
 }
        void ReleaseDesignerOutlets()
        {
            if (EmailText != null)
            {
                EmailText.Dispose();
                EmailText = null;
            }

            if (InputLayout != null)
            {
                InputLayout.Dispose();
                InputLayout = null;
            }

            if (LoginButton != null)
            {
                LoginButton.Dispose();
                LoginButton = null;
            }

            if (LoginLayout != null)
            {
                LoginLayout.Dispose();
                LoginLayout = null;
            }

            if (LogoImage != null)
            {
                LogoImage.Dispose();
                LogoImage = null;
            }

            if (PasswordText != null)
            {
                PasswordText.Dispose();
                PasswordText = null;
            }

            if (RegisterButton != null)
            {
                RegisterButton.Dispose();
                RegisterButton = null;
            }

            if (VerifyButton != null)
            {
                VerifyButton.Dispose();
                VerifyButton = null;
            }

            if (FacebookLoginButton != null)
            {
                FacebookLoginButton.Dispose();
                FacebookLoginButton = null;
            }
        }
Beispiel #11
0
 private void button1_Click(object sender, EventArgs e)
 {
     NameText.Clear();
     PhoneText.Clear();
     EmailText.Clear();
     INNText.Clear();
     ScoreText.Clear();
     AddressText.Clear();
     Close();
 }
Beispiel #12
0
 private void EditClientForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     NameText.Clear();
     PhoneText.Clear();
     EmailText.Clear();
     INNText.Clear();
     ScoreText.Clear();
     AddressText.Clear();
     bsToShow = null;
 }
        private void NovayRegistraciy_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                string LoginPolzovately1 = LoginText.Text;         //Создание переменных, в которые заносятся значения из TextBox/PasswordBox
                string Parol1            = ParolText.Password;
                string RetryParol1       = RetryParolText.Password;
                string Dolznost1         = DolznkstText.Text;
                string FIO1            = FIOText.Text;
                string DataRozdeniy1   = DenRozdeniyText.Text;
                string NomerTelephona1 = TelephonText.Text;
                string Email1          = EmailText.Text;
                string Pol1            = PolText.Text;

                if (LoginPolzovately1.Length > 3 && Parol1.Length > 8) // Проверка логина и пароля на допустимое кол-во символов
                {
                    if (Parol1 == RetryParol1)                         //Проверка на совпадение паролей
                    {
                        RegistrPerson(LoginPolzovately1, Parol1, Dolznost1, FIO1, DataRozdeniy1, NomerTelephona1, Email1, Pol1);

                        MessageBox.Show("Регистрация успешна", "Регистрация");

                        LoginText.Clear();
                        ParolText.Clear();
                        RetryParolText.Clear();
                        DolznkstText.Clear();
                        FIOText.Clear();
                        DenRozdeniyText.Clear();
                        TelephonText.Clear();
                        EmailText.Clear();
                        PolText.Clear();
                        PerehodNaAvtorizaciy();
                    }
                    else
                    {
                        MessageBox.Show("Пароли не совпадают!", "Регистрация", MessageBoxButton.OK, MessageBoxImage.Information);
                        ParolText.Clear();
                        RetryParolText.Clear();
                    }
                }
                else
                {
                    MessageBox.Show("Логин должен быть больше трех символов.\nПароль должен быть больше восьми символов.", "Регистрация", MessageBoxButton.OK, MessageBoxImage.Information);
                }
            }
            catch
            {
                MessageBox.Show("Необходимо заполнить все поля", "Регистрация", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Beispiel #14
0
 private void MskCep_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (EmailText.Enabled)
         {
             EmailText.Focus();
         }
         else
         {
             ReturnButton.Focus();
         }
     }
 }
Beispiel #15
0
        private void UpdateBTN_Click(object sender, EventArgs e)
        {
            connect.Open();
            SqlCommand command = new SqlCommand("update Customer set CustomerID='" + CustomerIDText.Text.ToString() + "',Name='" + NameText.Text.ToString() + "',Surname='" + SurnameText.Text.ToString() + "',Address='" + AddressText.Text.ToString() + "',Telephone='" + TelephoneText.Text.ToString() + "',Email='" + EmailText.Text.ToString() + "'where CustomerID=" + CustomerID + "", connect);

            command.ExecuteNonQuery();
            connect.Close();
            viewdetails();
            CustomerIDText.Clear();
            NameText.Clear();
            SurnameText.Clear();
            AddressText.Clear();
            TelephoneText.Clear();
            EmailText.Clear();
        }
Beispiel #16
0
        private void DeleteBTN_Click(object sender, EventArgs e)
        {
            connect.Open();
            SqlCommand komut = new SqlCommand("Delete From Customer Where CustomerID=(" + sira + ")", connect);

            komut.ExecuteNonQuery();
            connect.Close();
            viewdetails();

            viewdetails();
            CustomerIDText.Clear();
            NameText.Clear();
            SurnameText.Clear();
            AddressText.Clear();
            TelephoneText.Clear();
            EmailText.Clear();
        }
Beispiel #17
0
        public override void ViewDidLayoutSubviews()
        {
            base.ViewDidLayoutSubviews();

            HeaderView.Frame = new CGRect(View.Frame.Left, View.Frame.Top, View.Frame.Width, StyledTextField.StyledFieldHeight);

            ScrollView.Frame = new CGRect(View.Frame.Left, HeaderView.Frame.Bottom, View.Frame.Width, View.Frame.Height - HeaderView.Frame.Height);

            UserNameText.SetFrame(new CGRect(-10, View.Frame.Height * .05f, View.Frame.Width + 20, StyledTextField.StyledFieldHeight));
            PasswordText.SetFrame(new CGRect(-10, UserNameText.Background.Frame.Bottom, View.Frame.Width + 20, StyledTextField.StyledFieldHeight));
            ConfirmPasswordText.SetFrame(new CGRect(-10, PasswordText.Background.Frame.Bottom, View.Frame.Width + 20, StyledTextField.StyledFieldHeight));

            NickNameText.SetFrame(new CGRect(-10, ConfirmPasswordText.Background.Frame.Bottom + 40, View.Frame.Width + 20, StyledTextField.StyledFieldHeight));
            LastNameText.SetFrame(new CGRect(-10, NickNameText.Background.Frame.Bottom, View.Frame.Width + 20, StyledTextField.StyledFieldHeight));

            EmailText.SetFrame(new CGRect(-10, LastNameText.Background.Frame.Bottom + 40, View.Frame.Width + 20, StyledTextField.StyledFieldHeight));
            CellPhoneText.SetFrame(new CGRect(-10, EmailText.Background.Frame.Bottom, View.Frame.Width + 20, StyledTextField.StyledFieldHeight));

            DoneButton.Frame   = new CGRect(View.Frame.Left + 10, CellPhoneText.Background.Frame.Bottom + 20, View.Bounds.Width - 20, ControlStyling.ButtonHeight);
            CancelButton.Frame = new CGRect((View.Frame.Width - ControlStyling.ButtonWidth) / 2, DoneButton.Frame.Bottom + 20, ControlStyling.ButtonWidth, ControlStyling.ButtonHeight);

            // for the scroll size, if the content is larger than the screen, we'll take the bottom
            // of the content plus some padding. Otherwise, we'll just use the window height plus a tiny bit so there's
            // a subtle scroll effect
            nfloat controlBottom = CancelButton.Frame.Bottom + (View.Bounds.Height * .25f);

            ScrollView.ContentSize = new CGSize(0, (nfloat)Math.Max(controlBottom, View.Bounds.Height * 1.05f));

            // setup the header shadow
            UIBezierPath shadowPath = UIBezierPath.FromRect(HeaderView.Bounds);

            HeaderView.Layer.MasksToBounds = false;
            HeaderView.Layer.ShadowColor   = UIColor.Black.CGColor;
            HeaderView.Layer.ShadowOffset  = new CGSize(0.0f, .0f);
            HeaderView.Layer.ShadowOpacity = .23f;
            HeaderView.Layer.ShadowPath    = shadowPath.CGPath;

            if (LogoView != null)
            {
                LogoView.Layer.Position = new CoreGraphics.CGPoint((HeaderView.Bounds.Width - LogoView.Bounds.Width) / 2, 0);
            }

            ResultView.SetBounds(View.Frame.ToRectF( ));
            BlockerView.SetBounds(View.Frame.ToRectF( ));
        }
Beispiel #18
0
 //Validating email address
 private void EmailText_Validating(object sender, CancelEventArgs e)
 {
     try
     {
         var  mail         = new MailAddress(EmailText.Text);
         bool isValidEmail = mail.Host.Contains(".");
         if (!isValidEmail)
         {
             MessageBox.Show("Not a valid e-mail address!");
             EmailText.Focus();
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Not a valid e-mail address!");
         EmailText.Focus();
     }
 }
Beispiel #19
0
        private void Login()
        {
            if (EmailText.ToString() == "" && password.ToString() == "")
            {
                Application.Current.MainPage.DisplayAlert("Correct", "Logrado", "Ok");
            }
            else
            {
                Application.Current.MainPage.DisplayAlert("Incorrecto", "No Logrado", "Cancel");
            }

            var user = new MVVMTest.Models.User
            {
                Email    = EmailText.ToLower(),
                Password = password.ToLower(),
                Firstname
            };
        }
Beispiel #20
0
        void ReleaseDesignerOutlets()
        {
            if (EmailText != null)
            {
                EmailText.Dispose();
                EmailText = null;
            }

            if (PasswordText != null)
            {
                PasswordText.Dispose();
                PasswordText = null;
            }

            if (ValidateButton != null)
            {
                ValidateButton.Dispose();
                ValidateButton = null;
            }
        }
Beispiel #21
0
        void ReleaseDesignerOutlets()
        {
            if (EmailText != null)
            {
                EmailText.Dispose();
                EmailText = null;
            }

            if (UsernameText != null)
            {
                UsernameText.Dispose();
                UsernameText = null;
            }

            if (verifyButton != null)
            {
                verifyButton.Dispose();
                verifyButton = null;
            }
        }
Beispiel #22
0
 private void AcceptButton_Click(object sender, EventArgs e)
 {
     IsValidEmail(EmailText.Text);
     IsValidName(FirstNameTextBox.Text);
     IsValidName(SurnameText.Text);
     if (PhoneNumberText.Text.Length != 11)
     {
         MessageBox.Show("The length of your phone number must be 11 digits");
         PhoneNumberText.Clear();
     }
     if (FirstNameTextBox.Text != "" && SurnameText.Text != "" && EmailText.Text != "" && PhoneNumberText.Text != "" && HourlyRateText.Text != "")
     {
         if (StylistSelectionForm.edit == false)
         {
             ReadInTextFile();
         }
         ListofStylists.Add(new SnippetsBackend.Stylist((FirstNameTextBox.Text), SurnameText.Text, EmailText.Text, PhoneNumberText.Text, double.Parse(HourlyRateText.Text)));
         //Add to textfile
         using (StreamWriter tw = new StreamWriter("ListofStylists.txt", false))
         {
             foreach (SnippetsBackend.Stylist s in ListofStylists)
             {
                 tw.WriteLine(s.FirstName + "," + s.LastName + "," + s.Email + "," + s.PhoneNumber + "," + s.HourlyRate);
             }
             tw.Close();
         }
         MessageBox.Show("Stylist has been added/edited");
         FirstNameTextBox.Clear();
         SurnameText.Clear();
         EmailText.Clear();
         PhoneNumberText.Clear();
         HourlyRateText.Clear();
         StylistTransactions.Items.Clear();
     }
     else if (FirstNameTextBox.Text == "" || SurnameText.Text == "" || EmailText.Text == "" || PhoneNumberText.Text == "" || HourlyRateText.Text == "")
     {
         MessageBox.Show("Please fill in all the textboxes");
     }
 }
Beispiel #23
0
 private void EmailText_Click(object sender, EventArgs e)
 {
     EmailText.Clear();
 }
Beispiel #24
0
        private void SaveStudentButton_Click(object sender, EventArgs e)
        {
            try
            {
                Person person = new Person();
                try
                {
                    person.fname = FirstNametext.Text;
                }
                catch (ArgumentException)
                {
                    MessageBox.Show("Please Enter correct first name!");
                    FirstNametext.Clear();
                    throw new ArgumentException();
                }
                try
                {
                    person.lname = LastNameText.Text;
                }
                catch (ArgumentException)
                {
                    MessageBox.Show("Please Enter correct last name!");
                    LastNameText.Clear();
                    throw new ArgumentException();
                }
                try
                {
                    person.Contact = ContactText.Text;
                }
                catch (ArgumentException)
                {
                    MessageBox.Show("Please enter the correct 11 digit contact number");
                    ContactText.Clear();
                    throw new ArgumentException();
                }
                try
                {
                    person.Email = EmailText.Text;
                }
                catch (ArgumentException)
                {
                    MessageBox.Show("Please Enter the email address");
                    EmailText.Clear();
                    throw new ArgumentException();
                }
                catch (FormatException)
                {
                    MessageBox.Show("Please Enter the correct email address");
                    EmailText.Clear();
                    throw new ArgumentException();
                }
                try
                {
                    person.DOB = DOBdateTimePicker.Value;
                }
                catch (ArgumentException)
                {
                    MessageBox.Show("Person Age Must Be Greater Than 18");
                    DOBdateTimePicker.Value = DateTime.Now;
                    throw new ArgumentException();
                }
                try
                {
                    person.Gender = GenderComboBox.Text;
                }
                catch (ArgumentException)
                {
                    MessageBox.Show("Please Select the gender From the dropdown list");
                    throw new ArgumentException();
                }

                Student student = new Student();
                try
                {
                    student.regNo = RegistrationNoText.Text;
                }
                catch (ArgumentException)
                {
                    MessageBox.Show("Please Enter the Registration Number in the Format 1234-XY-567");
                    RegistrationNoText.Clear();
                    throw new ArgumentException();
                }

                if (value1 == "add")
                {
                    SqlConnection connection = new SqlConnection(connString);
                    connection.Open();
                    string     genderid = string.Format("SELECT Id FROM LookUp WHERE Value = '{0}' AND Category = 'GENDER'", person.Gender);
                    SqlCommand cmd      = new SqlCommand(genderid, connection);
                    int        id       = (Int32)cmd.ExecuteScalar();

                    String cmdtext = String.Format("INSERT INTO Person(FirstName, LastName, Contact, Email, DateOfBirth, Gender) values('{0}','{1}', '{2}', '{3}', '{4}', '{5}' )", person.fname, person.lname, person.Contact, person.Email, person.DOB, id);
                    cmd.CommandText = cmdtext;
                    cmd.ExecuteNonQuery();

                    string getid = string.Format("SELECT id FROM Person WHERE Email = '{0}'", person.Email);
                    cmd.CommandText = getid;
                    id = (Int32)cmd.ExecuteScalar();

                    string addStudent = string.Format("INSERT INTO Student(Id, RegistrationNo) values('{0}' , '{1}')", id, student.regNo);
                    cmd.CommandText = addStudent;
                    cmd.ExecuteNonQuery();

                    MessageBox.Show("Student Added");
                    connection.Close();
                }
                else if (value1 == "edit")
                {
                    SqlConnection connection = new SqlConnection(connString);
                    connection.Open();

                    string     getGenderId = string.Format("SELECT Id FROM LookUp WHERE Value = '{0}' AND Category = 'GENDER'", GenderComboBox.Text);
                    SqlCommand cmd         = new SqlCommand(getGenderId, connection);
                    int        gender      = (Int32)cmd.ExecuteScalar();
                    string     update      = string.Format("UPDATE Student SET RegistrationNo = '{0}' WHERE Id = '{1}'", RegistrationNoText.Text, IDStudent);
                    cmd.CommandText = update;
                    cmd.ExecuteNonQuery();
                    cmd.CommandText = string.Format("UPDATE Person SET FirstName = '{0}', LastName = '{1}', Contact = '{2}', Email = '{3}', " +
                                                    "DateOfBirth = '{4}', Gender = '{5}' WHERE Id = '{6}'", FirstNametext.Text, LastNameText.Text, ContactText.Text, EmailText.Text, DOBdateTimePicker.Value, gender, IDStudent);
                    cmd.ExecuteNonQuery();
                    MessageBox.Show("Student Updated!");
                    connection.Close();
                }
                ManageStudentsForm form = new ManageStudentsForm();
                this.Close();
                form.Show();
            }
            catch (Exception)
            {
                MessageBox.Show("Student not saved. Please try again!");
            }
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            DisplayNameText.Text = StringWithEmojiConverter.ConvertEmojiFromServer(SL.Profile.UserName);//need to anderstand difference from NameText
            CityText.Text        = SL.Profile.City ?? "";
            NameOfCity           = SL.Profile.City ?? "";
            NameText.Text        = SL.Profile.UserName;

            CityText.EditingChanged += (s, e) =>
            {
                CityText.Text = CheckText(CityText.Text);
            };

            EmailText.EditingDidEnd += (s, e) =>
            {
                var profile = SL.Profile;
                profile.EmailAddress = EmailText.Text;
                SL.Manager.SaveProfileAsync(profile);
                SL.Profile = profile;
            };

            NameText.ShouldReturn = delegate
            {
                NameText.EndEditing(true);
                return(true);
            };

            DisplayNameText.ShouldReturn = delegate
            {
                DisplayNameText.EndEditing(true);
                return(true);
            };

            CityText.ShouldReturn = delegate
            {
                CityText.EndEditing(true);
                return(true);
            };

            EmailText.ShouldReturn = delegate
            {
                EmailText.EndEditing(true);
                return(true);
            };

            var tap = new UITapGestureRecognizer(() =>
            {
                foreach (var view in View.Subviews[0].Subviews[0].Subviews)
                {
                    if (view is UITextView text)
                    {
                        text.ResignFirstResponder();
                    }
                    if (view is UITextField text1)
                    {
                        text1.ResignFirstResponder();
                    }
                }
            });

            View.AddGestureRecognizer(tap);

            EmailText.Text = SL.Profile.EmailAddress;

            var version = NSBundle.MainBundle.InfoDictionary["CFBundleVersion"];//NSBundle.MainBundle.InfoDictionary["CFBundleShortVersionString"];

            VersionNumber.Text = $"v{version.Description}";

            #region v2
            //swFromElectricAdvinture.On = SL.AppSettings.GetValueOrDefault("FromElectricAdvintureEnabled", false);
            //swFromElectricAdvinture.ValueChanged += SwFromElectricAdvinture_ValueChanged;

            //Need remove to v.2
            Name_View.TranslatesAutoresizingMaskIntoConstraints = false;
            Name_Divider.Hidden = true;
            Name_View.RemoveConstraint(Name_View_Aspect);
            Name_View.AddConstraint(NSLayoutConstraint.Create(Name_View, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 0, 0));
            Name_View.UpdateConstraints();
            #endregion

            swComments.On            = SL.AppSettings.GetValueOrDefault("CommentsEnabled", false);
            swComments.ValueChanged += SwComments_ValueChanged;

            swLikes.On            = SL.AppSettings.GetValueOrDefault("LikesEnabled", false);
            swLikes.ValueChanged += SwLikes_ValueChanged;

            swDiscoverTeams.On            = SL.AppSettings.GetValueOrDefault("DiscoverTeamsEnabled", false);
            swDiscoverTeams.ValueChanged += SwDiscoverTeams_ValueChanged;

            swHideSocialNetworks.On            = SL.AppSettings.GetValueOrDefault("HideSocialNetworksEnabled", false);
            swHideSocialNetworks.ValueChanged += SwHideSocialNetworks_ValueChanged;

            #region v1
            var notificationStatus = SL.AppSettings.GetValueOrDefault("NotificationStatus", string.Empty);
            swNotifications.On            = notificationStatus.Equals(Enums.NotififcationStatus.Enabled.ToString()) ? true : false;
            swNotifications.ValueChanged += SwNotifications_ValueChanged;

            //SetupNotificationSwitch();

            ViewHideBlockDiscover.AddConstraint(NSLayoutConstraint.Create(ViewHideBlockDiscover, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1, 0));
            ViewHideBlockNotification.AddConstraint(NSLayoutConstraint.Create(ViewHideBlockNotification, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1, 0));
            View.UpdateConstraints();
            #endregion
        }
Beispiel #26
0
 //Method for Forget password link//
 public void ForgetPassword(string value)
 {
     EmailText.EnterText(value);
     Console.WriteLine("Clicked Forget Password link");
 }
Beispiel #27
0
        void ReleaseDesignerOutlets()
        {
            if (account_settings_title != null)
            {
                account_settings_title.Dispose();
                account_settings_title = null;
            }

            if (BioText != null)
            {
                BioText.Dispose();
                BioText = null;
            }

            if (BtnLocationSettings != null)
            {
                BtnLocationSettings.Dispose();
                BtnLocationSettings = null;
            }

            if (CityText != null)
            {
                CityText.Dispose();
                CityText = null;
            }

            if (DisplayNameText != null)
            {
                DisplayNameText.Dispose();
                DisplayNameText = null;
            }

            if (EmailText != null)
            {
                EmailText.Dispose();
                EmailText = null;
            }

            if (first_label_account_settings_title != null)
            {
                first_label_account_settings_title.Dispose();
                first_label_account_settings_title = null;
            }

            if (lblBio != null)
            {
                lblBio.Dispose();
                lblBio = null;
            }

            if (lblCity != null)
            {
                lblCity.Dispose();
                lblCity = null;
            }

            if (lblComments != null)
            {
                lblComments.Dispose();
                lblComments = null;
            }

            if (lblCount != null)
            {
                lblCount.Dispose();
                lblCount = null;
            }

            if (lblDiscoverDescription != null)
            {
                lblDiscoverDescription.Dispose();
                lblDiscoverDescription = null;
            }

            if (lblDiscoverTeams != null)
            {
                lblDiscoverTeams.Dispose();
                lblDiscoverTeams = null;
            }

            if (lblDisplayName != null)
            {
                lblDisplayName.Dispose();
                lblDisplayName = null;
            }

            if (lblEmail != null)
            {
                lblEmail.Dispose();
                lblEmail = null;
            }

            if (lblHideSocialNetworks != null)
            {
                lblHideSocialNetworks.Dispose();
                lblHideSocialNetworks = null;
            }

            if (lblLikes != null)
            {
                lblLikes.Dispose();
                lblLikes = null;
            }

            if (lblLocation != null)
            {
                lblLocation.Dispose();
                lblLocation = null;
            }

            if (lblName != null)
            {
                lblName.Dispose();
                lblName = null;
            }

            if (lblNotifications != null)
            {
                lblNotifications.Dispose();
                lblNotifications = null;
            }

            if (lblPrivacy != null)
            {
                lblPrivacy.Dispose();
                lblPrivacy = null;
            }

            if (lblProfile != null)
            {
                lblProfile.Dispose();
                lblProfile = null;
            }

            if (left_side_margin_view != null)
            {
                left_side_margin_view.Dispose();
                left_side_margin_view = null;
            }

            if (MainScroll != null)
            {
                MainScroll.Dispose();
                MainScroll = null;
            }

            if (MainScrollBottomConstraint != null)
            {
                MainScrollBottomConstraint.Dispose();
                MainScrollBottomConstraint = null;
            }

            if (Name_Divider != null)
            {
                Name_Divider.Dispose();
                Name_Divider = null;
            }

            if (Name_View != null)
            {
                Name_View.Dispose();
                Name_View = null;
            }

            if (Name_View_Aspect != null)
            {
                Name_View_Aspect.Dispose();
                Name_View_Aspect = null;
            }

            if (NameText != null)
            {
                NameText.Dispose();
                NameText = null;
            }

            if (parent != null)
            {
                parent.Dispose();
                parent = null;
            }

            if (rightLoMargin != null)
            {
                rightLoMargin.Dispose();
                rightLoMargin = null;
            }

            if (second_label_account_settings_title != null)
            {
                second_label_account_settings_title.Dispose();
                second_label_account_settings_title = null;
            }

            if (swComments != null)
            {
                swComments.Dispose();
                swComments = null;
            }

            if (swDiscoverTeams != null)
            {
                swDiscoverTeams.Dispose();
                swDiscoverTeams = null;
            }

            if (swHideSocialNetworks != null)
            {
                swHideSocialNetworks.Dispose();
                swHideSocialNetworks = null;
            }

            if (swLikes != null)
            {
                swLikes.Dispose();
                swLikes = null;
            }

            if (swNotifications != null)
            {
                swNotifications.Dispose();
                swNotifications = null;
            }

            if (VersionNumber != null)
            {
                VersionNumber.Dispose();
                VersionNumber = null;
            }

            if (ViewHideBlockDiscover != null)
            {
                ViewHideBlockDiscover.Dispose();
                ViewHideBlockDiscover = null;
            }

            if (ViewHideBlockNotification != null)
            {
                ViewHideBlockNotification.Dispose();
                ViewHideBlockNotification = null;
            }
        }
        private void InitViews()
        {
            LogoImage?.SetImageFromResource(DrawableConstants.LogoIcon);
            BackroundImage?.SetImageFromResource(DrawableConstants.SignBackround);

            if (PasswordWatchImage != null)
            {
                PasswordWatchImage?.SetImageFromResource(DrawableConstants.ShowPassword);
                PasswordWatchImage.SetImageColorFilter(ColorConstants.ButtonGray);

                PasswordWatchImage.Click -= ShowPasswordContent;
                PasswordWatchImage.Click += ShowPasswordContent;
            }

            if (EmailPlaceholderText != null)
            {
                EmailPlaceholderText.Text = RSign.SignEmailText;
                EmailPlaceholderText.SetFont(FontsConstant.RobotoRegular, FontsConstant.Size15);
                EmailPlaceholderText.SetTextColor(ColorConstants.ButtonGray);
            }

            if (EmailText != null)
            {
                EmailText.SetTextColor(ColorConstants.WhiteColor);
                EmailText.SetCursorColor(ColorConstants.SelectorHome);

                EmailText.Focus -= LineEmail;
                EmailText.Focus += LineEmail;
                EmailText.SetFont(FontsConstant.RobotoRegular, FontsConstant.Size16);
            }

            EmailLineText?.SetBackgroundColor(ColorConstants.WhiteColor);

            if (PasswordPlaceholderText != null)
            {
                PasswordPlaceholderText.Text = RSign.SignPasswordText;
                PasswordPlaceholderText.SetFont(FontsConstant.OpenSansRegular, FontsConstant.Size15);
                PasswordPlaceholderText.SetTextColor(ColorConstants.ButtonGray);
            }

            if (PasswordText != null)
            {
                PasswordText.SetTextColor(ColorConstants.WhiteColor);
                PasswordText.SetSecure(InputType.Password);
                PasswordText.SetFont(FontsConstant.OpenSansRegular, FontsConstant.Size16);
                PasswordText.SetCursorColor(ColorConstants.SelectorHome);

                PasswordText.Focus -= LinePassword;
                PasswordText.Focus += LinePassword;
            }

            PasswordLineText?.SetBackgroundColor(ColorConstants.WhiteColor);

            if (PasswordForgotText != null)
            {
                PasswordForgotText.Text = RSign.SignForgotText;
                PasswordForgotText.SetTextColor(ColorConstants.WhiteColor);
                PasswordForgotText.SetFont(FontsConstant.RobotoRegular, FontsConstant.Size15);
            }

            if (SignInText != null)
            {
                SignInText.Text = RSign.SignSignInText.ToUpperInvariant();
                SignInText.SetTextColor(ColorConstants.WhiteColor);
                SignInText.SetBackgroundColor(ColorConstants.SelectorHome);
                SignInText.SetSelectedColor(ColorConstants.WhiteColor);
                SignInText.SetFont(FontsConstant.RobotoBold, FontsConstant.Size14);
            }

            if (RegistrationDontAccountText != null)
            {
                RegistrationDontAccountText.Text = RSign.SignNotHaveAccount;
                RegistrationDontAccountText.SetTextColor(ColorConstants.WhiteColor);
                RegistrationDontAccountText.SetFont(FontsConstant.RobotoRegular, FontsConstant.Size15);
            }

            if (SignUpText != null)
            {
                SignUpText.Text = RSign.SignSignUpText;
                SignUpText.SetTextColor(ColorConstants.SelectorHome);
                SignUpText.SetFont(FontsConstant.RobotoRegular, FontsConstant.Size15);

                SignUpText.Click -= SignUp_Click;
                SignUpText.Click += SignUp_Click;
            }

            if (ConnectFacebookText != null)
            {
                ConnectFacebookText.Text = RSign.SignWithFacebook.ToUpperInvariant();
                ConnectFacebookText.SetTextColor(ColorConstants.WhiteColor);
                ConnectFacebookText.SetBackgroundColor(ColorConstants.BlueFacebookColor);
                ConnectFacebookText.SetSelectedColor(ColorConstants.WhiteColor);
                ConnectFacebookText.SetFont(FontsConstant.MontserratBold, FontsConstant.Size12);
            }

            ConnectFacebookImage?.SetImageFromResource(DrawableConstants.FacebookLogo);
            FacebookContent?.SetBackgroundColor(ColorConstants.BlueFacebookColor);
        }
Beispiel #29
0
 public LoginPage()
 {
     InitializeComponent();
     EmailText.Focus();
 }
        private void AddAdvisor1_Click(object sender, EventArgs e)
        {
            try
            {
                Person person = new Person();
                try
                {
                    person.fname = FirstNametext.Text;
                }
                catch (ArgumentException)
                {
                    MessageBox.Show("Please Enter correct first name!");
                    FirstNametext.Clear();
                    throw new ArgumentException();
                }
                try
                {
                    person.lname = LastNameText.Text;
                }
                catch (ArgumentException)
                {
                    MessageBox.Show("Please Enter correct last name!");
                    LastNameText.Clear();
                    throw new ArgumentException();
                }
                try
                {
                    person.Contact = ContactText.Text;
                }
                catch (ArgumentException)
                {
                    MessageBox.Show("Please enter the correct 11 digit contact number");
                    ContactText.Clear();
                    throw new ArgumentException();
                }
                try
                {
                    person.Email = EmailText.Text;
                }
                catch (ArgumentException)
                {
                    MessageBox.Show("Please Enter the email address");
                    EmailText.Clear();
                    throw new ArgumentException();
                }
                catch (FormatException)
                {
                    MessageBox.Show("Please Enter the correct email address");
                    EmailText.Clear();
                    throw new ArgumentException();
                }
                try
                {
                    person.DOB = DOBdateTimePicker.Value;
                }
                catch (ArgumentException)
                {
                    MessageBox.Show("Person Age Must Be Greater Than 18");
                    DOBdateTimePicker.Value = DateTime.Now;
                    throw new ArgumentException();
                }
                try
                {
                    person.Gender = GenderComboBox.Text;
                }
                catch (ArgumentException)
                {
                    MessageBox.Show("Please Select the gender From the dropdown list");
                    throw new ArgumentException();
                }

                Advisor advisor = new Advisor();
                try
                {
                    advisor.designation = designationComboBox.Text;
                }
                catch (ArgumentException)
                {
                    MessageBox.Show("Please select designation from the dropdown list");
                    designationComboBox.ResetText();
                    throw new ArgumentException();
                }

                try
                {
                    advisor.salary = SalaryTextBox.Text;
                }
                catch
                {
                    MessageBox.Show("Please enter the salary in digits");
                    throw new ArgumentException();
                }
                if (value1 == "add")
                {
                    SqlConnection connection = new SqlConnection(connString);
                    connection.Open();
                    string     genderid = string.Format("SELECT Id FROM LookUp WHERE Value = '{0}' AND Category = 'GENDER'", GenderComboBox.Text);
                    SqlCommand cmd      = new SqlCommand(genderid, connection);
                    int        id       = (Int32)cmd.ExecuteScalar();

                    String cmdtext = String.Format("INSERT INTO Person(FirstName, LastName, Contact, Email, DateOfBirth, Gender) values('{0}','{1}', '{2}', '{3}', '{4}', '{5}' )", FirstNametext.Text, LastNameText.Text, ContactText.Text, EmailText.Text, DOBdateTimePicker.Value, id);
                    cmd.CommandText = cmdtext;
                    cmd.ExecuteNonQuery();

                    string getid = string.Format("SELECT id FROM Person WHERE Email = '{0}'", EmailText.Text);
                    cmd.CommandText = getid;
                    id = (Int32)cmd.ExecuteScalar();

                    cmd.CommandText = string.Format("SELECT Id FROM Lookup WHERE Value = '{0}' AND Category = 'DESIGNATION'", designationComboBox.Text);
                    int desig = (Int32)cmd.ExecuteScalar();

                    string addStudent = string.Format("INSERT INTO Advisor(Id, Designation, Salary) values('{0}' , '{1}', '{2}')", id, desig, SalaryTextBox.Text);
                    cmd.CommandText = addStudent;
                    cmd.ExecuteNonQuery();

                    MessageBox.Show("Advisor Added");
                    connection.Close();
                }
                else if (value1 == "edit")
                {
                    SqlConnection connection = new SqlConnection(connString);
                    connection.Open();

                    string     getGenderId = string.Format("SELECT Id FROM LookUp WHERE Value = '{0}' AND Category = 'GENDER'", GenderComboBox.Text);
                    SqlCommand cmd         = new SqlCommand(getGenderId, connection);
                    int        gender      = (Int32)cmd.ExecuteScalar();

                    cmd.CommandText = String.Format("SELECT Id FROM Lookup WHERE Value = '{0}' AND Category = 'DESIGNATION'", designationComboBox.Text);
                    int desig = (Int32)cmd.ExecuteScalar();

                    cmd.CommandText = string.Format("UPDATE Person SET FirstName = '{0}', LastName = '{1}', Contact = '{2}', Email = '{3}', " +
                                                    "DateOfBirth = '{4}', Gender = '{5}' WHERE Id = '{6}'", FirstNametext.Text, LastNameText.Text, ContactText.Text, EmailText.Text, DOBdateTimePicker.Value, gender, IDadvisor);
                    cmd.ExecuteNonQuery();

                    cmd.CommandText = string.Format("UPDATE Advisor SET Designation = '{0}', Salary = '{1}' " +
                                                    "WHERE Id = '{2}'", desig, int.Parse(SalaryTextBox.Text), IDadvisor);
                    cmd.ExecuteNonQuery();
                    MessageBox.Show("Advisor Updated!");
                    connection.Close();
                }
                ManageAdvisors form = new ManageAdvisors();
                this.Close();
                form.Show();
            }
            catch (Exception)
            {
                MessageBox.Show("Advisor not saved. Please try again!");
            }
        }