Exemple #1
0
        public static DataTable getDataTableDachSachMaQuanLi(string ID, bool NhapHang = false)
        {
            DataTable dt = null;

            using (PTTKHTEntities context = new PTTKHTEntities())
            {
                if (NhapHang)
                {
                    string query = String.Format("select * from HangHoa where QuanLy={0} and SoLuongTon<SLmin", ID);
                    dt = context.DataTable(query);
                }
                else
                {
                    string query = String.Format("select * from HangHoa where QuanLy={0}", ID);
                    dt = context.DataTable(query);
                }
            }
            return(dt);
        }
Exemple #2
0
        public static DataTable getDataTable(string search)
        {
            DataTable dt = null;

            using (PTTKHTEntities context = new PTTKHTEntities())
            {
                if (search != "")
                {
                    List <DoiTacQuangCao> LoaiHangs = context.DoiTacQuangCaos.ToList();
                    string query = String.Format("select * from DoiTacQuangCao where TenDoiTac like '%{0}%'", search);
                    dt = context.DataTable(query);
                }
                else
                {
                    dt = context.DataTable((
                                               from lh in context.DoiTacQuangCaos
                                               select lh
                                               ).ToString());
                }
            }
            return(dt);
        }
Exemple #3
0
        public static DataTable getDataTable(string search)
        {
            DataTable dt = null;

            using (PTTKHTEntities context = new PTTKHTEntities())
            {
                if (search != "")
                {
                    List <NhanVien> LoaiHangs = context.NhanViens.ToList();
                    string          query     = String.Format("select * from NhanVien where HoTen like '%{0}%'", search);
                    dt = context.DataTable(query);
                }
                else
                {
                    dt = context.DataTable((
                                               from lh in context.NhanViens
                                               select lh
                                               ).ToString());
                }
            }
            return(dt);
        }