private void Button_Click(object sender, RoutedEventArgs e) { try { Model1 db = new Model1(); int a = Convert.ToInt32(idtxt.Text); var orderr = db.Orders .Where(c => c.id_order == a) .FirstOrDefault(); orderr.order_status = Convert.ToInt32(LogicStatus.GetIdStatus(status.Text)); orderr.client = Convert.ToInt32(LogicClient.GetIdClient(client.Text)); orderr.master = Convert.ToInt32(LogicMaster.GetIdMaster(master.Text)); orderr.date_of_acceptance = accept.DisplayDate; orderr.date_of_return = @return.DisplayDate; orderr.cost = Convert.ToInt32(price.Text); orderr.description = description.Text; db.SaveChanges(); MessageBox.Show("Заказ изменён!"); ViewOrderMaster vo = new ViewOrderMaster(); vo.Show(); Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void MenuItem_Click_5(object sender, RoutedEventArgs e) { ViewOrderMaster vo = new ViewOrderMaster(); vo.Show(); Close(); }
private void Button_Click_1(object sender, RoutedEventArgs e) { ViewOrderMaster vo = new ViewOrderMaster(); vo.Show(); Close(); }