Exemplo n.º 1
0
        public bool XoaChiaCaLamViec(string maNhanVien, string maCaLamViec, DateTime ngay)
        {
            ChiaCaLamViecDAL dal = new ChiaCaLamViecDAL(db);

            try
            {
                if (!string.IsNullOrEmpty(maNhanVien) && !string.IsNullOrEmpty(maCaLamViec) && ngay != null)
                {
                    if (TimKiemChiTietChiaCaLamViec(maNhanVien, maCaLamViec, ngay) != null)
                    {
                        return(dal.XoaPhanQuyen(maNhanVien, maCaLamViec, ngay));
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 2
0
        public bool CapNhat(ChiaCaLamViec item)
        {
            ChiaCaLamViecDAL dal = new ChiaCaLamViecDAL(db);

            if (item != null)
            {
                return(dal.CapNhat(item));
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 3
0
        public IEnumerable <ChiaCaLamViecModel> DanhSachTatCaCaLamViec()
        {
            ChiaCaLamViecDAL dal = new ChiaCaLamViecDAL(db);

            try
            {
                return(dal.DanhSachTatCaCaLamViec());
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 4
0
        public bool Xoa(ChiaCaLamViec item)
        {
            ChiaCaLamViecDAL dal = new ChiaCaLamViecDAL(db);

            try
            {
                if (item != null)
                {
                    return(dal.Xoa(item));
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 5
0
        public ChiaCaLamViec TimKiemTheoMa(string id)
        {
            ChiaCaLamViecDAL dal = new ChiaCaLamViecDAL(db);

            try
            {
                if (!string.IsNullOrEmpty(id))
                {
                    return(dal.TimKiemTheoMa(id));
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 6
0
        public IEnumerable <ChiaCaLamViecModel> DanhSachCaLamViecDaGan(string maNhanVien, DateTime ngayLamViec)
        {
            ChiaCaLamViecDAL dal = new ChiaCaLamViecDAL(db);

            try
            {
                if (!string.IsNullOrEmpty(maNhanVien))
                {
                    return(dal.DanhSachCaLamViecDaGan(maNhanVien, ngayLamViec));
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 7
0
        public IEnumerable <ChiaCaLamViec> LayTatCa()
        {
            ChiaCaLamViecDAL dal = new ChiaCaLamViecDAL(db);

            return(dal.LayTatCa());
        }