Ejemplo n.º 1
0
        private void ChangeContractButton_Click(object sender, RoutedEventArgs e)
        {
            if (contractListView.SelectedItem == null)
            {
                MessageBox.Show("errror");
                return;
            }
            Items             item         = (Items)contractListView.SelectedItem;
            AddContractWindow contractWind = new AddContractWindow(item.typeName, item.artistCategory, item.beginDate, item.endDate,
                                                                   item.OrderNum, item.Position);

            if (contractWind.ShowDialog() == false)
            {
                this.Visibility = Visibility.Visible;
                return;
            }
            contractListView.Items.Remove(contractListView.SelectedItem);
            contractListView.Items.Add(new Items
            {
                typeName       = contractWind.typeOfCon,
                beginDate      = (DateTime)contractWind.beginningDt,
                endDate        = (DateTime)contractWind.endDt,
                OrderNum       = contractWind.orderN,
                artistCategory = contractWind.artistCat,
                Position       = contractWind.posit
            });
            contractListView.Items.Refresh();
        }
Ejemplo n.º 2
0
        private void ChangeContractButton_Click(object sender, RoutedEventArgs e)
        {
            if (contractListView.SelectedItem == null)
            {
                MessageBox.Show("errror");
                return;
            }
            Items item = (Items)contractListView.SelectedItem;

            AddContractWindow contractWind = new AddContractWindow(contractTypeRepositoty.FindByID(item.contr.ContractTypeId).Name,
                                                                   artistCategoryRepositoty.FindByID(item.contr.ArtistCategoryId).Name,
                                                                   item.contr.BeginningDate, item.contr.EndDate,
                                                                   item.contr.OrderNum, item.contr.Position);

            this.Visibility = Visibility.Collapsed;
            if (contractWind.ShowDialog() == false)
            {
                this.Visibility = Visibility.Visible;
                return;
            }

            contractListView.Items.Remove(contractListView.SelectedItem);
            if (contractWind.DialogResult.HasValue && contractWind.DialogResult.Value)
            {
                Contract contract = item.contr;
                contract.ContractTypeId   = contractTypeRepositoty.Get(p => p.Name == contractWind.typeOfCon).First().ID;
                contract.BeginningDate    = (DateTime)contractWind.beginningDt;
                contract.EndDate          = (DateTime)contractWind.endDt;
                contract.WorkerId         = worker.ID;
                contract.OrderNum         = contractWind.orderN;
                contract.ArtistCategoryId = artistCategoryRepositoty.Get(p => p.Name == contractWind.artistCat).First().ID;
                contract.Position         = contractWind.posit;

                contractListView.Items.Add(new Items
                {
                    contr = contract
                });
            }

            this.Visibility = Visibility.Visible;

            contractListView.Items.Refresh();
        }
Ejemplo n.º 3
0
        private void AddContractButton_Click(object sender, RoutedEventArgs e)
        {
            AddContractWindow contractWind = new AddContractWindow(false);

            if (contractWind.ShowDialog() == false)
            {
                this.Visibility = Visibility.Visible;
                return;
            }

            contractListView.Items.Add(new Items
            {
                typeName       = contractWind.typeOfCon,
                beginDate      = (DateTime)contractWind.beginningDt,
                endDate        = (DateTime)contractWind.endDt,
                OrderNum       = contractWind.orderN,
                artistCategory = contractWind.artistCat,
                Position       = contractWind.posit
            });
            contractListView.Items.Refresh();
        }