private void корзинаToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Hide();
            BasketForm basketForm = new BasketForm();

            basketForm.Show();
        }
Beispiel #2
0
        private void BasketButton_Click(object sender, EventArgs e)
        {
            DataFormDTO dto = new DataFormDTO(this, dataFormDTO.mainForm, dataFormDTO.db
                                              , dataFormDTO.userIdentity, dataFormDTO.userData);
            BasketForm form = new BasketForm(dto, basket);

            form.Show();
        }
Beispiel #3
0
        public IActionResult Post([FromBody] BasketForm form)
        {
            int customerId = (int)ControllerContext.RouteData.Values["CustomerId"];

            if (customerId == form.CustomerId)
            {
                return(Ok(_repository.Create(new Rental(form.CustomerId, form.FilmIds))));
            }

            return(BadRequest(new { Error = "Invalid Token" }));
        }
        private void doCrud()
        {
            switch (usage)
            {
            case FormUsage.OrderCar:
                // создание модели авто и самого авто
                // + заказ

                ViewCar car = crud.createModel(modelDTO);
                if (car != null)
                {
                    ShopBasket basket = new ShopBasket();

                    basket.AddItem(car.carId, car.company, car.modelName, car.power, car.colourName, car.autoTrans,
                                   car.manualTrans, modelDTO.price, Convert.ToInt32(RestCarTextBox.Text));

                    //
                    DataFormDTO dto = new DataFormDTO(this, dataFormDTO.mainForm, dataFormDTO.db,
                                                      dataFormDTO.userIdentity, dataFormDTO.userData);

                    BasketForm form = new BasketForm(dto, basket, true);
                    form.Show();
                }

                break;

            case FormUsage.Create:
                // создание модели авто и самого авто

                createCarModel();
                break;

            case FormUsage.Update:
                // обновление модели авто
                //getCarPrice();

                if (crud.update(modelDTO))
                {
                    MessageBox.Show("Car was updated!");
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Updating was denied");
                }

                break;
            }
        }
Beispiel #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            var form = new BasketForm();

            form.Show(this);
        }