예제 #1
0
 private void LoadDuLieu()
 {
     using (QLKhoEntities db = new QLKhoEntities())
     {
         ReceivedDocket.ItemsSource = db.PHIEUNHAPHANGs.ToList <PHIEUNHAPHANG>();
     }
 }
예제 #2
0
        private void btn_searchCus_Click(object sender, RoutedEventArgs e)
        {
            string        xx     = tb_ncc.Text;
            QLKhoEntities search = new QLKhoEntities();

            KhachHang.ItemsSource = search.sp_TimKiemNhaCungCapTheoTenNhaCungCap(xx);
        }
예제 #3
0
 private void LoadDuLieu()
 {
     using (QLKhoEntities db = new QLKhoEntities())
     {
         Inventory.ItemsSource = db.TONDAUKIs.ToList <TONDAUKI>();
     }
 }
예제 #4
0
 private void LoadDuLieu()
 {
     using (QLKhoEntities db = new QLKhoEntities())
     {
         Goods.ItemsSource = db.HANGHOAs.ToList <HANGHOA>();
     }
 }
예제 #5
0
 private void LoadDuLieu()
 {
     using (QLKhoEntities db = new QLKhoEntities())
     {
         KhachHang.ItemsSource = db.KHACHHANGs.ToList <KHACHHANG>();
     }
 }
 private void LoadDuLieu()
 {
     using (QLKhoEntities db = new QLKhoEntities())
     {
         DeliverySlip.ItemsSource = db.PHIEUXUATHANGs.ToList <PHIEUXUATHANG>();
     }
 }
        private void btn_searchInput_Click(object sender, RoutedEventArgs e)
        {
            string        xx     = tb_Input.Text;
            QLKhoEntities search = new QLKhoEntities();

            Input.ItemsSource = search.sp_TimKiemPhieuNhapTheoSoChungTu(xx);
        }
예제 #8
0
        //private void btn_searchInventory_Click(object sender, RoutedEventArgs e)
        //{
        //    string tenhhh = tb_SLTon.Text;
        //    QLKhoEntities context = new QLKhoEntities();
        //    QLKhoEntities search = new QLKhoEntities();
        //    var mahhh = from b in context.HANGHOAs
        //                    where b.TenHH == tenhhh
        //                    select b.MaHH;
        //    var d = search.sp_TimSoLuongTonCuaHangHoa(mahhh.ToString());
        //    var details = (from order in context.HANGHOAs
        //                   join cust in d
        //                   on order.MaHH equals cust.MaHH
        //                   select new
        //                   {
        //                       MaHH = order.MaHH,
        //                       TenHH = order.TenHH,
        //                       SLTon = cust.SLTon,
        //                       GiaTien = cust.GiaTien,
        //                       }).ToList();
        //    Inventory.ItemsSource = details;
        //}

        private void btn_searchInventory_Click(object sender, RoutedEventArgs e)
        {
            string tenhhh = tb_SLTon.Text;

            QLKhoEntities search = new QLKhoEntities();

            Inventory.ItemsSource = search.sp_TimKiemSoLuongTonCuaHangHoaTheoTenHH(tenhhh);
        }
예제 #9
0
        private void accept_Click(object sender, RoutedEventArgs e)
        {
            DateTime?selectedDate2 = FinishDate.SelectedDate;

            DateTime?selectedDate1 = BeginDate.SelectedDate;

            QLKhoEntities Loc = new QLKhoEntities();

            var t = Loc.sp_XuatBangNhapHang(selectedDate1, selectedDate2);

            ReceivedDocket.ItemsSource = t;
        }
        private void search_Click(object sender, RoutedEventArgs e)
        {
            string xx = tb_search.Text;

            QLKhoEntities search = new QLKhoEntities();

            //c.Add(search.sp_TimKiemPhieuXuatTheoSoChungTu(xx));
            Output.ItemsSource = search.sp_TimKiemPhieuXuatTheoSoChungTu(xx);
            if (xx == null)
            {
                Output.ItemsSource = search.PHIEUXUATHANGs.ToList <PHIEUXUATHANG>();
            }
        }
