public ThongTinGiaDinh(INhanVienServices nhanVienServices, IThongTinGiaDinhServices thongTinGiaDinhServices, ThongTinNhanVIen empDetails) { this.nhanVienServices = nhanVienServices; this.thongTinGiaDinhServices = thongTinGiaDinhServices; this.empDetails = empDetails; InitializeComponent(); }
private void UpdateContract(ThongTinNhanVIen empInfo) { try { var hopDong = empInfo.HopDongLaoDongs.Where(hd => hd.idHopDongLaoDong == idUpdateHopDong).FirstOrDefault(); hopDong.idLoaiHopDong = (cbLoaiHopDong.SelectedItem as LoaiHopDong).idLoaiHopDong; hopDong.chucDanh = txtChucDanh.Text.Trim(); hopDong.ngayBatDau = datetimeNgayBatDau.Value; hopDong.ngayKetThuc = dateTimeNgayKetThuc.Value; hopDong.nguoiBaoLanh_TTHDLD = txtNguoiBaoLanh.Text.Trim(); hopDong.soHopDong_TTHDLD = txtSoHopDong.Text.Trim(); hopDong.ghiChu = txtGhiChu.Text.Trim(); empInfo.HopDongLaoDongs.Where(hd => hd.idHopDongLaoDong == idUpdateHopDong).ToList().ForEach(hd => hd = hopDong); hopDongServices.CommitHopDongLaoDong(); MessageBox.Show("Đã Chỉnh Sửa Hợp Đồng Thành Công!", "Thông Báo", MessageBoxButtons.OK); } catch (Exception ex) { if (UserProfile.permission == 1) { MessageBox.Show(ex.ToString(), "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show("Đã Có Lỗi! Vui Lòng Kiểm Tra Thông Tin Đầu Vào!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void InsertContract(ThongTinNhanVIen empInfo) { try { var hopDong = new HopDongLaoDong { idLoaiHopDong = (cbLoaiHopDong.SelectedItem as LoaiHopDong).idLoaiHopDong, chucDanh = txtChucDanh.Text.Trim(), ngayBatDau = datetimeNgayBatDau.Value, ngayKetThuc = dateTimeNgayKetThuc.Value, nguoiBaoLanh_TTHDLD = txtNguoiBaoLanh.Text.Trim(), soHopDong_TTHDLD = txtSoHopDong.Text.Trim(), ghiChu = txtGhiChu.Text.Trim() }; empInfo.HopDongLaoDongs.Add(hopDong); hopDongServices.CommitHopDongLaoDong(); MessageBox.Show("Đã Thêm Hợp Đồng Thành Công!", "Thông Báo", MessageBoxButtons.OK); } catch (Exception ex) { if (UserProfile.permission == 1) { MessageBox.Show(ex.ToString(), "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show("Đã Có Lỗi! Vui Lòng Kiểm Tra Thông Tin Đầu Vào!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
public ChinhSuaThongTinTrinhDo(IThongTinTrinhDoServices thongTinTrinhDoServices, ITrinhDoServices trinhDoServices, ThongTinNhanVIen empDetails) { this.thongTinTrinhDoServices = thongTinTrinhDoServices; this.trinhDoServices = trinhDoServices; this.empDetails = empDetails; InitializeComponent(); }
public QuanLyHopDong(INhanVienServices nhanVienServices, IHopDongServices hopDongServices, ILoaiHopDongServices loaiHopDongServices, ThongTinNhanVIen empDetails) { this.nhanVienServices = nhanVienServices; this.hopDongServices = hopDongServices; this.loaiHopDongServices = loaiHopDongServices; this.empDetails = empDetails; InitializeComponent(); }
private void InitEmpDetails(ThongTinNhanVIen emp) { lblTenNV.Text = empDetails.hoTen; lblMaNV.Text = empDetails.MaNV; lblHonNhan.Text = empDetails.tinhTrangHonNhan; if (empDetails.gioiTinh == 0) { lblGioiTinh.Text = "Nữ"; } else { lblGioiTinh.Text = "Nam"; } lblNgaySinh.Text = emp.namSinh.ToString("dd/MM/yyyy"); lblSDTBan.Text = emp.soDienThoaiNha; lblSDTDD.Text = emp.soDienThoaiDiDong; lblCMND.Text = emp.CMND; lblNoiCapCMND.Text = emp.noiCapCMND; lblNgayCapCMND.Text = (Convert.ToDateTime(emp.ngayCapCMND)).ToString("dd/MM/yyyy"); lblNguyenQuan.Text = emp.nguyenQuan; lblHoKhau.Text = emp.hoKhau; lblNoiOHienNay.Text = emp.noiOHienNay; lblThanhPho.Text = emp.ThanhPho.tenTP; if (emp.permission == 1) { lblPermission.Text = "Admin"; } else { lblPermission.Text = "User"; } lblUser.Text = emp.userName; lblCongViecDangLam.Text = emp.CongViecDangLam; lblBienChe.Text = emp.BienChe.bienChe1; lblCapBac.Text = emp.CapBac.capBac1; lblChucVu.Text = emp.ChucVu.ChucVu1; lblNguoiBaoLanh.Text = emp.nguoiBaoLanh; lblNamVaoCang.Text = Convert.ToDateTime(emp.ngayVaoCang).ToString("yyyy"); lblNamVaoST.Text = Convert.ToDateTime(emp.namVaoSongThan).ToString("yyyy"); lblNamNhapNgu.Text = Convert.ToDateTime(emp.ngayNhapNgu).ToString("yyyy"); lblNoiCongTac.Text = emp.noiCongTac; lblMQHNguoiBaoLanh.Text = emp.moiQuanHeBaoLanh; lblPhongBan.Text = emp.PhongDoiToLoaiTo.tenPhongDoiToLoai; }
public ChinhSuaThongTinNhanVien(IHopDongServices hopDongServices, ILoaiHopDongServices loaiHopDongServices, INhanVienServices nhanVienServices, IPhongBanServices phongBanServices, IThanhPhoServices thanhPhoServices, IChucVuServices chucVuServices, ICapBacServices capBacServices, IBienCheServices bienCheServices, IThongTinTrinhDoServices thongTinTrinhDoServices, ITrinhDoServices trinhDoServices , IThongTinGiaDinhServices giaDinhServices, ThongTinNhanVIen empDetails) { this.hopDongServices = hopDongServices; this.loaiHopDongServices = loaiHopDongServices; this.nhanVienServices = nhanVienServices; this.phongBanServices = phongBanServices; this.thanhPhoServices = thanhPhoServices; this.chucVuServices = chucVuServices; this.capBacServices = capBacServices; this.bienCheServices = bienCheServices; this.thongTinTrinhDoServices = thongTinTrinhDoServices; this.giaDinhServices = giaDinhServices; this.trinhDoServices = trinhDoServices; this.empDetails = empDetails; InitializeComponent(); }
public ThongTinCaNhan(ILoaiHopDongServices loaiHopDongServices, ThongTinNhanVIen empDetails) { this.loaiHopDongServices = loaiHopDongServices; this.empDetails = empDetails; InitializeComponent(); }
private void btnThem_Click_1(object sender, EventArgs e) { try { int sex = 0; if (rbtnNam.Checked == true) { sex = 0; } if (rBtnNu.Checked == true) { sex = 1; } string nguoiBaoLanh = txtNguoiBaoLanh.Text.Trim(); if (String.IsNullOrEmpty(nguoiBaoLanh)) { nguoiBaoLanh = "Chưa Cập Nhật"; } string moiQuanHe = txtMoiQuanHeNBL.Text.Trim(); if (String.IsNullOrEmpty(moiQuanHe)) { moiQuanHe = "Chưa Cập Nhật"; } string hoKhau = txtHoKhau.Text.Trim(); if (String.IsNullOrEmpty(hoKhau)) { hoKhau = "Chưa Cập Nhật"; } string soDT = txtSdt.Text.Trim(); if (String.IsNullOrEmpty(soDT)) { soDT = "Chưa Cập Nhật"; } string diaChi = txtdiachi.Text.Trim(); if (String.IsNullOrEmpty(diaChi)) { diaChi = "Chưa Cập Nhật"; } var emp = new ThongTinNhanVIen { MaNV = txtManv.Text.Trim(), idPhongDoiToLoai = Convert.ToInt32((cbPhongBan.SelectedItem as PhongDoiToLoaiTo).idPhongDoiToLoai), userName = txtUserName.Text.Trim(), password = "******", permission = Convert.ToInt32((cbPhanQuyen.SelectedItem as ComboBoxItem).Value), idBienChe = Convert.ToInt32((cbBienChe.SelectedItem as BienChe).idBienChe), idCapBac = Convert.ToInt32((cbCapBac.SelectedItem as CapBac).idCapBac), idChucVu = Convert.ToInt32((cbMaCV.SelectedItem as ChucVu).idChucVu), idTP = Convert.ToInt32((cbThanhPho.SelectedItem as ThanhPho).idThanhPho), CongViecDangLam = txtCongViecDangLam.Text.Trim(), hoTen = txtTennv.Text, gioiTinh = Convert.ToByte(sex), namSinh = datetimeNgaySinh.Value, nguyenQuan = (cbNguyenQuan.SelectedItem as ThanhPho).tenTP, noiOHienNay = diaChi, hoKhau = hoKhau, CMND = txtCMND.Text, ngayCapCMND = datetimeCMND.Value, noiCapCMND = (cbNoiCapCMND.SelectedItem as ThanhPho).tenTP, soDienThoaiNha = "", soDienThoaiDiDong = txtSdt.Text.Trim(), nguoiBaoLanh = nguoiBaoLanh, moiQuanHeBaoLanh = moiQuanHe, noiCongTac = txtNoiCongTac.Text.Trim(), ngayVaoCang = datetimeNgayVaoCang.Value, namVaoSongThan = datetimeNamVaoST.Value, ngayNhapNgu = datetimeNgayNhapNgu.Value, tinhTrangHonNhan = (cbTinhTrangHonNhan.SelectedItem as ComboBoxItem).Text, hinhAnhCaNhan = "" }; if (nhanVienServices.AddNhanVien(emp)) { MessageBox.Show("Bạn đã thêm nhân viên thành công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information); ClearAllText(this); InitEmployees(); dataGridNhanVien.Refresh(); } else { MessageBox.Show("Đã Có Lỗi! Vui Lòng Kiểm Tra Thông Tin Đầu Vào!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { if (UserProfile.permission == 1) { MessageBox.Show(ex.ToString(), "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show("Đã Có Lỗi! Vui Lòng Kiểm Tra Thông Tin Đầu Vào!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }