コード例 #1
0
        private void btnDKTK_Click(object sender, EventArgs e)
        {
            FQlyTaiKhoan Form4 = new FQlyTaiKhoan();

            Form4.Them = false;
            Form4.ShowDialog();
        }
コード例 #2
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     if (this.Service != "TopManager")
     {
         MessageBox.Show("Bạn không đủ quyền để cấp chức này. Vui lòng chọn chức vụ khác!");
     }
     else
     {
         if (Them)
         {
             try
             {
                 int ID_Employee = -1;
                 ID_Employee = SEmploy.InsertEmployee(this.tbName.Text.Trim(), this.tbID_code.Text.Trim(), this.dateTimePicker1.Value, this.cbGioiTinh.Text.Trim(), this.cbChucVu.Text.Trim(), Convert.ToInt32(this.tbLuong.Text), this.dateTimePicker2.Value, Convert.ToInt32(this.tbPhoneNumber.Text.Trim()), this.tbAddress.Text.Trim(), ref err);
                 load();
                 FQlyTaiKhoan Form4 = new FQlyTaiKhoan(ID_Employee);
                 Form4.Them = true;
                 MessageBox.Show("Đã thêm xong, vui lòng đăng kí tài khoản!");
                 Form4.ShowDialog();
             }
             catch (SqlException)
             {
                 MessageBox.Show("Không thêm được. Lỗi rồi!");
             }
         }
         else
         {
             string active = "No";
             if (this.cbStatus.Text == "Đang làm việc")
             {
                 active = "Yes";
             }
             SEmploy.UpdateEmployee(Convert.ToInt32(this.tbID.Text), this.tbName.Text.Trim(), this.tbID_code.Text.Trim(), this.dateTimePicker1.Value, this.cbGioiTinh.Text.Trim(), this.cbChucVu.Text.Trim(), Convert.ToInt32(this.tbLuong.Text), this.dateTimePicker2.Value, active, Convert.ToInt32(this.tbPhoneNumber.Text.Trim()), this.tbAddress.Text.Trim(), ref err);
             load();
             MessageBox.Show("Đã sửa xong!");
         }
     }
 }