예제 #1
0
        private void ButtonEditOrder_Click(object sender, RoutedEventArgs e)
        {
            FuncOrders1_Result selectedRow = new FuncOrders1_Result();

            selectedRow = (FuncOrders1_Result)this.DataGridOrders.SelectedItems[0];
            new EditORder(context, selectedRow).ShowDialog();
            RefreshWindow();
        }
예제 #2
0
        private void RemoveOrder_Click(object sender, RoutedEventArgs e)
        {
            FuncOrders1_Result selectedRow = new FuncOrders1_Result();

            selectedRow = (FuncOrders1_Result)this.DataGridOrders.SelectedItems[0];

            TableOrders rowForDel = new TableOrders();

            rowForDel = (from c in context.TableOrders where c.Id == selectedRow.id select c).First();

            context.TableOrders.Remove(rowForDel);
            context.SaveChanges();
            RefreshWindow();
        }
예제 #3
0
        public EditORder(CarRentalCenterDBEntities context_inpt, FuncOrders1_Result selectedRow_inpt)
        {
            InitializeComponent();
            this.context = context_inpt;

            this.selectedRow = selectedRow_inpt;
            this.context     = context_inpt;

            this.LabelAmountCurr.Content  = selectedRow.Amount.ToString();
            this.LabelCarCurr.Content     = selectedRow_inpt.Maker + selectedRow_inpt.Model;
            this.LabelDateCurr.Content    = selectedRow_inpt.Date;
            this.LabelPersonCurr1.Content = selectedRow_inpt.FirstName + selectedRow_inpt.LastName;

            this.LabelStatusCurr.Content = selectedRow_inpt.Status;

            this.ComboBoxEditStatus.ItemsSource       = (from c in context.TableStatus select c).ToArray();
            this.ComboBoxEditStatus.DisplayMemberPath = "Status";
        }