Exemplo n.º 1
0
        protected ProductPrice addPrice(int MarketProductId, string Price, string Currency, DateTime date)
        {
            ProductPrice productPrice = new ProductPrice();

            productPrice.marketProcutId = MarketProductId;
            productPrice.Price          = Price;
            productPrice.Currency       = Currency;
            productPrice.Date           = date;
            ProductPrice temp = priceRepository.Add(productPrice);

            return(temp);
        }
Exemplo n.º 2
0
 private void AddIO()
 {
     for (int i = 0; i < incude_table.Rows.Count - 1; i++)
     {
         ioRepos.Add(
             dateTimePicker.Text,
             //num_doc_textbox.Text,
             //Convert.ToInt64(incude_table.Rows[i].Cells[2].Value),//count
             Convert.ToDouble(incude_table.Rows[i].Cells[2].Value), //prece
             Convert.ToInt64(org_combox.SelectedValue),             //org
             Convert.ToInt64(incude_table.Rows[i].Cells[0].Value),  //product
             Convert.ToInt64(incude_table.Rows[i].Cells[3].Value)); //edizm
     }
 }
        public async Task <IActionResult> PostPrice([FromBody] PriceDTO priceDTO)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var price = await priceRepository.Add(priceDTO);

            if (price == null)
            {
                return(BadRequest());
            }

            PriceDTO dto = new PriceDTO();

            dto.PriceId     = price.PriceId;
            dto.designation = price.designation;
            dto.price       = price.price;
            dto.date        = price.date.ToString("yyyy-MM-dd");

            return(CreatedAtAction("GetPrice", dto));
        }