Ejemplo n.º 1
0
 private void NhanSuBtn_Click(object sender, EventArgs e)
 {
     if (Application.OpenForms.OfType <NhanVienForm>().Count() == 1)
     {
         Application.OpenForms.OfType <NhanVienForm>().First().Focus();
     }
     else
     {
         var form = new NhanVienForm();
         form.Show();
     }
 }
Ejemplo n.º 2
0
        public SuaNhanVien(NhanVienForm form, int id)
            : this()
        {
            try
            {
                parentForm = form;
                NvId       = id;

                var db = new CkpEntities();
                var nv = (from n in db.NhanVien where n.Id == id select n).FirstOrDefault();
                IdTBox.Text  = nv.Id.ToString();
                HtTBox.Text  = nv.HoTen;
                CvTBox.Text  = nv.ChucVu;
                SdtTBox.Text = nv.SoDienThoai;
                DcTBox.Text  = nv.DiaChi;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.GetBaseException().Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 3
0
 public ThemNhanVien(NhanVienForm form)
     : this()
 {
     parentForm = form;
 }