private void btnSave_Click(object sender, EventArgs e) { try { if (!_isChanged) { return; } if (!ValidateModel()) { return; } SetModel(); if (_isAddNewMode) { _productPrice.Id = _productPriceService.Insert(_productPrice); } else { _productPriceService.Update(_productPrice); } LoadFormWithData(); MessageBox.Show(POSText.SaveMessage, MessageBoxCaptions.Success.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception exception) { MessageBox.Show(POSText.ErrorMessage, MessageBoxCaptions.Error.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public IHttpActionResult Put([FromODataUri] System.Guid key, [FromBody] ProductPrice entity) { logger.Trace("Call ProductPricesController Put"); var record = productPriceService.Update(entity); return(Updated(record)); }
public ActionResult Edit([Bind(Include = "Id,ProductId,DateOfPrice,PriceWithoutDiscount,PriceWithDiscount")] ProductPriceDto productPrice) { if (ModelState.IsValid) { _productPriceService.Update(productPrice); return(RedirectToAction("List")); } //ViewBag.ProductId = new SelectList(_productService.Get(), "Id", "Summary", productPrice.ProductId); return(View(productPrice)); }