Example #1
0
 public void Clear()
 {
     IDText.Clear();
     FullNameText.Clear();
     UserNameText.Clear();
     PasswordText.Clear();
 }
Example #2
0
        private void UsernameAssessFeasibility()
        {
            IsDoneEvaluateUserName = false;
            UserNameVerifingTextBlockVisibility = Visibility.Visible;
            UserNameVerifiedTextBlockVisibility = Visibility.Collapsed;
            UserNameAwareTextBlockVisibility    = Visibility.Collapsed;
            IsUsernameTextBoxEnable             = false;

            UserNameAwareMessage mes = UserNameAwareMessage.Empty;

            UserNameVerifiedTextBlockVisibility = Visibility.Collapsed;

            if (string.IsNullOrEmpty(UserNameText))
            {
                mes = UserNameAwareMessage.Empty;
                ShowUsernameAlertMessage(mes);
                return;
            }
            else if (UserNameText.Contains(" "))
            {
                mes = UserNameAwareMessage.WhiteSpaceAware;
                ShowUsernameAlertMessage(mes);
                return;
            }
            else if (UserNameText.IndexOfAny(PharmacyDefinitions.SPECIAL_CHARS_OF_USERNAME) != -1)
            {
                mes = UserNameAwareMessage.SpecialCharacter;
                ShowUsernameAlertMessage(mes);
                return;
            }

            // Last condition for user name
            IsUserNameExisted(mes);
        }
Example #3
0
 private void ClearForm()
 {
     UserNameText.Clear();
     EmailText.Clear();
     NameText.Clear();
     PasswordText.Clear();
     ChangePasswordChk.Checked = false;
     ActiveChk.Checked         = false;
 }
Example #4
0
        public void ReadingInTextFile()
        {
            const string textfile = "Savedlist.txt";

            using (StreamReader r = new StreamReader(textfile))
            {
                string line;
                string Password = "";
                string UserName = "";
                string FullName = "";
                string ID       = "";
                while ((line = r.ReadLine()) != null)
                {
                    string[] linearray = line.Split(',');
                    for (int i = 0; i < linearray.Length; i++)
                    {
                        switch (i)
                        {
                        case 0:
                            ID = linearray[i];
                            break;

                        case 1:
                            FullName = linearray[i];
                            break;

                        case 2:
                            UserName = linearray[i];
                            break;

                        case 3:
                            Password = linearray[i];
                            break;
                        }
                    }
                    List <EmployeeDetails> Listofemployees = new List <EmployeeDetails>();
                    Listofemployees.Add(new EmployeeDetails(int.Parse(ID), FullName, UserName, Password));
                    if (UserName == UserNameText.Text || ID == IDText.Text)
                    {
                        MessageBox.Show("Please enter a different username or ID as this has already been used");
                        if (UserName == UserNameText.Text)
                        {
                            UserNameText.Clear();
                        }
                        if (ID == IDText.Text)
                        {
                            IDText.Clear();
                        }
                        inuse = true;
                    }
                }
            }
        }
Example #5
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( ));
        }
        void ReleaseDesignerOutlets()
        {
            if (UserNameText != null)
            {
                UserNameText.Dispose();
                UserNameText = null;
            }

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

            if (LoginButton != null)
            {
                LoginButton.Dispose();
                LoginButton = null;
            }
        }
Example #7
0
 public void LogIn(string userName, string password)
 {
     try
     {
         if (AnotherUserLink.Displayed)
         {
             ElementAccessors.DoClick(this.driver, AnotherUserLink);
         }
     }
     catch (Exception)
     {  }
     finally
     {
         UserNameText.SendKeys(userName);
         PasswordText.SendKeys(password);
         ElementAccessors.Wait(4);
         ElementAccessors.DoClick(this.driver, SignInButton);
         ElementAccessors.Wait(4);
     }
 }
        public bool ChangeUserAccess(string UserName, string UserType)
        {
            ////ManageUsersTab.Click();
            javaScriptExecutor.ExecuteScript("arguments[0].click();", ManageUsersTab);
            UserNameText.Set(UserName);
            ////SearchBtn.Click();
            javaScriptExecutor.ExecuteScript("arguments[0].click();", SearchBtn);
            webDriver.WaitForPageLoad(TimeSpan.FromSeconds(5));
            ////webDriver.FindElement(By.XPath("//a[contains(text(),'" + UserName + "')]")).Click(); // Searched Username is dynamic
            javaScriptExecutor.ExecuteScript(
                "arguments[0].click();",
                webDriver.FindElement(By.XPath("//a[contains(text(),'" + UserName + "')]"))); // Searched Username is dynamic
            webDriver.WaitForPageLoad(TimeSpan.FromSeconds(5));
            SelectElement userType = new SelectElement(UserTypeList);

            userType.SelectByText(UserType);
            ////UpdateUserLink.Click();
            javaScriptExecutor.ExecuteScript("arguments[0].click();", UpdateUserLink);
            if (UpdateSuccessMsg.Displayed)
            {
                UserNameText.Set(UserName);
                ////SearchBtn.Click();
                javaScriptExecutor.ExecuteScript("arguments[0].click();", SearchBtn);
                webDriver.WaitForPageLoad(TimeSpan.FromSeconds(20));
                if (UserTypeValue.Text.Trim() == UserType)
                {
                    Console.WriteLine("User Type is changed Successfully");
                    return(true);
                }
                else
                {
                    Console.WriteLine("User Type is not changed Successfully");
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Example #9
0
        private void Save_Click(object sender, EventArgs e)
        {
            if (IDText.Text == "" || FullNameText.Text == "" || UserNameText.Text == "" || PasswordText.Text == "")
            {
                MessageBox.Show("Please fill in all the boxes");
                IDText.Clear();
                FullNameText.Clear();
                UserNameText.Clear();
                PasswordText.Clear();
            }
            if (System.Text.RegularExpressions.Regex.IsMatch(IDText.Text, "[^0-9]"))
            {
                MessageBox.Show("Please enter only numbers");
                IDText.Clear();
            }
            else if (IDText.Text != "" && FullNameText.Text != "" && UserNameText.Text != "" && PasswordText.Text != "")
            {
                ReadingInTextFile();
                if (inuse == false)
                {
                    List <EmployeeDetails> Listofemployees = new List <EmployeeDetails>();
                    Listofemployees.Add(new EmployeeDetails(int.Parse(IDText.Text), FullNameText.Text, UserNameText.Text, PasswordText.Text));

                    MessageBox.Show("Employee has been added to the system");
                    using (StreamWriter tw = new StreamWriter("Savedlist.txt", true))
                    {
                        foreach (EmployeeDetails s in Listofemployees)
                        {
                            tw.WriteLine(s.ID + "," + s.FullName + "," + s.UserName + "," + s.Password);
                            tw.Close();
                        }
                    }
                    Clear();
                }
            }
            inuse = false;
        }
 public LoginWindow()
 {
     InitializeComponent();
     appLog = new AppLog("LoginWindows");
     UserNameText.Focus();
 }
 private void ClearButton_Click(object sender, EventArgs e)
 {
     UserNameText.Clear();
     PasswordText.Clear();
     UserNameText.Focus();
 }