public void Xoa(NgoaiNguEntity tk)
        {
            KetNoiCSDL.MoKetNoi();
            string     sql = @"DELETE tblNgoaiNgu WHERE MaNN=@MaNN";
            SqlCommand cdm = new SqlCommand(sql, KetNoiCSDL.connect);

            cdm.Parameters.AddWithValue("@MaNN", tk.MaNN);
            cdm.ExecuteNonQuery();
            KetNoiCSDL.DongKetNoi();
        }
Example #2
0
        public void Xoa(PhongBanEntity pb)
        {
            KetNoiCSDL.MoKetNoi();
            string     sql = @"DELETE tblPhongBan WHERE MaPB=@MaPB";
            SqlCommand cmd = new SqlCommand(sql, KetNoiCSDL.connect);

            cmd.Parameters.AddWithValue("@MaPB", pb.MaPB);
            cmd.ExecuteNonQuery();
            KetNoiCSDL.DongKetNoi();
        }
Example #3
0
        public void Xoa(TaiKhoanEntity tk)
        {
            KetNoiCSDL.MoKetNoi();
            string     sql = @"DELETE tblTaiKhoan WHERE MaNV=@MaNV";
            SqlCommand cmd = new SqlCommand(sql, KetNoiCSDL.connect);

            cmd.Parameters.AddWithValue("@MaNV", tk.MaNV);
            cmd.ExecuteNonQuery();
            KetNoiCSDL.DongKetNoi();
        }
Example #4
0
        public void Xoa(PhieuLuongEntity pl)
        {
            KetNoiCSDL.MoKetNoi();
            string     sql = @"DELETE tblPhieuLuong WHERE MaPhieuLuong=@MaPhieuLuong";
            SqlCommand cmd = new SqlCommand(sql, KetNoiCSDL.connect);

            cmd.Parameters.AddWithValue("@MaPhieuLuong", pl.MaPhieuLuong);
            cmd.ExecuteNonQuery();
            KetNoiCSDL.DongKetNoi();
        }
        public void Xoa(ChiTietKhenThuongEntity pb)
        {
            KetNoiCSDL.MoKetNoi();
            string     sql = @"DELETE tblChiTietKhenThuong WHERE MaKT=@MaHD and MaNV=@MaNV";
            SqlCommand cmd = new SqlCommand(sql, KetNoiCSDL.connect);

            cmd.Parameters.AddWithValue("@MaHD", pb.MaKT);
            cmd.Parameters.AddWithValue("@MaNV", pb.MaNV);
            cmd.ExecuteNonQuery();
            KetNoiCSDL.DongKetNoi();
        }
Example #6
0
        public void Sua(TaiKhoanEntity tk)
        {
            KetNoiCSDL.MoKetNoi();
            string     themhd = @"UPDATE tblTaiKhoan SET MatKhau =@MatKhau, TaiKhoan =@TaiKhoan Where MaNV=@MaNV";
            SqlCommand cdm    = new SqlCommand(themhd, KetNoiCSDL.connect);

            // cdm.CommandType = CommandType.StoredProcedure;
            cdm.Parameters.AddWithValue("@TaiKhoan", tk.TaiKhoan);
            cdm.Parameters.AddWithValue("@MatKhau", tk.MatKhau);
            cdm.Parameters.AddWithValue("@MaNV", tk.MaNV);

            cdm.ExecuteNonQuery();
            KetNoiCSDL.DongKetNoi();
        }
        public void Them(NgoaiNguEntity tk)
        {
            KetNoiCSDL.MoKetNoi();
            string     themhd = @"INSERT INTO tblNgoaiNgu(MaNN,TenNN) VALUES (@MaNN,@TenNN)";
            SqlCommand cdm    = new SqlCommand(themhd, KetNoiCSDL.connect);

            // cdm.CommandType = CommandType.StoredProcedure;

            cdm.Parameters.AddWithValue("@MaNN", tk.MaNN);
            cdm.Parameters.AddWithValue("@TenNN", tk.TenNN);

            cdm.ExecuteNonQuery();
            KetNoiCSDL.DongKetNoi();
        }
