Exemplo n.º 1
0
        private void employeeButton_Click(object sender, EventArgs e)
        {
            EmployeeForm f = new EmployeeForm();

            f.Show();
            this.Hide();
        }
Exemplo n.º 2
0
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            string nama   = textBoxSearch.Text;
            var    contex = new db_daycareContextEntities();
            var    emp    = (from a in contex.Employees where a.employee_name == nama select a).Single();

            contex.Employees.Remove(emp);
            contex.SaveChanges();

            MessageBox.Show("Data telah berhasil dihapus.");

            EmployeeForm f = new EmployeeForm();

            f.Show();
            this.Hide();
        }
Exemplo n.º 3
0
        private void addEmployeeButton_Click(object sender, EventArgs e)
        {
            var contex = new db_daycareContextEntities();
            var emp    = new Employees();

            emp.employee_name    = nameTextBox.Text;
            emp.employee_address = addressTextBox.Text;
            emp.employee_phone   = phoneTextBox.Text;
            contex.Employees.Add(emp);
            contex.SaveChanges();

            MessageBox.Show("Tambah data pegawai berhasil!!");

            EmployeeForm f = new EmployeeForm();

            f.Show();
            this.Hide();
        }
Exemplo n.º 4
0
        private void buttonUpdate_Click(object sender, EventArgs e)
        {
            var context = new db_daycareContextEntities();
            var emp     = (from a in context.Employees
                           where a.employee_name == textBoxSearch.Text
                           select a).Single();

            emp.employee_name    = nameTextBox.Text;
            emp.employee_address = addressTextBox.Text;
            emp.employee_phone   = phoneTextBox.Text;

            context.SaveChanges();
            MessageBox.Show("Data telah berhasil diupdate.");

            EmployeeForm f = new EmployeeForm();

            f.Show();
            this.Hide();
        }