예제 #1
0
        public void Application_Start(object sender, StartupEventArgs args)
        {
            Context = new movement_of_goodsEntities();
            LoginScreen ls = new LoginScreen();

            ls.Show();
        }
예제 #2
0
        private void Button_Click_Search(object sender, RoutedEventArgs e)
        {
            string searchByIdOfOrder      = код_заказаTextBox.Text;
            string searchByIdOfshipment   = код_поставкиTextBox.Text;
            string searchByIdOfShipper    = код_поставщикаTextBox.Text;
            string searchByNameOfShipper  = наименование_поставщикаTextBox.Text;
            string searchByIdOfProduct    = код_товараTextBox.Text;
            string searchByNameOfProduct  = наименование_товараTextBox.Text;
            string searchByDeliveryDate   = дата_поступленияDatePicker.Text;
            string searchByDateOfShipment = дата_выбытияDatePicker.Text;

            var warehousePosition = from warehousePositions in App.Context.склад
                                    select warehousePositions;

            warehousePosition = warehousePosition.Where(wh => wh.код_заказа.Contains(searchByIdOfOrder));
            warehousePosition = warehousePosition.Where(wh => wh.код_поставки.Contains(searchByIdOfshipment));
            warehousePosition = warehousePosition.Where(wh => wh.код_поставщика.Contains(searchByIdOfShipper));
            warehousePosition = warehousePosition.Where(wh => wh.наименование_поставщика.Contains(searchByNameOfShipper));
            warehousePosition = warehousePosition.Where(wh => wh.код_товара.Contains(searchByIdOfProduct));
            warehousePosition = warehousePosition.Where(wh => wh.наименование_товара.Contains(searchByNameOfProduct));

            WarehouseWindow.warehViewSource.Source = warehousePosition.ToList();

            if (дата_поступленияDatePicker.Text.Length > 0)
            {
                using (var db = new movement_of_goodsEntities())
                {
                    var tempSearchByDeliveryDate = DateTime.Parse(searchByDeliveryDate);
                    var filteredData             = db.склад.Where(t => t.дата_поступления == tempSearchByDeliveryDate);
                    WarehouseWindow.warehViewSource.Source = filteredData.ToList();
                }
            }

            if (дата_выбытияDatePicker.Text.Length > 0)
            {
                using (var db = new movement_of_goodsEntities())
                {
                    var tempSearchByDateOfShipment = DateTime.Parse(searchByDateOfShipment);
                    var filteredData = db.склад.Where(t => t.дата_выбытия == tempSearchByDateOfShipment);
                    WarehouseWindow.warehViewSource.Source = filteredData.ToList();
                }
            }
        }
예제 #3
0
        private void Button_Click_Search(object sender, RoutedEventArgs e)
        {
            string searchByIdOfTTN            = ттнTextBox.Text;
            string searchByIdOfOrder          = код_заказаTextBox.Text;
            string searchByIdOfCounterparty   = код_контрагентаTextBox.Text;
            string searchByNameOfCounterparty = наименование_контрагентаTextBox.Text;
            string searchByIdOfShipper        = код_поставщикаTextBox.Text;
            string searchByNameOfShipper      = наименование_поставщикаTextBox.Text;
            string searchByIdOfProduct        = код_товараTextBox.Text;
            string searchByNameOfProduct      = наименование_товараTextBox.Text;
            string searchByDeliveryDate       = дата_заказаDatePicker.Text;

            var order = from orders in App.Context.заказы
                        select orders;

            order = order.Where(ord => ord.ттн.Contains(searchByIdOfTTN));
            order = order.Where(ord => ord.код_заказа.Contains(searchByIdOfOrder));
            order = order.Where(ord => ord.код_контрагента.Contains(searchByIdOfCounterparty));
            order = order.Where(ord => ord.наименование_контрагента.Contains(searchByNameOfCounterparty));
            order = order.Where(ord => ord.код_поставщика.Contains(searchByIdOfShipper));
            order = order.Where(ord => ord.наименование_поставщика.Contains(searchByNameOfShipper));
            order = order.Where(ord => ord.код_товара.Contains(searchByIdOfProduct));
            order = order.Where(ord => ord.наименование_товара.Contains(searchByNameOfProduct));

            OrdersWIndow.ordViewSource.Source = order.ToList();

            if (дата_заказаDatePicker.Text.Length > 0)
            {
                using (var db = new movement_of_goodsEntities())
                {
                    var tempSearchByDeliveryDate = DateTime.Parse(searchByDeliveryDate);
                    var filteredData             = db.заказы.Where(t => t.дата_заказа == tempSearchByDeliveryDate);
                    OrdersWIndow.ordViewSource.Source = filteredData.ToList();
                }
            }
        }