Example #1
0
 private void GetCityList()
 {
     TxtCity.DataSource     = GlobFuncs.GetDDL("CityTable", "CityId", "CityName");
     TxtCity.DataTextField  = "name";
     TxtCity.DataValueField = "id";
     TxtCity.DataBind();
 }
Example #2
0
 //Clear all the fiels
 private void clearfields()
 {
     TxtName.Clear();
     TxtPhone.Clear();
     TxtAdd.Clear();
     TxtCity.Clear();
     TxtSuburb.Clear();
 }
Example #3
0
 private void BtnClear_Click(object sender, RoutedEventArgs e)
 {
     TxtTournamentName.Clear();
     TxtPrizePool.Clear();
     TxtSponsor.Clear();
     TxtCountry.Clear();
     TxtCity.Clear();
     TXTPArticipants.Clear();
     DPEnd.SelectedDate   = null;
     DPStart.SelectedDate = null;
 }
Example #4
0
 private bool CheckValue()
 {
     if (string.IsNullOrEmpty(TxtName.Text))
     {
         ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('会议名称不能为空!');", true);
         TxtName.Focus();
         return(false);
     }
     if (string.IsNullOrEmpty(TxtTheme.Text))
     {
         ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('主题不能为空!');", true);
         TxtTheme.Focus();
         return(false);
     }
     if (string.IsNullOrEmpty(TxtStartTime.Text))
     {
         ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('开始时间不能为空!');", true);
         TxtStartTime.Focus();
         return(false);
     }
     if (string.IsNullOrEmpty(TxtEndTime.Text))
     {
         ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('结束时间不能为空!');", true);
         TxtEndTime.Focus();
         return(false);
     }
     if (string.IsNullOrEmpty(TxtCity.Text))
     {
         ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('所在城市不能为空!');", true);
         TxtCity.Focus();
         return(false);
     }
     if (string.IsNullOrEmpty(TxtStreet.Text))
     {
         ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('街道不能为空!');", true);
         TxtStreet.Focus();
         return(false);
     }
     if (string.IsNullOrEmpty(TxtNumber.Text))
     {
         ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('门牌号不能为空!');", true);
         TxtNumber.Focus();
         return(false);
     }
     if (string.IsNullOrEmpty(TxtDept.Text))
     {
         ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('所属部门不能为空!');", true);
         TxtDept.Focus();
         return(false);
     }
     return(true);
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.IsPostBack == false)
     {
         TxtCity.Focus();
         this.Form.DefaultButton = BtnAdd.UniqueID;
         DataTable ObjCountryTable = MyJobPortalModel.Country.GetCountryRecords("status='Active'");
         DdlCountry.DataSource = ObjCountryTable;
         DdlCountry.DataBind();
         DdlCountry.Items.Insert(0, new ListItem("--Select--", "--Select--"));
         DdlState.Items.Add(new ListItem("--Select--", "--Select--"));
     }
 }
        public AddressDetailsPage.AddressDetailsPage AddAddress(AddAddressBO addAddressBo)
        {
            TxtFirstName.SendKeys(addAddressBo.FirstName);
            TxtLastName.SendKeys(addAddressBo.LastName);
            TxtAddress1.SendKeys(addAddressBo.Address1);
            TxtCity.SendKeys(addAddressBo.City);
            var selectState = new SelectElement(DdlState);

            selectState.SelectByText(addAddressBo.State);
            TxtZipCode.SendKeys(addAddressBo.ZipCode);
            LstCountry[addAddressBo.Country].Click();

            var js = (IJavaScriptExecutor)driver;

            js.ExecuteScript("arguments[0].setAttribute('value', arguments[1])", BtnColor, addAddressBo.Color);

            BtnCreateAddress.Click();
            return(new AddressDetailsPage.AddressDetailsPage(driver));
        }
Example #7
0
 /// <summary>
 /// actually clears each textbox in the form
 /// </summary>
 private void ClearNewEmpForm()
 {
     EpForm.Clear();
     TxtID.Clear();
     TxtFirstName.Clear();
     TxtLastName.Clear();
     TxtAddress.Clear();
     TxtCity.Clear();
     CBxState.SelectedIndex = -1;
     CBxEmpType.SelectedIndex = -1;
     TxtZip.Clear();
     TxtHireDate.Clear();
     CBxMarriageStatus.SelectedIndex = -1;
     TxtDept.Clear();
     TxtJobTitle.Clear();
     LblAfterSubmitMsg.Text = "";
     TxtPayAmount.Visible = false;
     LblPayAmount.Visible = false;
     LblSecondInput.Visible = false;
     TxtSecondInput.Visible = false;
 }
