Exemplo n.º 1
0
        private void updateButton_Click(object sender, EventArgs e)
        {
            try
            {
                _order.CustomerId = Convert.ToInt32(customerComboBox.SelectedValue);
                _order.ItemId     = Convert.ToInt32(itemComboBox.SelectedValue);

                DataTable searchOrderResult = _orderManager.SearchOrderById(_order);
                _order.ID = Convert.ToInt32(searchOrderResult.Rows[0]["ID"]);

                if (String.IsNullOrEmpty(quantityTextBox.Text))
                {
                    MessageBox.Show("Please Enter Quantity..!");
                    return;
                }
                _order.Quantity = Convert.ToInt32(quantityTextBox.Text);

                if (_orderManager.UpdateOrder(_order))
                {
                    showDataGridView.DataSource = _orderManager.Display();
                    MessageBox.Show("Updated Successfully...!");
                }
                else
                {
                    MessageBox.Show("Not Updated...!");
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
Exemplo n.º 2
0
        public async Task <JsonResult> UpdateOrderInfo(OrderInfoDto model)
        {
            IOrderInfoManager manager = new OrderInfoManager(new OrderInfoService());
            var result = await manager.UpdateOrder(model);

            if (result == 1)
            {
                _msg = new MsgResult()
                {
                    IsSuccess = true,
                    Info      = "修改成功"
                };
            }
            else
            {
                _msg = new MsgResult()
                {
                    IsSuccess = false,
                    Info      = "修改失败"
                };
            }
            return(Json(_msg));
        }