Example #8
0
        public void Them(TaiKhoanEntity tk)
        {
            KetNoiCSDL.MoKetNoi();
            string     themhd = @"INSERT INTO tblTaiKhoan(TaiKhoan, MatKhau, MaNV) VALUES (@TaiKhoan,@MatKhau,@MaNV)";
            SqlCommand cdm    = new SqlCommand(themhd, KetNoiCSDL.connect);

            // cdm.CommandType = CommandType.StoredProcedure;
            cdm.Parameters.AddWithValue("@TaiKhoan", tk.TaiKhoan);
            cdm.Parameters.AddWithValue("@MatKhau", tk.MatKhau);
            cdm.Parameters.AddWithValue("@MaNV", tk.MaNV);

            cdm.ExecuteNonQuery();
            KetNoiCSDL.DongKetNoi();
        }
        public void Sua(NgoaiNguEntity tk)
        {
            KetNoiCSDL.MoKetNoi();
            string     themhd = @"UPDATE tblNgoaiNgu SET TenNN =@TenNN Where MaNN=@MaNN";
            SqlCommand cdm    = new SqlCommand(themhd, KetNoiCSDL.connect);

            // cdm.CommandType = CommandType.StoredProcedure;

            cdm.Parameters.AddWithValue("@MaNN", tk.MaNN);
            cdm.Parameters.AddWithValue("@TenNN", tk.TenNN);

            cdm.ExecuteNonQuery();
            KetNoiCSDL.DongKetNoi();
        }
        public void Them(ChiTietKhenThuongEntity pb)
        {
            KetNoiCSDL.MoKetNoi();
            string     themhd = @"INSERT INTO tblChiTietKhenThuong(MaKT, MaNV,NgayKhenThuong,TienKhenThuong,GhiChu) VALUES(@MaPB,@TenPB,@DiaDiem,@SDT,@GhiChu)";
            SqlCommand cdm    = new SqlCommand(themhd, KetNoiCSDL.connect);

            // cdm.CommandType = CommandType.StoredProcedure;
            cdm.Parameters.AddWithValue("@MaPB", pb.MaKT);
            cdm.Parameters.AddWithValue("@TenPB", pb.MaNV);
            cdm.Parameters.AddWithValue("@DiaDiem", pb.NgayKhenThuong);
            cdm.Parameters.AddWithValue("@SDT", pb.TienKhenThuong);
            cdm.Parameters.AddWithValue("@GhiChu", pb.GhiChu);
            cdm.ExecuteNonQuery();
            KetNoiCSDL.DongKetNoi();
        }
Example #11
0
        public void Them(PhongBanEntity pb)
        {
            KetNoiCSDL.MoKetNoi();
            string     themhd = @"INSERT INTO tblPhongBan (MaPB, TenPB, DiaDiem, SDT) VALUES(@MaPB,@TenPB,@DiaDiem,@SDT)";
            SqlCommand cdm    = new SqlCommand(themhd, KetNoiCSDL.connect);

            // cdm.CommandType = CommandType.StoredProcedure;
            cdm.Parameters.AddWithValue("@MaPB", pb.MaPB);
            cdm.Parameters.AddWithValue("@TenPB", pb.TenPB);
            cdm.Parameters.AddWithValue("@DiaDiem", pb.DiaDiem);
            cdm.Parameters.AddWithValue("@SDT", pb.SDT);

            cdm.ExecuteNonQuery();
            KetNoiCSDL.DongKetNoi();
        }
Example #12
0
        public void Sua(PhongBanEntity pb)
        {
            KetNoiCSDL.MoKetNoi();
            string     themhd = @"UPDATE tblPhongBan SET TenPB =@TenPB, DiaDiem =@DiaDiem, SDT =@SDT Where MaPB=@MaPB";
            SqlCommand cdm    = new SqlCommand(themhd, KetNoiCSDL.connect);

            // cdm.CommandType = CommandType.StoredProcedure;
            cdm.Parameters.AddWithValue("@MaPB", pb.MaPB);
            cdm.Parameters.AddWithValue("@TenPB", pb.TenPB);
            cdm.Parameters.AddWithValue("@DiaDiem", pb.DiaDiem);
            cdm.Parameters.AddWithValue("@SDT", pb.SDT);

            cdm.ExecuteNonQuery();
            KetNoiCSDL.DongKetNoi();
        }
        public void Them(ChiTietNgoaiNguEntity pb)
        {
            KetNoiCSDL.MoKetNoi();
            string     themhd = @"INSERT INTO tblChiTietNgoaiNgu(MaNN, MaNV,ThoiGian,TrinhDo,GhiChu) VALUES(@MaPB,@TenPB,@DiaDiem,@SDT,@GhiChu)";
            SqlCommand cdm    = new SqlCommand(themhd, KetNoiCSDL.connect);

            // cdm.CommandType = CommandType.StoredProcedure;
            cdm.Parameters.AddWithValue("@MaPB", pb.MaNN);
            cdm.Parameters.AddWithValue("@TenPB", pb.MaNV);
            cdm.Parameters.AddWithValue("@DiaDiem", pb.ThoiGian);
            cdm.Parameters.AddWithValue("@SDT", pb.TrinhDo);
            cdm.Parameters.AddWithValue("@GhiChu", pb.GhiChu);
            cdm.ExecuteNonQuery();
            KetNoiCSDL.DongKetNoi();
        }
        public void Sua(ChiTietKhenThuongEntity pb)
        {
            KetNoiCSDL.MoKetNoi();
            string     themhd = @"UPDATE tblChiTietKhenThuong SET NgayKhenThuong =@NgayBatDau, TienKhenThuong =@NgayKetThuc, GhiChu =@GhiChu Where MaKT=@MaHD and MaNV=@MaNV";
            SqlCommand cdm    = new SqlCommand(themhd, KetNoiCSDL.connect);

            // cdm.CommandType = CommandType.StoredProcedure;
            cdm.Parameters.AddWithValue("@NgayBatDau", pb.NgayKhenThuong);
            cdm.Parameters.AddWithValue("@NgayKetThuc", pb.TienKhenThuong);
            cdm.Parameters.AddWithValue("@GhiChu", pb.GhiChu);
            cdm.Parameters.AddWithValue("@MaHD", pb.MaKT);
            cdm.Parameters.AddWithValue("@MaNV", pb.MaNV);

            cdm.ExecuteNonQuery();
            KetNoiCSDL.DongKetNoi();
        }
        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 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();
        }
Example #17
0
        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 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();
        }
Example #19
0
        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();
        }