// ĐÀO TẠO - BỒI DƯỠNG. public bool Update_DaoTao_BoiDuong(DaoTao_BoiDuong daoTaoBD) { SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "SP_Update_DAOTAO_BOIDUONG"; cmd.Parameters.Add("@MADV", SqlDbType.NVarChar).Value = daoTaoBD.MaDV; cmd.Parameters.Add("@BATDAU", SqlDbType.Date).Value = daoTaoBD.BatDau; cmd.Parameters.Add("@KETTHUC", SqlDbType.Date).Value = daoTaoBD.KetThuc; cmd.Parameters.Add("@TENLOP", SqlDbType.NVarChar).Value = daoTaoBD.TenLop; cmd.Parameters.Add("@HINHTHUC", SqlDbType.NVarChar).Value = daoTaoBD.HinhThuc; cmd.Parameters.Add("@CHUNGCHI", SqlDbType.NVarChar).Value = daoTaoBD.ChungChi; cmd.Connection = _conn; try { _conn.Open(); cmd.ExecuteNonQuery(); return(true); } catch { return(false); } finally { _conn.Close(); } }
// Insert Đào tạo - Bồi dưỡng private DaoTao_BoiDuong Insert_DTBD() { string maDV = txt_DT_MaDV.Text; string tenLop = txt_DT_Tenlop.Text; string hinhThuc = txt_DT_Hinhthuc.Text; string chungChi = txt_DT_Chungchi.Text; DateTime dt_BD = ConvertStringToDate(txt_DT_BD.Text); DateTime dt_KT = ConvertStringToDate(txt_DT_KT.Text); if (maDV == "" || tenLop == "" || hinhThuc == "" || chungChi == "") { MessageBox.Show("Vui lòng nhập đầy đủ Thông tin!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); return(null); } else { _daoTaoBD = new DaoTao_BoiDuong(maDV, dt_BD, dt_KT, tenLop, hinhThuc, chungChi); return(_daoTaoBD); } }
// Update Đào tạo - Bồi dưỡng private void Update_DTBD(DaoTao_BoiDuong daoTaoBD) { txt_DT_MaDV.Text = daoTaoBD.MaDV; txt_DT_Tenlop.Text = daoTaoBD.TenLop; txt_DT_Hinhthuc.Text = daoTaoBD.HinhThuc; txt_DT_Chungchi.Text = daoTaoBD.ChungChi; txt_DT_BD.Text = daoTaoBD.BatDau.ToShortDateString(); txt_DT_BD.Text = daoTaoBD.KetThuc.ToShortDateString(); //if (maDV == "" || tenLop == "" || hinhThuc == "" || chungChi == "") //{ // MessageBox.Show("Vui lòng nhập đầy đủ Thông tin!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); // return null; //} //else //{ // _daoTaoBD = new DaoTao_BoiDuong(maDV, dt_BD, dt_KT, tenLop, hinhThuc, chungChi); // return _daoTaoBD; //} }
private void btnUpdate_Click(object sender, EventArgs e) { switch (_itemValue) { case 0: { _thongTin = new ThongTin(); _thongTin.MaDV = txtMaDV.Text; _thongTin.HoTen = txtHoten.Text; _thongTin.TenKhaiSinh = txtTenKS.Text; _thongTin.BiDanh = txtBidanh.Text; _thongTin.GioiTinh = txtGioitinh.Text; _thongTin.NgaySinh = convertStringToDate(txtNgaysinh.Text); _thongTin.QueQuan = txtQuequan.Text; _thongTin.DiaChi = rtxtDiachi.Text; _thongTin.SDT = txtSDT.Text; _thongTin.Email = txtEmail.Text; _thongTin.DanToc = txtDantoc.Text; _thongTin.TonGiao = txtTongiao.Text; _thongTin.LinkAnh = _linkAnh; _frmUpdate = new frmUpdate(_thongTin, 0); _frmUpdate.Show(); break; } case 1: { _themThongTin = new ThemThongTin(); _themThongTin.MaDV = txt_TTT_MaDV.Text; _themThongTin.NgayVaoDoan = convertStringToDate(txt_TTT_NgayVD.Text); _themThongTin.NoiVaoDoan = txt_TTT_MaDV.Text; _themThongTin.NgayVaoDangL1 = convertStringToDate(txt_TTT_NgayVDL1.Text); _themThongTin.NoiVaoDangL1 = txt_TTT_MaDV.Text; _themThongTin.NgayChinhThucL1 = convertStringToDate(txt_TTT_NgayCTL1.Text); _themThongTin.NoiCongNhanL1 = txt_TTT_MaDV.Text; _themThongTin.NguoiGioiThieuL1 = txt_TTT_MaDV.Text; _frmUpdate = new frmUpdate(_themThongTin, 1); _frmUpdate.Show(); break; } case 2: { _trinhDo = new TrinhDo(); _trinhDo.MaDV = txt_TD_MaDV.Text; _trinhDo.TrinhDoPT = txt_TD_PT.Text; _trinhDo.ChuyenMon = txt_TD_Chuyenmon.Text; _trinhDo.HocVi = txt_TD_Hocvi.Text; _trinhDo.DTHocVi = convertStringToDate(txt_TD_CTHV.Text); _trinhDo.HocHam = txt_TD_Hocham.Text; _trinhDo.DTHocham = convertStringToDate(txt_TD_CTHH.Text); _trinhDo.LyLuanCT = txt_TD_Lyluan.Text; _trinhDo.NgoaiNgu = rtxt_TD_NN.Text; _frmUpdate = new frmUpdate(_trinhDo, 2); _frmUpdate.Show(); break; } case 3: { _quaTrinhCT = new QuaTrinhCongTac(); _quaTrinhCT.MaDV = txt_QT_MaDV.Text; _quaTrinhCT.MaPB = txt_QT_MaPB.Text; _quaTrinhCT.PhongBan = txt_QT_TenPB.Text; _quaTrinhCT.BatDau = convertStringToDate(txt_QT_Batdau.Text); _quaTrinhCT.KetThuc = convertStringToDate(txt_QT_Ketthuc.Text); _quaTrinhCT.CongViec = txt_QT_Congviec.Text; _quaTrinhCT.DiaDiem = txt_QT_Diadiem.Text; _quaTrinhCT.ChucVu = txt_QT_Chucvu.Text; _frmUpdate = new frmUpdate(_quaTrinhCT, 3); _frmUpdate.Show(); break; } case 4: { _daoTaoBD = new DaoTao_BoiDuong(); _daoTaoBD.MaDV = txt_DT_MaDV.Text; _daoTaoBD.BatDau = convertStringToDate(txt_DT_BD.Text); _daoTaoBD.KetThuc = convertStringToDate(txt_DT_KT.Text); _daoTaoBD.TenLop = txt_DT_Tenlop.Text; _daoTaoBD.HinhThuc = txt_DT_Hinhthuc.Text; _daoTaoBD.ChungChi = txt_DT_Chungchi.Text; _frmUpdate = new frmUpdate(_daoTaoBD, 4); _frmUpdate.Show(); break; } case 5: { _diNuocNgoai = new DiNuocNgoai(); _diNuocNgoai.MaDV = txt_DNN_MaDV.Text; _diNuocNgoai.BatDau = convertStringToDate(txt_DNN_BD.Text); _diNuocNgoai.KetThuc = convertStringToDate(txt_DNN_KT.Text); _diNuocNgoai.NoiDung = rtxt_DNN_ND.Text; _diNuocNgoai.DiaDiem = txt_DNN_DD.Text; _frmUpdate = new frmUpdate(_diNuocNgoai, 5); _frmUpdate.Show(); break; } case 6: { _khenThuong = new KhenThuong(); _khenThuong.MaDV = txt_KT_MaDV.Text; _khenThuong.ThoiGian = convertStringToDate(txt_KT_TG.Text); _khenThuong.HinhThuc = txt_KT_Hinhthuc.Text; _khenThuong.CapQD = txt_KT_CapQD.Text; _khenThuong.LyDo = rtxt_KT_Lydo.Text; _frmUpdate = new frmUpdate(_khenThuong, 6); _frmUpdate.Show(); break; } case 7: { _kyLuat = new KyLuat(); _kyLuat.MaDV = txt_KL_MaDV.Text; _kyLuat.ThoiGian = convertStringToDate(txt_KL_TG.Text); _kyLuat.HinhThuc = txt_KL_Hinhthuc.Text; _kyLuat.CapQD = txt_KL_CapQD.Text; _kyLuat.LyDo = rtxt_KL_Lydo.Text; _frmUpdate = new frmUpdate(_kyLuat, 7); _frmUpdate.Show(); break; } case 8: { _giaDinh = new GiaDinh(); _giaDinh.MaDV = txt_GD_MaDV.Text; _giaDinh.QuanHe = txt_GD_QH.Text; _giaDinh.HoTen = txt_GD_Hoten.Text; _giaDinh.NamSinh = txt_GD_Namsinh.Text; _giaDinh.QueQuan = txt_GD_Quequan.Text; _giaDinh.DiaChi = rtxt_GD_Diachi.Text; _frmUpdate = new frmUpdate(_giaDinh, 8); _frmUpdate.Show(); break; } case 9: { _tuNhanXet = new TuNhanXet(); _tuNhanXet.MaDV = txt_TNX_MaDV.Text; _tuNhanXet.PhamChat = txt_TNX_PC.Text; _tuNhanXet.DaoDuc = txt_TNX_DD.Text; _tuNhanXet.NangLuc = txt_TNX_NL.Text; _tuNhanXet.QuanHeQC = txt_TNX_QHQC.Text; _tuNhanXet.KhuyetDiem = txt_TNX_KD.Text; _frmUpdate = new frmUpdate(_tuNhanXet, 9); _frmUpdate.Show(); break; } } }
// ĐÀO TẠO - BỒI DƯỠNG. public bool Insert_DaoTao_BoiDuong(DaoTao_BoiDuong daoTaoBD) { return(dal_Insert.Insert_DaoTao_BoiDuong(daoTaoBD)); }
// ĐÀO TẠO - BỒI DƯỠNG. public bool Update_DaoTao_BoiDuong(DaoTao_BoiDuong daoTaoBD) { return(dal_Update.Update_DaoTao_BoiDuong(daoTaoBD)); }
public frmUpdate(Object obj, int item) { InitializeComponent(); gbThongTin.Visible = false; gbThemThongTin.Visible = false; gbTrinhdo.Visible = false; gbQuatrinhCT.Visible = false; gbDaoTao.Visible = false; gbDiNN.Visible = false; gbKhenThuong.Visible = false; gbKyluat.Visible = false; gbGiadinh.Visible = false; gbTuNhanXet.Visible = false; switch (item) { case 0: this._thongTin = (ThongTin)obj; Update_ThongTin(_thongTin); gbThongTin.Visible = true; break; case 1: this._themThongTin = (ThemThongTin)obj; Update_ThemThongTin(_themThongTin); gbThemThongTin.Visible = true; break; case 2: this._trinhDo = (TrinhDo)obj; Update_TrinhDo(_trinhDo); gbTrinhdo.Visible = true; break; case 3: this._quaTrinhCT = (QuaTrinhCongTac)obj; Update_QTCT(_quaTrinhCT); gbQuatrinhCT.Visible = true; break; case 4: this._daoTaoBD = (DaoTao_BoiDuong)obj; Update_DTBD(_daoTaoBD); gbDaoTao.Visible = true; break; case 5: this._diNuocNgoai = (DiNuocNgoai)obj; Update_DNN(_diNuocNgoai); gbDiNN.Visible = true; break; case 6: this._khenThuong = (KhenThuong)obj; Update_KT(_khenThuong); gbKhenThuong.Visible = true; break; case 7: this._kyLuat = (KyLuat)obj; Update_KL(_kyLuat); gbKyluat.Visible = true; break; case 8: this._giaDinh = (GiaDinh)obj; Update_GD(_giaDinh); gbGiadinh.Visible = true; break; case 9: this._tuNhanXet = (TuNhanXet)obj; Update_TNX(_tuNhanXet); gbTuNhanXet.Visible = true; break; } }