//Производим очищение  первоначальных данных при нажатии 2 раза ЛКМ
 private void NameAdd_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     NameAdd.Clear();
 }
Example #2
0
        public CitizenDependents(string t, int CID)
        {
            type = t;
            ID   = CID;
            InitializeComponent();
            DataTable dt = controllerObj.SelectDependentsByCitizen(ID);

            dataGridView1.DataSource = dt;
            NameRemove.DataSource    = dt;
            NameRemove.ValueMember   = "Name";
            NameRemove.DisplayMember = "Name";
            NameSalary.DataSource    = dt;
            NameSalary.ValueMember   = "Name";
            NameSalary.DisplayMember = "Name";
            NameName.DataSource      = dt;
            NameName.ValueMember     = "Name";
            NameName.DisplayMember   = "Name";
            NameBirth.DataSource     = dt;
            NameBirth.ValueMember    = "Name";
            NameBirth.DisplayMember  = "Name";

            if (type != "Admin")
            {
                Confirm2.Hide();
                Confirm3.Hide();
                label12.Hide();
                label13.Hide();
                label14.Hide();
                label15.Hide();
                label16.Hide();
                label17.Hide();
                NameName.Hide();
                NameNew.Hide();
                NameBirth.Hide();
                BirthdateNew.Hide();
            }

            if (type == "Employee")
            {
                label2.Hide();
                label3.Hide();
                label4.Hide();
                label5.Hide();
                label6.Hide();
                label7.Hide();
                label8.Hide();
                label9.Hide();
                label10.Hide();
                label11.Hide();
                Confirm.Hide();
                Remove.Hide();
                Add.Hide();
                NameAdd.Hide();
                NameRemove.Hide();
                NameSalary.Hide();
                Salary.Hide();
                SalaryNew.Hide();
                Birthdate.Hide();
                Relationship.Hide();
            }

            DataTable C = controllerObj.SelectCitizenByID(ID);

            CitizenID.Text = Convert.ToString(C.Rows[0]["First Name"]) + Convert.ToString(C.Rows[0]["Last Name"]);
        }