Example #1
0
        private void GetData()
        {
            var a = from i in data.GetTable <LOP_HOC>()
                    select i;

            datagrid.ItemsSource = a;
        }
Example #2
0
        public String GetNameItem(int id)
        {
            Table <item> items = data.GetTable <item>();
            var          item  = from i in items
                                 where i.id_item == id
                                 select i.item_name;

            return(item.ToArray <string>()[0]);
        }
        private void textBoxX1_TextChanged(object sender, EventArgs e)
        {
            Table <employee>    employees   = data.GetTable <employee>();
            Table <distributor> distributor = data.GetTable <distributor>();
            var query = from em in employees
                        join dis in distributor on em.id_distributor equals dis.id_distributor
                        where em.id_employee.ToString().Contains(textBoxX1.Text) || em.name_employee.Contains(textBoxX1.Text)
                        select new { em.id_employee, em.name_employee, em.birth_date, em.sex, dis.name_distributor };

            dataGridViewX1.DataSource = query;
        }
        private void GetData()
        {
            var a = from i in data.GetTable <TAI_KHOAN>()
                    select i;

            datagrid.ItemsSource = a;
            var b = from u in data.GetTable <PHAN_QUYEN>()
                    select u;

            cb_loai.ItemsSource       = b;
            cb_loai.DisplayMemberPath = "PhanQuyen";
            cb_loai.SelectedValuePath = "MaLoai";
        }
        private void LoadKhoaHoc()
        {
            var a = from i in data.GetTable <KHOA_HOC>()
                    select new
            {
                makhoahoc  = i.MaKhoaHoc,
                tenkhoahoc = i.TenKhoaHoc
            };

            cb_khoa.ItemsSource       = a.ToList();
            cb_khoa.DisplayMemberPath = "tenkhoahoc";
            cb_khoa.SelectedValuePath = "makhoahoc";
        }
Example #6
0
        private void GetData(string mahv)
        {
            var a = from i1 in data.GetTable <BIEN_LAI>()
                    from i2 in data.GetTable <XUAT>()
                    from i3 in data.GetTable <HOC_VIEN>()
                    where i1.MaBL == i2.MaBL && i3.MaHocVien == mahv && i2.MaHocVien == i3.MaHocVien
                    select new
            {
                tenhocvien = i3.HoTenHocVien,
                noidung    = i1.NoiDung,
                sotien     = i1.SoTien,
                ngay       = i1.NgayBL
            };

            bienlai.ItemsSource = a;
        }
Example #7
0
        private void GetData()
        {
            var a = from i in data.GetTable <GIAO_VIEN>()
                    select i;

            datagrid.ItemsSource = a;
        }
Example #8
0
        private void GetData()
        {
            var a = from i in data.GetTable <THI>()
                    from x in data.GetTable <HOC_VIEN>()
                    from y in data.GetTable <LOP_HOC>()
                    where i.MaHocVien == x.MaHocVien && i.MaLopHoc == y.MaLopHoc
                    select new
            {
                dethi   = i.MaDeThi,
                mon     = y.MaLopHoc,
                hocvien = x.HoTenHocVien,
                ngaythi = i.NgayThi,
                diem    = i.KetQua
            };

            datagrid.ItemsSource = a;
        }
Example #9
0
        public IQueryable <distributor> SeachDistribui(String key)
        {
            Table <distributor> distri = data.GetTable <distributor>();
            var query = from dis in distri
                        where dis.name_distributor.Contains(key) || dis.id_distributor.ToString().Contains(key)
                        select dis;

            return(query);
        }
Example #10
0
        private void GetData_Kithi()
        {
            var a = from i in data.GetTable <KI_THI>()
                    select i;

            kithi.ItemsSource = a;
        }
        public IQueryable SelectAllImportTicket()
        {
            Table <im_ticket> im_tickets = data.GetTable <im_ticket>();
            Table <shipment>  shipments  = data.GetTable <shipment>();
            Table <employee>  employees  = data.GetTable <employee>();
            var query = from i in im_tickets
                        join s in shipments on i.id_im_ticket equals s.id_im_ticket
                        group s by new { i.id_im_ticket, i.date_im, i.id_accountant, i.id_shipper, i.id_storager, i.id_write } into lll
                select new { id   = lll.Key.id_im_ticket, date = lll.Key.date_im,
                             acc  = lll.Key.id_accountant, shipper = lll.Key.id_shipper, writer = lll.Key.id_write, storage = lll.Key.id_storager
                             , sl = lll.Count() };
            var exe = from dd in query
                      join a in employees on dd.acc equals a.id_employee
                      join b in employees on dd.shipper equals b.id_employee
                      join c in employees on dd.storage equals c.id_employee
                      join d in employees on dd.writer equals d.id_employee
                      select new{ ID           = dd.id, date = dd.date, acc_name = a.name_employee, shipper_name = b.name_employee,
                                  storage_name = c.name_employee, write = d.name_employee, Sl = dd.sl };

            return(exe);
        }
        public int Insert(ex_ticket e)
        {
            Table <ex_ticket> table = data.GetTable <ex_ticket>();

            table.InsertOnSubmit(e);
            data.SubmitChanges();
            return(e.id_ex_ticket);
        }
Example #13
0
        public int InsertShipment(shipment shipment)
        {
            Table <shipment> shipments = data.GetTable <shipment>();

            shipments.InsertOnSubmit(shipment);
            data.SubmitChanges();
            return(shipment.id_shipment);
        }
 private void GetAccountData()
 {
     DataDataContext data = new DataDataContext();
     var hocvien = from username in data.GetTable<NGUOIDUNG>() select username.TAIKHOAN;
 }
        private void GetData()
        {
            var hocvien = from i in data.GetTable <HOC_VIEN>() select i;

            datagrid.ItemsSource = hocvien;
        }