Esempio n. 1
0
 private void LoadAgeGroupList()
 {
     try {
         Int16 curValue = Convert.ToInt16(editSkiYearAge.Text);
         editSkiYearAge.Text = curValue.ToString();
         if (curValue > 1 && curValue < 100)
         {
             if (editGenderSelect.RatingValue.Length > 0)
             {
                 AgeGroupSelect.SelectList_Load(curValue, editGenderSelect.RatingValue, myTourRow, AgeGroupSelect_Change);
             }
             else
             {
                 AgeGroupSelect.SelectList_Load(AgeGroupSelect_Change);
             }
         }
         else
         {
             AgeGroupSelect.SelectList_Load(editGenderSelect.RatingValue, myTourRow, AgeGroupSelect_Change);
             editSkiYearAge.Text = "";
         }
         AgeGroupSelect.CurrentValue = "";
     } catch {
     }
 }
Esempio n. 2
0
        private void editMemberDataLoad(String inMemberId, String inAgeGroup)
        {
            DataRow curDataRow = getMemberTourReg(inMemberId, inAgeGroup);

            if (curDataRow == null)
            {
                MessageBox.Show("Tournament registration entry not found for member " + inMemberId + " in division " + inAgeGroup);
                return;
            }

            editMemberId.Text = (String)curDataRow["MemberId"];
            try {
                String curFirstName = "", curLastName = "", curSkierName = "";
                if (curDataRow["SkierName"] != System.DBNull.Value)
                {
                    curSkierName = (String)curDataRow["SkierName"];
                }
                if (curDataRow["FirstName"] != System.DBNull.Value)
                {
                    curFirstName = (String)curDataRow["FirstName"];
                }
                if (curDataRow["FirstName"] != System.DBNull.Value)
                {
                    curLastName = (String)curDataRow["LastName"];
                }
                if (curSkierName.Length == 0)
                {
                    curSkierName = curLastName + ", " + curFirstName;
                }
                if (curFirstName.Length > 0 && curLastName.Length > 0)
                {
                    editFirstName.Text = curFirstName;
                    editLastName.Text  = curLastName;
                }
                else
                {
                    String[] curNameList = curSkierName.Split(',');
                    if (curNameList.Length > 1)
                    {
                        editFirstName.Text = curNameList[1].Trim();
                        editLastName.Text  = curNameList[0].Trim();
                    }
                    else
                    {
                        editFirstName.Text = "";
                        editLastName.Text  = curNameList[0].Trim();
                    }
                }
            } catch {
                editFirstName.Text = "";
                editLastName.Text  = "";
            }
            try {
                editGenderSelect.RatingValue = (String)curDataRow["Gender"];
            } catch {
                editGenderSelect.RatingValue = "";
            }
            try {
                Byte curValue = (byte)curDataRow["SkiYearAge"];
                editSkiYearAge.Text = curValue.ToString();
                if (curValue > 1 && curValue < 100)
                {
                    if (editGenderSelect.RatingValue.Length > 0)
                    {
                        AgeGroupSelect.SelectList_Load(curValue, editGenderSelect.RatingValue, myTourRow, AgeGroupSelect_Change);
                    }
                    else
                    {
                        AgeGroupSelect.SelectList_Load(AgeGroupSelect_Change);
                    }
                }
                else
                {
                    if (editGenderSelect.RatingValue.Length > 0)
                    {
                        AgeGroupSelect.SelectList_Load(editGenderSelect.RatingValue, myTourRow, AgeGroupSelect_Change);
                    }
                    else
                    {
                        AgeGroupSelect.SelectList_Load(AgeGroupSelect_Change);
                    }
                    editSkiYearAge.Text = "";
                }
                AgeGroupSelect.CurrentValue = (String)curDataRow["AgeGroup"];
            } catch {
                if (editGenderSelect.RatingValue.Length > 0)
                {
                    AgeGroupSelect.SelectList_Load(editGenderSelect.RatingValue, myTourRow, AgeGroupSelect_Change);
                }
                else
                {
                    AgeGroupSelect.SelectList_Load(AgeGroupSelect_Change);
                }
                AgeGroupSelect.CurrentValue = (String)curDataRow["AgeGroup"];
                editSkiYearAge.Text         = "";
            }

            try {
                editCity.Text = (String)curDataRow["City"];
            } catch {
                editCity.Text = "";
            }
            try {
                editState.Text = (String)curDataRow["State"];
            } catch {
                editState.Text = "";
            }
            try {
                editFederation.SelectedValue = (String)curDataRow["Federation"];
            } catch {
                editFederation.SelectedValue = "";
            }
            if (((String)curDataRow["MemberStatus"]).Length > 0)
            {
                editMemberStatus.Text = (String)curDataRow["MemberStatus"];
            }
            else
            {
                try {
                    if (((String)curDataRow["ReadyToSki"]).Equals("Y"))
                    {
                        editMemberStatus.Text = "Active";
                    }
                    else
                    {
                        editMemberStatus.Text = "Inactive";
                    }
                } catch {
                    editMemberStatus.Text = "Inactive";
                }
            }

            showMemberRegList();
        }
Esempio n. 3
0
        private void editMemberDataLoad(String inMemberId)
        {
            myMemberRow = getMemberData(myMemberId);
            if (myMemberRow == null)
            {
                MessageBox.Show("Member data not found for MemberId " + myMemberId);
                return;
            }
            editMemberId.Text = (String)myMemberRow["MemberId"];
            try {
                editFirstName.Text = (String)myMemberRow["FirstName"];
                editLastName.Text  = (String)myMemberRow["LastName"];
            } catch {
                String   curSkierName = (String)myMemberRow["SkierName"];
                String[] curNameList  = curSkierName.Split(',');
                if (curNameList.Length > 1)
                {
                    editLastName.Text  = curNameList[0].Trim();
                    editFirstName.Text = curNameList[1].Trim();
                }
                else
                {
                    editLastName.Text  = curNameList[0].Trim();
                    editFirstName.Text = "";
                }
            }
            try {
                editGenderSelect.RatingValue = (String)myMemberRow["Gender"];
            } catch {
                editGenderSelect.RatingValue = "";
            }
            try {
                editSkiYearAge.Text = ((Byte)myMemberRow["SkiYearAge"]).ToString();
            } catch {
                if (editGenderSelect.RatingValue.Length > 0)
                {
                    AgeGroupSelect.SelectList_Load(editGenderSelect.RatingValue, myTourRow, AgeGroupSelect_Change);
                }
                else
                {
                    AgeGroupSelect.SelectList_Load(AgeGroupSelect_Change);
                }
                AgeGroupSelect.CurrentValue = "";
                editSkiYearAge.Text         = "0";
            }
            LoadAgeGroupList();

            try {
                editMemberStatus.Text = (String)myMemberRow["MemberStatus"];
            } catch {
                editMemberStatus.Text = "";
            }
            try {
                editCity.Text = (String)myMemberRow["City"];
            } catch {
                editCity.Text = "";
            }
            try {
                editState.Text = (String)myMemberRow["State"];
            } catch {
                editState.Text = "";
            }
            try {
                editFederation.SelectedValue = (String)myMemberRow["Federation"];
            } catch {
                editFederation.SelectedValue = "";
            }

            showMemberRegList();
        }