Example #1
0
 public void ShowData(clsHuman chuman)
 {
     txtName.Text   = chuman.Name;
     txtMember.Text = chuman.Member.ToString();
     txtMajor.Text  = chuman.Major;
     txtHome.Text   = chuman.Home;
     txtAge.Text    = chuman.Age.ToString();
     txtDob.Text    = chuman.Year.ToString();
 }
Example #2
0
 void BtnDeleteClick(object sender, EventArgs e)
 {
     try
     {
         clsHuman current = (clsHuman)source[dgshow.CurrentRowIndex];
         source.RemoveAt(dgshow.CurrentRowIndex);
     }catch
     {
     }
 }
Example #3
0
 void BtnEditClick(object sender, EventArgs e)
 {
     human.Home   = txtHome.Text;
     human.Member = int.Parse(txtMember.Text);
     human.Age    = int.Parse(txtAge.Text);
     human.Name   = txtName.Text;
     human.Year   = int.Parse(txtDob.Text);
     human.Major  = txtMajor.Text;
     source[dgshow.CurrentRowIndex] = human;
     human = new clsHuman();
     ClearData();
     dgshow.Refresh();
 }
Example #4
0
        void Button1Click(object sender, System.EventArgs e)
        {
            if (bhulist.Count != 0)
            {
                for (int i = 0; i < bhulist.Count; i++)
                {
                    if (txtHome.Text == bhulist[i].Home.ToString())
                    {
                        ClearData();
                        MessageBox.Show("This Address has existed!// Please check!");
                    }
                }
            }
            int count = 0;
            int n     = int.Parse(txtNow.Text);

            if (txtAge.Text == "" || txtDob.Text == "" || txtName.Text == "" || txtMajor.Text == "" || IsAdrress(txtHome.Text) == false)
            {
                ClearData();
            }
            else
            {
                txtNow.Text  = txtMember.Text;
                human.Home   = txtHome.Text;
                human.Member = int.Parse(txtMember.Text);
                human.Age    = int.Parse(txtAge.Text);
                human.Name   = txtName.Text;
                human.Year   = int.Parse(txtDob.Text);
                human.Major  = txtMajor.Text;
                source.Add(human);
                count++;
                human = new clsHuman();
                ClearData();
                dgshow.Refresh();
                if (count != n)
                {
                    txtMember.Visible     = false;
                    txtHome.Visible       = false;
                    gbInformation.Visible = true;
                }
                else
                {
                    txtMember.Visible = true;
                    txtHome.Visible   = true;
                }
            }
        }