예제 #11
0
        //chấp nhận sửa nhà cung cấp
        private void btn_accept_Click(object sender, RoutedEventArgs e)
        {
            string   st1 = txb_NCC.Text;
            string   st2 = txb_TenNCC.Text;
            string   st3 = txb_SDT.Text;
            DateTime?st4 = date_ngSinh.SelectedDate;

            string st5 = txb_DiaChi.Text;

            QLKhoEntities db = new QLKhoEntities();

            db.sp_updateCus(st1, st2, st3, st5, st4);
            MessageBox.Show("Đã sửa thông tin khách hàng thành công!");
        }
예제 #12
0
        // chấp nhận thêm 1 Nhà cung cấp
        private void btn_accept1_Click(object sender, RoutedEventArgs e)
        {
            txb_NCC.TabIndex  = 0;
            txb_NCC.IsTabStop = true;
            string   st1 = txb_NCC.Text;
            string   st2 = txb_TenNCC.Text;
            string   st3 = txb_SDT.Text;
            string   st4 = txb_DiaChi.Text;
            DateTime?st5 = date_ngSinh.SelectedDate;

            QLKhoEntities db = new QLKhoEntities();

            db.sp_addCus(st1, st2, st3, st4, st5);
            MessageBox.Show("Đã thêm khách hàng thành công!");
        }
예제 #13
0
 private void ShowTonDauKi()
 {
     using (QLKhoEntities db = new QLKhoEntities())
     {
         var details = (from order in db.HANGHOAs
                        join cust in db.TONDAUKIs
                        on order.MaHH equals cust.MaHH
                        select new
         {
             MaHH = order.MaHH,
             TenHH = order.TenHH,
             SLTon = cust.SLTon,
             GiaTien = cust.GiaTien,
         }).ToList();
         Inventory.ItemsSource = details;
     }
 }
예제 #14
0
        private void ShowHangHoa()
        {
            using (QLKhoEntities db = new QLKhoEntities())
            {
                var details = (from order in db.HANGHOAs
                               join xxx in db.PHIEUNHAPHANGs on order.MaHH equals xxx.MaHH
                               join cust in db.KHACHHANGs on xxx.MaKH equals cust.MaKH

                               select new
                {
                    MaHH = order.MaHH,
                    TenHH = order.TenHH,
                    TenKH = cust.TenKH,
                    GiaTien = xxx.GiaTien,
                }).ToList();
                Goods.ItemsSource = details;
            }
        }
예제 #15
0
        private void remove_Click(object sender, RoutedEventArgs e)
        {
            QLKhoEntities remove = new QLKhoEntities();
            object        t      = KhachHang.SelectedItem;

            Binding_Cus.DataContext = t;
            if (MessageBox.Show("Bạn có chắc chắn muốn xóa khách hàng này không ?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No)
            {
                //do no stuff
            }
            else
            {
                //do yes stuff
                string st1 = txb_NCC.Text;

                remove.sp_deleteCus(st1);
                MessageBox.Show("Bạn đã xóa thành công khách hàng này!");
            }
        }
예제 #16
0
        private void btn_searchGoods_Click(object sender, RoutedEventArgs e)
        {
            string        xx      = tb_Goods.Text;
            QLKhoEntities search  = new QLKhoEntities();
            QLKhoEntities db      = new QLKhoEntities();
            var           c       = search.sp_TimKiemHangHoaTheoTenHH(xx);
            var           details = (from order in c
                                     join xxx in db.PHIEUNHAPHANGs on order.MaHH equals xxx.MaHH
                                     join cust in db.KHACHHANGs on xxx.MaKH equals cust.MaKH

                                     select new
            {
                MaHH = order.MaHH,
                TenHH = order.TenHH,
                TenKH = cust.TenKH,
                GiaTien = xxx.GiaTien,
            }).ToList();

            Goods.ItemsSource = details;
        }