Exemple #1
0
 private void dgSales_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (dgSales.SelectedItem != null)
     {
         int          SaleID = (dgSales.SelectedItem as Sale).ID;
         SaleEditView v      = new SaleEditView(SaleID);
         v.ShowDialog();
     }
 }
Exemple #2
0
        public JsonResult Edit([Bind(Include = "Id,ClientId,ProductId,SellerId,Cost,Date")] SaleEditView saleEdit)
        {
            if (!ModelState.IsValid)
            {
                return(Json(new { result = false, message = "Invalid data" }));
            }

            var saleForUpdate = Mapper.Map <Sale>(saleEdit);

            try
            {
                saleService.EditSale(saleForUpdate);
                return(Json(new { result = true }));
            }
            catch (Exception e)
            {
                return(Json(new { result = false, message = e.Message }));
            }
        }