Ejemplo n.º 1
0
 private void btnSavee_Click(object sender, EventArgs e)
 {
     Ref_PersonViewModel.Save(txtTitle.Text, txtPhoneNumber.Text, txtMobile.Text);
     dgvPerson.DataSource = Ref_PersonViewModel.FillGrid();
     MessageBox.Show("Successfully Saved");
     txtTitle.Text       = "";
     txtPhoneNumber.Text = "";
     txtMobile.Text      = "";
 }
Ejemplo n.º 2
0
 private void BtnSignin_Click(object sender, EventArgs e)
 {
     if (Ref_PersonViewModel.SignIn(txtUserName.Text, txtPassword.Text))
     {
         MessageBox.Show("Welcome");
         this.Close();
     }
     else
     {
         MessageBox.Show("you must register");
     }
 }
Ejemplo n.º 3
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            int          id  = Convert.ToInt32(dgvPerson[0, dgvPerson.CurrentRow.Index].Value);
            DialogResult res = MessageBox.Show("Are you sure you want to delete ?", "Confirmation", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);

            if (res == DialogResult.OK)
            {
                Ref_PersonViewModel.Delete(id);
                MessageBox.Show("deleted");
                dgvPerson.DataSource = Ref_PersonViewModel.FillGrid();
            }
        }
Ejemplo n.º 4
0
 private void BtnSubmit_Click(object sender, EventArgs e)
 {
     if (Ref_Validation.TextValidation(txtName.Text) == true && Ref_Validation.TextValidation(txtSurname.Text) == true &&
         Ref_Validation.TellValidation(txtTell.Text) == true && Ref_Validation.MobileValidation(txtMobile.Text) &&
         Ref_Validation.AddressValidation(txtAddress.Text) == true && txtUserReg.Text != string.Empty && txtPassReg.Text != string.Empty)
     {
         Ref_PersonViewModel.Save(txtName.Text, txtSurname.Text, txtTell.Text, txtMobile.Text, txtAddress.Text, txtUserReg.Text, txtPassReg.Text);
         MessageBox.Show("succeeded");
         this.Close();
     }
     else
     {
         MessageBox.Show("unsucceeded !  please check fields");
     }
 }
Ejemplo n.º 5
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     Ref_PersonViewModel.Delete(Id, txtFName.Text, txtLName.Text, txtMobileNumber.Text, txtTelNumber1.Text, txtTelNumber2.Text, txtAddress.Text);
     Clear();
 }
Ejemplo n.º 6
0
 private void BtnEdit_Click(object sender, EventArgs e)
 {
     Ref_PersonViewModel.Edit(Id, txtFName.Text, txtLName.Text, txtMobileNumber.Text, txtTelNumber1.Text, txtTelNumber2.Text, txtAddress.Text);
 }
Ejemplo n.º 7
0
 private void FillGrid()
 {
     dgvPerson.DataSource = Ref_PersonViewModel.FillGrid();
     Clear();
 }
Ejemplo n.º 8
0
 private void BtnNew_Click(object sender, EventArgs e)
 {
     Clear();
     Ref_PersonViewModel.Save(txtFName.Text, txtLName.Text, txtMobileNumber.Text, txtTelNumber2.Text, txtTelNumber1.Text, txtAddress.Text);
 }
Ejemplo n.º 9
0
 private void BtnDelete_Click_1(object sender, EventArgs e)
 {
     Ref_PersonViewModel.Delete(Id);
     FillGrid();
     Clear();
 }
Ejemplo n.º 10
0
 private void BtnSave_Click(object sender, EventArgs e)
 {
     Ref_PersonViewModel.Save(txtFName.Text, txtLName.Text, txtTelNumber.Text, txtMobileNumber.Text, txtAddress.Text, txtEmail.Text);
     FillGrid();
     Clear();
 }
Ejemplo n.º 11
0
 private void btnRefresh_Click(object sender, EventArgs e)
 {
     dgvPerson.DataSource = Ref_PersonViewModel.FillGrid();
 }