private void Reset()
        {
            TxtName.Clear();
            TxtSurname.Clear();
            TxtLogin.Clear();
            TxtPassword.Clear();

            BtnCreate.Visibility = Visibility.Visible;
            BtnUpdate.Visibility = Visibility.Hidden;
            BtnDelete.Visibility = Visibility.Hidden;

            FillUsers();
        }
コード例 #2
0
ファイル: LoginPage.cs プロジェクト: DanilaKe/TAT_2018.2
        /// <summary>
        /// Method TryLogin
        /// Gets login and password, and try login in site.
        /// </summary>
        /// <param name="login">String with login</param>
        /// <param name="password">String with password.</param>
        /// <returns>Answers whether you managed to enter.</returns>
        public bool TryLogin(string login, string password)
        {
            WaitUntil(TxtLogin).Click();
            TxtLogin.Clear();
            TxtLogin.SendKeys(login);

            WaitUntil(TxtPassword).Click();
            TxtPassword.Clear();
            TxtPassword.SendKeys(password);

            WaitUntil(BtnLogin).Click();
            return(Browser.WebDriver.Url.Contains(BuyTicketPage.Url));
        }
コード例 #3
0
 private void TxtLogin_Changed(object sender, DependencyPropertyChangedEventArgs e)
 {
     if (TxtLogin.Text == "Адрес электронной почты")
     {
         TxtLogin.Clear();
         TxtLogin.Foreground = Brushes.Black;
     }
     else
     {
         if (string.IsNullOrWhiteSpace(TxtLogin.Text))
         {
             TxtLogin.Foreground = Brushes.Gray;
             TxtLogin.Text       = "Адрес электронной почты";
         }
     }
 }
コード例 #4
0
ファイル: MembersUC.cs プロジェクト: ATGfx/MMSoft
        private void MemberClick(UInt32 MemberID_UL)
        {
            // Load client info in each control
            String        SQLRequest_ST;
            SqlDataReader SqlDataReader_O;
            UInt32        CPID_UL         = 0;
            UInt32        PersStatusID_UL = 0;

            mInitializingData_b = true;

            TxtTel.Clear();
            DTPBirthdate.Value = DTPBirthdate.MinDate;
            DTPEntryDate.Value = DTPEntryDate.MinDate;

            TxtCost.Clear();
            TxtBankAccount.Clear();
            TxtRegNumber.Clear();
            TxtChilds.Clear();
            TxtAdress.Clear();
            ComBoxFamilyState.SelectedItem = null;
            CheckBoxActivePartner.Checked  = false;
            DBComboxStatus.ClearSelectedItem();
            ComboxPostalCode.ClearSelectedItem();
            ComboxLocality.ClearSelectedItem();
            LblMemberName.Text            = "";
            CheckBoxActivePartner.Checked = false;
            DepartmentSelector.Clear();
            MemberDayChickingViewer.ChangePers(0, true);
            TxtLogin.Clear();

            bool ActivePartner_b = false;

            if (mDBManager_O != null && mDBManager_O.mConnected_b)
            {
                // Fill fields of member
                SQLRequest_ST   = "SELECT * FROM Pers WHERE PersID=" + MemberID_UL;
                SqlDataReader_O = mDBManager_O.Select(SQLRequest_ST);

                while (SqlDataReader_O.Read())
                {
                    bool.TryParse(SqlDataReader_O["ConjActif"].ToString(), out ActivePartner_b);

                    // Fill info in panel edit controls
                    TxtTel.Text = SqlDataReader_O["NumTel"].ToString();
                    try
                    {
                        DTPBirthdate.Value = Convert.ToDateTime(SqlDataReader_O["DateNaissance"].ToString());
                    }
                    catch (FormatException e)
                    {
                        DTPBirthdate.Value = DTPBirthdate.MinDate;
                    }

                    try
                    {
                        DTPEntryDate.Value = Convert.ToDateTime(SqlDataReader_O["DateEntreeService"].ToString());
                    }
                    catch (FormatException e)
                    {
                        DTPEntryDate.Value = DTPEntryDate.MinDate;
                    }

                    TxtCost.Text           = SqlDataReader_O["CoutHeure"].ToString() + "\u20AC";
                    TxtBankAccount.Text    = SqlDataReader_O["CompteBanq"].ToString();
                    TxtRegNumber.Text      = SqlDataReader_O["NumRegNat"].ToString();
                    TxtChilds.Text         = SqlDataReader_O["NbrEnfCharge"].ToString();
                    TxtAdress.Text         = SqlDataReader_O["Adresse"].ToString();
                    ComBoxFamilyState.Text = SqlDataReader_O["SitFam"].ToString();
                    TxtLogin.Text          = SqlDataReader_O["UserLogin"].ToString();

                    CheckBoxActivePartner.Checked = ActivePartner_b;

                    if (UInt32.TryParse(SqlDataReader_O["PersStatutID"].ToString(), out PersStatusID_UL))
                    {
                        DBComboxStatus.SelectItemByID(PersStatusID_UL);
                    }
                    if (UInt32.TryParse(SqlDataReader_O["CodePostalID"].ToString(), out CPID_UL))
                    {
                        ComboxPostalCode.SelectItemByID(CPID_UL);
                        ComboxLocality.SelectItemByID(CPID_UL);
                    }
                    else
                    {
                        ComboxPostalCode.ClearSelectedItem();
                        ComboxLocality.ClearSelectedItem();
                    }

                    // Fill info in panel check controls
                    LblMemberName.Text = SqlDataReader_O["PersNom"].ToString();

                    CheckBoxActivePartner.Checked = ActivePartner_b;

                    // Refresh checking recap
                    //int NbDays = DateTime.Today.DayOfWeek - DayOfWeek.Monday;
                    if (!String.IsNullOrEmpty(SqlDataReader_O["PersNom"].ToString()))
                    {
                        MemberDayChickingViewer.ChangePers(MemberID_UL, true);
                    }
                }

                SqlDataReader_O.Close();

                // Fill associated departments
                SQLRequest_ST   = "SELECT DepID FROM RelDepPers WHERE PersID=" + MemberID_UL;
                SqlDataReader_O = mDBManager_O.Select(SQLRequest_ST);
                List <UInt32> DepID_UL = new List <UInt32>();
                UInt32        ID_UL;

                while (SqlDataReader_O.Read())
                {
                    if (UInt32.TryParse(SqlDataReader_O["DepID"].ToString(), out ID_UL))
                    {
                        DepID_UL.Add(ID_UL);
                    }
                }

                DepartmentSelector.CheckDepartments(DepID_UL);

                SqlDataReader_O.Close();
            }

            mInitializingData_b = false;
        }