public bool Update_TuNhanXet(TuNhanXet tuNhanXet) { SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "SP_Update_TUNHANXET"; cmd.Parameters.Add("@MADV", SqlDbType.NVarChar).Value = tuNhanXet.MaDV; cmd.Parameters.Add("@PHAMCHAT", SqlDbType.NVarChar).Value = tuNhanXet.PhamChat; cmd.Parameters.Add("@DAODUC", SqlDbType.NVarChar).Value = tuNhanXet.DaoDuc; cmd.Parameters.Add("@NANGLUC", SqlDbType.NVarChar).Value = tuNhanXet.NangLuc; cmd.Parameters.Add("@QUANHE_QC", SqlDbType.NVarChar).Value = tuNhanXet.QuanHeQC; cmd.Parameters.Add("@KHUYETDIEM", SqlDbType.NVarChar).Value = tuNhanXet.KhuyetDiem; cmd.Connection = _conn; try { _conn.Open(); cmd.ExecuteNonQuery(); return(true); } catch { return(false); } finally { _conn.Close(); } }
// Insert Tự nhận xét. private TuNhanXet Insert_TNX() { string maDV = txt_TNX_MaDV.Text; string phamChat = txt_TNX_PC.Text; string daoDuc = txt_TNX_DD.Text; string nangLuc = txt_TNX_NL.Text; string quanHeQC = txt_TNX_QHQC.Text; string khuyeDiem = txt_TNX_KD.Text; if (maDV == "" || phamChat == "" || daoDuc == "" || nangLuc == "" || quanHeQC == "" || khuyeDiem == "") { MessageBox.Show("Vui lòng nhập đầy đủ Thông tin!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); return(null); } else { _tuNhanXet = new TuNhanXet(maDV, phamChat, daoDuc, nangLuc, quanHeQC, khuyeDiem); return(_tuNhanXet); } }
// Update Tự nhận xét. private void Update_TNX(TuNhanXet TNX) { txt_TNX_MaDV.Text = TNX.MaDV; txt_TNX_PC.Text = TNX.PhamChat; txt_TNX_DD.Text = TNX.DaoDuc; txt_TNX_NL.Text = TNX.NangLuc; txt_TNX_QHQC.Text = TNX.QuanHeQC; txt_TNX_KD.Text = TNX.KhuyetDiem; //if (maDV == "" || phamChat == "" || daoDuc == "" || nangLuc == "" || quanHeQC == "" || khuyeDiem == "") //{ // MessageBox.Show("Vui lòng nhập đầy đủ Thông tin!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); // return null; //} //else //{ // _tuNhanXet = new TuNhanXet(maDV, phamChat, daoDuc, nangLuc, quanHeQC, khuyeDiem); // return _tuNhanXet; //} }
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; } } }
public bool Insert_TuNhanXet(TuNhanXet tuNhanXet) { return(dal_Insert.Insert_TuNhanXet(tuNhanXet)); }
public bool Update_TuNhanXet(TuNhanXet tuNhanXet) { return(dal_Update.Update_TuNhanXet(tuNhanXet)); }
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; } }