internal IEnumerable <Nganhnhom> getCategory(string Manhanvien) { try { // DT_GIAODICH = (from GD in DT_GIAODICH.AsEnumerable() // join KH in SessionStart.DmKhachhangALL.AsEnumerable() on GD["customerCode"] equals KH[KhachhangFields.MakhachhangColumn.ColumnName] // into KHGD // from KH in KHGD.DefaultIfEmpty() // join NV in SessionStart.DmNhanvien.AsEnumerable() on GD["userCode"] equals NV[nhanvienFields.ManhanvienColumn.ColumnName] // into NVGD // from NV in NVGD.DefaultIfEmpty() // select addkhachhang(GD, KH, NV)).CopyToDataTable(); DataTable nganhnhoms = DB.WEB_GETNGANHNHOM(this.Madonvi); DataTable phanquyennganhnhom = DB.GetData_VTHH_DSphanquyennvhh(); nganhnhoms = (from nganhnhom in nganhnhoms.AsEnumerable() join phanquyen in phanquyennganhnhom.AsEnumerable() on nganhnhom["Ma"] equals phanquyen["Manganh"] where phanquyen["Manhanvien"].ToString() == Manhanvien select(nganhnhom) ).Concat(from nganhnhom in nganhnhoms.AsEnumerable() join phanquyen in phanquyennganhnhom.AsEnumerable() on nganhnhom["Macha"] equals phanquyen["Manganh"] where phanquyen["Manhanvien"].ToString() == Manhanvien select(nganhnhom)).CopyToDataTable(); List <Nganhnhom> c = LIB.ConvertDataTable <Nganhnhom>(nganhnhoms).ToList(); return(c); } catch { return(new List <Nganhnhom>()); } }
internal IEnumerable <Mathanggia> getProducts(System.Security.Claims.ClaimsPrincipal user) { string Manhanvien = user.FindFirst("Manhanvien").Value; IEnumerable <Nganhnhom> nganhnhoms = categorysManage.getCategory(Manhanvien); DataTable dataMathang = DB.Getdata_VTHH_MATHANG(DB.XNT_TABLENAME(PublicValue.ngayPhatSinh), this.Madonvi, this.DataBaseXnt, 1); dataMathang = (from mh in dataMathang.AsEnumerable() join pq in nganhnhoms on mh["Manhomhang"] equals pq.Ma select(mh) ).CopyToDataTable(); List <Mathanggia> listMathhang = LIB.ConvertDataTable <Mathanggia>(dataMathang).ToList(); return(listMathhang.AsEnumerable <Mathanggia>()); }