Example #8
0
 protected void BtnReg_Click(object sender, EventArgs e)
 {
     if (TxtCity.SelectedValue == "-1")
     {
         TxtCity.Focus();
         showErrorMwssage(4);
     }
     else if (DdlLicensCode.SelectedValue == "-1")
     {
         DdlLicensCode.Focus();
         showErrorMwssage(5);
     }
     else
     {
         if (GlobFuncs.IsExist(TxtEmail.Text.ToString()) == true)
         {
             TxtEmail.Focus();
             showErrorMwssage(6);
         }
         else if (checkbox1.Checked != true)
         {
             showErrorMwssage(7);
         }
         else if (TxtName.Text.Length == 0)
         {
             TxtName.Focus();
             showErrorMwssage(8);
         }
         else if (TxtAddress.Text.Length == 0)
         {
             TxtAddress.Focus();
             showErrorMwssage(9);
         }
         else if (TxtId.Text.Length == 0)
         {
             TxtId.Focus();
             showErrorMwssage(10);
         }
         else if (TxtDateOfBirth.Text.Length == 0)
         {
             TxtDateOfBirth.Focus();
             showErrorMwssage(11);
         }
         else if (TxtLicenseNumber.Text.Length == 0)
         {
             TxtLicenseNumber.Focus();
             showErrorMwssage(12);
         }
         else if (TxtDateOfIssuanceLicense.Text.Length == 0)
         {
             TxtDateOfIssuanceLicense.Focus();
             showErrorMwssage(13);
         }
         else if (TxtEmail.Text.Length == 0)
         {
             TxtEmail.Focus();
             showErrorMwssage(14);
         }
         else if (TxtPass.Text.Length == 0)
         {
             TxtPass.Focus();
             showErrorMwssage(15);
         }
         else if (TxtPhone.Text.Length == 0)
         {
             TxtPhone.Focus();
             showErrorMwssage(16);
         }
         else
         {
             string pass = GlobFuncs.Hash(TxtPass.Text.ToString());
             Users  Us   = new Users(-1, TxtName.Text.ToString(), TxtAddress.Text.ToString(), int.Parse(TxtCity.Text.ToString()), TxtId.Text.ToString(), DateTime.Parse(TxtDateOfBirth.Text), TxtLicenseNumber.Text.ToString(), int.Parse(DdlLicensCode.Text.ToString()), DateTime.Parse(TxtDateOfIssuanceLicense.Text), TxtEmail.Text.ToString(), pass, TxtPhone.Text.ToString());
             person per  = new person();
             per = Us.RegUser();
             sendRegMessage(per.CustomId, 0.ToString(), per.FullName);
             Session["Person"] = per;
             Response.Redirect("PrivateArea.aspx");
         }
     }
 }
        /// <summary>
        /// Filters Users based on the given citirions
        /// </summary>
        /// <param name="item"></param>
        /// <returns>if the given object is valid by filtering</returns>
        public bool FilterUsers(object item)
        {
            User user           = item as User;
            int  numOfevaluated = PropertiesToCheck();
            int  numOfValid     = 0;

            if (user != null)
            {
                if (ChbFirstName)
                {
                    if (user.FirstName.ToLower().Contains(TxtFirstName.ToLower()))
                    {
                        numOfValid++;
                    }
                }
                if (ChbLastName)
                {
                    if (user.LastName.ToLower().Contains(TxtLastName.ToLower()))
                    {
                        numOfValid++;
                    }
                }
                if (ChbEmail)
                {
                    if (user.Email.ToLower().Contains(TxtEmail.ToLower()))
                    {
                        numOfValid++;
                    }
                }
                if (CurrentGender.ToString() == user.Gender)
                {
                    numOfValid++;
                }
                if (ChbCountry)
                {
                    if (user.Country.ToLower().Contains(TxtCountry.ToLower()))
                    {
                        numOfValid++;
                    }
                }
                if (ChbCity)
                {
                    if (user.City.ToLower().Contains(TxtCity.ToLower()))
                    {
                        numOfValid++;
                    }
                }
                if (ChbStreet)
                {
                    if (user.Street.ToLower().Contains(TxtStreet.ToLower()))
                    {
                        numOfValid++;
                    }
                }
                if (ChbPhoneNumber)
                {
                    if (user.PhoneNumber.ToLower().Contains(TxtPhoneNumber.ToLower()))
                    {
                        numOfValid++;
                    }
                }

                return(numOfevaluated == numOfValid);
            }

            return(false);
        }