Пример #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            int dongchon           = dataGridView1.CurrentCell.RowIndex;
            NhanvienDataContext db = new NhanvienDataContext();
            NHANVIEN            q  = db.NHANVIENs.Single(p => Convert.ToString(p.MANV) == dataGridView1.Rows[dongchon].Cells["MANV"].Value.ToString());

            db.NHANVIENs.DeleteOnSubmit(q);
            db.SubmitChanges();
            load();
        }
Пример #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            int dongchon           = dataGridView1.CurrentCell.RowIndex;
            NhanvienDataContext db = new NhanvienDataContext();
            NHANVIEN            q  = db.NHANVIENs.Single(p => p.MANV == Convert.ToInt32(textBox1.Text));

            q.MANV      = Convert.ToInt32(textBox1.Text);
            q.HOTEN     = textBox2.Text;
            q.NGAYSINH  = textBox3.Text;
            q.DIACHI    = textBox4.Text;
            q.DIENTHOAI = textBox5.Text;
            q.HSLUONG   = Convert.ToDouble(textBox6.Text);
            q.MADONVI   = Convert.ToInt32(comboBox1.Text);
            db.SubmitChanges();
            load();
        }
Пример #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            NhanvienDataContext db = new NhanvienDataContext();
            NHANVIEN            dv = new NHANVIEN();

            dv.MANV      = Convert.ToInt32(textBox1.Text);
            dv.HOTEN     = textBox2.Text;
            dv.NGAYSINH  = textBox3.Text;
            dv.DIACHI    = textBox4.Text;
            dv.DIENTHOAI = textBox5.Text;
            dv.HSLUONG   = Convert.ToDouble(textBox6.Text);
            dv.MADONVI   = Convert.ToInt32(comboBox1.Text);
            db.NHANVIENs.InsertOnSubmit(dv);
            db.SubmitChanges();
            load();
        }