public void Sua(ChiTietNgoaiNguEntity pb) { KetNoiCSDL.MoKetNoi(); string themhd = @"UPDATE tblChiTietNgoaiNgu SET ThoiGian =@ThoiGian, TrinhDo =@TrinhDo, GhiChu =@GhiChu Where MaNN=@MaNN and MaNV=@MaNV"; SqlCommand cdm = new SqlCommand(themhd, KetNoiCSDL.connect); // cdm.CommandType = CommandType.StoredProcedure; cdm.Parameters.AddWithValue("@ThoiGian", pb.ThoiGian); cdm.Parameters.AddWithValue("@TrinhDo", pb.TrinhDo); cdm.Parameters.AddWithValue("@GhiChu", pb.GhiChu); cdm.Parameters.AddWithValue("@MaNN", pb.MaNN); cdm.Parameters.AddWithValue("@MaNV", pb.MaNV); cdm.ExecuteNonQuery(); KetNoiCSDL.DongKetNoi(); }
public void Sua(ChiTietHopDongEntity pb) { KetNoiCSDL.MoKetNoi(); string themhd = @"UPDATE tblPhongBan SET NgayBatDau =@NgayBatDau, NgayKetThuc =@NgayKetThuc, GhiChu =@GhiChu Where MaHD=@MaHD and MaNV=@MaNV"; SqlCommand cdm = new SqlCommand(themhd, KetNoiCSDL.connect); // cdm.CommandType = CommandType.StoredProcedure; cdm.Parameters.AddWithValue("@NgayBatDau", pb.NgayBatDau); cdm.Parameters.AddWithValue("@NgayKetThuc", pb.NgayKetThuc); cdm.Parameters.AddWithValue("@GhiChu", pb.GhiChu); cdm.Parameters.AddWithValue("@MaHD", pb.MaHD); cdm.Parameters.AddWithValue("@MaNV", pb.MaNV); cdm.ExecuteNonQuery(); KetNoiCSDL.DongKetNoi(); }
public void Sua(PhieuLuongEntity pl) { KetNoiCSDL.MoKetNoi(); string themhd = @"UPDATE tblPhieuLuong SET MaNV =@MaNV, LuongCoBan =@LuongCoBan, HeSoLuong =@HeSoLuong, TienThuong =@TienThuong, PhuCap =@PhuCap, TongLinh =@TongLinh, NgayLinh =@NgayLinh WHERE MaPhieuLuong=@MaPhieuLuong"; SqlCommand cdm = new SqlCommand(themhd, KetNoiCSDL.connect); // cdm.CommandType = CommandType.StoredProcedure; cdm.Parameters.AddWithValue("@MaNV", pl.MaNV); cdm.Parameters.AddWithValue("@LuongCoBan", pl.LuongCoBan); cdm.Parameters.AddWithValue("@HeSoLuong", pl.HeSoLuong); cdm.Parameters.AddWithValue("@TienThuong", pl.TienThuong); cdm.Parameters.AddWithValue("@PhuCap", pl.PhuCap); cdm.Parameters.AddWithValue("@TongLinh", pl.TongLinh); cdm.Parameters.AddWithValue("@NgayLinh", pl.NgayLinh); cdm.Parameters.AddWithValue("@MaPhieuLuong", pl.MaPhieuLuong); cdm.ExecuteNonQuery(); KetNoiCSDL.DongKetNoi(); }
public void Them(NhanVienEntity pb) { KetNoiCSDL.MoKetNoi(); string themhd = @"INSERT INTO tblNhanVien(MaNV, HoTen, GioiTinh, NgaySinh, DiaChi, MaPB, MaChucVu, MaChuyenMon, GhiChu) VALUES(@MaNV,@HoTen,@GioiTinh,@NgaySinh,@DiaChi,@MaPB,@MaChucVu,@MaChuyenMon,@GhiChu)"; SqlCommand cdm = new SqlCommand(themhd, KetNoiCSDL.connect); // cdm.CommandType = CommandType.StoredProcedure; cdm.Parameters.AddWithValue("@MaNV", pb.MaNV); cdm.Parameters.AddWithValue("@HoTen", pb.HoTen); cdm.Parameters.AddWithValue("@GioiTinh", pb.GioiTinh); cdm.Parameters.AddWithValue("@NgaySinh", pb.NgaySinh); cdm.Parameters.AddWithValue("@MaPB", pb.MaPB); cdm.Parameters.AddWithValue("@DiaChi", pb.DiaChi); cdm.Parameters.AddWithValue("@MaChucVu", pb.MaChucVu); cdm.Parameters.AddWithValue("@MaChuyenMon", pb.MaChuyenMon); cdm.Parameters.AddWithValue("@GhiChu", pb.GhiChu); cdm.ExecuteNonQuery(); KetNoiCSDL.DongKetNoi(); }
public void Them(PhieuLuongEntity pl) { KetNoiCSDL.MoKetNoi(); string themhd = @"INSERT INTO tblPhieuLuong(MaPhieuLuong, MaNV, LuongCoBan, HeSoLuong, TienThuong, PhuCap, TongLinh, NgayLinh) VALUES(@MaPhieuLuong,@MaNV,@LuongCoBan,@HeSoLuong,@TienThuong,@PhuCap,@TongLinh,@NgayLinh)"; SqlCommand cdm = new SqlCommand(themhd, KetNoiCSDL.connect); // cdm.CommandType = CommandType.StoredProcedure; cdm.Parameters.AddWithValue("@MaPhieuLuong", pl.MaPhieuLuong); cdm.Parameters.AddWithValue("@MaNV", pl.MaNV); cdm.Parameters.AddWithValue("@LuongCoBan", pl.LuongCoBan); cdm.Parameters.AddWithValue("@HeSoLuong", pl.HeSoLuong); cdm.Parameters.AddWithValue("@TienThuong", pl.TienThuong); cdm.Parameters.AddWithValue("@PhuCap", pl.PhuCap); cdm.Parameters.AddWithValue("@TongLinh", pl.TongLinh); cdm.Parameters.AddWithValue("@NgayLinh", pl.NgayLinh); cdm.ExecuteNonQuery(); KetNoiCSDL.DongKetNoi(); }
public void Sua(NhanVienEntity pb) { KetNoiCSDL.MoKetNoi(); string themhd = @"UPDATE tblNhanVien SET HoTen =@HoTen, GioiTinh =@GioiTinh, NgaySinh =@NgaySinh, DiaChi =@DiaChi, MaPB =@MaPB, MaChucVu =@MaChucVu, MaChuyenMon =@MaChuyenMon, GhiChu =@GhiChu Where MaNV=@MaNV"; SqlCommand cdm = new SqlCommand(themhd, KetNoiCSDL.connect); // cdm.CommandType = CommandType.StoredProcedure; cdm.Parameters.AddWithValue("@MaNV", pb.MaNV); cdm.Parameters.AddWithValue("@HoTen", pb.HoTen); cdm.Parameters.AddWithValue("@GioiTinh", pb.GioiTinh); cdm.Parameters.AddWithValue("@NgaySinh", pb.NgaySinh); cdm.Parameters.AddWithValue("@MaPB", pb.MaPB); cdm.Parameters.AddWithValue("@DiaChi", pb.DiaChi); cdm.Parameters.AddWithValue("@MaChucVu", pb.MaChucVu); cdm.Parameters.AddWithValue("@MaChuyenMon", pb.MaChuyenMon); cdm.Parameters.AddWithValue("@GhiChu", pb.GhiChu); cdm.ExecuteNonQuery(); KetNoiCSDL.DongKetNoi(); }