예제 #1
0
        private void sklad_Click(object sender, RoutedEventArgs e)
        {
            furnitureSklad furnitureSklad = new furnitureSklad(IdUser);

            furnitureSklad.Show();
            this.Close();
        }
예제 #2
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            furnitureSklad furniture = new furnitureSklad(IdUser);

            furniture.Show();
            this.Close();
        }
예제 #3
0
        private void Exit_Click(object sender, RoutedEventArgs e)
        {
            clothSklad clothSkl = new clothSklad(IdUser);

            if (nameItem == "Ткань")
            {
                clothSkl.Show();
                this.Close();
            }
            else if (nameItem == "Фурнитура")
            {
                furnitureSklad furnitureSklad = new furnitureSklad(IdUser);
                furnitureSklad.Show();
                this.Close();
            }
        }
예제 #4
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string[] listFur = new string[4];


            for (int i = 0; i < postFur.Items.Count - 1; i++)
            {
                listFur = db.ArrayItem(i, dt);

                string art    = listFur[0];
                double width  = double.Parse(listFur[1]);
                double length = double.Parse(listFur[2]);
                double count  = double.Parse(listFur[3]);

                var select = db.kladFurniture.Where(kladFur => kladFur.furniture == art && kladFur.length == length && kladFur.width == width);

                if (select.Count() != 0)
                {
                    count += select.FirstOrDefault().count;
                    int Id = select.FirstOrDefault().Id;

                    kladFurniture update = db.kladFurniture.Find(Id);
                    update.count = count;
                    db.kladFurniture.Create();
                    db.SaveChanges();
                }
                else
                {
                    kladFurniture item = new kladFurniture();
                    item.furniture = art;
                    item.length    = length;
                    item.width     = width;
                    item.count     = count;
                    var insert = db.kladFurniture.Add(item);
                    db.SaveChanges();
                }
            }
            MessageBox.Show("Товары успешно добавлены на склад");
            furnitureSklad furnitureSklad = new furnitureSklad(IdUser);

            furnitureSklad.Show();
            this.Close();
        }
예제 #5
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string[] listfur = new string[4];

            for (int i = 0; i < dellist.Items.Count - 1; i++)
            {
                listfur = db.ArrayItem(i, dt);

                string art    = listfur[0];
                double width  = double.Parse(listfur[1]);
                double length = double.Parse(listfur[2]);
                int    count  = int.Parse(listfur[3]);

                var select = db.kladFurniture.Where(kladFur => kladFur.furniture == art && kladFur.length == length && kladFur.width == width);

                if (select.Count() != 0)
                {
                    int Id = select.FirstOrDefault().Id;

                    kladFurniture klad = db.kladFurniture.Find(Id);
                    if (klad.count >= count)
                    {
                        klad.count -= count;
                        db.kladFurniture.Create();
                        db.SaveChanges();
                        MessageBox.Show("Списание товаров прошло успешно");
                        furnitureSklad furnitureSklad = new furnitureSklad(IdUser);
                        furnitureSklad.Show();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("Запрошенного количества нет на складе");
                    }
                }
                else
                {
                    MessageBox.Show("Такого товара не существует");
                }
            }
        }