Exemplo n.º 1
0
        public void AddToTypesOfOffices()
        {
            using (var context = new BusinessCodingModelContex())
            {
                TypesOfOffices tmp = new TypesOfOffices();

                tmp.Capacity = 10;
                tmp.CostOfHiring = 10;
                tmp.Name = "testUnit";

                context.TypesOfOffices.Add(tmp);
            }
        }
Exemplo n.º 2
0
        private void dataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (newSelectedItem > 0)
            {
                if (selectedTable == "Users")
                {
                    selectedUser = ((DataGrid)sender).SelectedItem as Users;
                    buttonModify.IsEnabled = true;
                    buttonDelete.IsEnabled = true;
                }

                else if (selectedTable == "Description")
                {
                    selectedDesciption = ((DataGrid)sender).SelectedItem as Descriptions;
                    buttonModify.IsEnabled = true;
                    buttonDelete.IsEnabled = true;
                }

                else if (selectedTable == "TypesOfEmployees")
                {
                    selectedTypesOfEmployee = ((DataGrid)sender).SelectedItem as TypesOfEmployees;
                    buttonModify.IsEnabled = true;
                    buttonDelete.IsEnabled = true;
                }

                else if (selectedTable == "Projects")
                {
                    selectedProject = ((DataGrid)sender).SelectedItem as Projects;
                    buttonModify.IsEnabled = true;
                    buttonDelete.IsEnabled = true;
                }

                else if (selectedTable == "TypesOfOffices")
                {
                    selectedTypesOfOffice = ((DataGrid)sender).SelectedItem as TypesOfOffices;
                    buttonModify.IsEnabled = true;
                    buttonDelete.IsEnabled = true;
                }

                else if (selectedTable == "Employees")
                {
                    selectedEmpolyee = ((DataGrid)sender).SelectedItem as Empolyees;
                    buttonModify.IsEnabled = true;
                    buttonDelete.IsEnabled = true;
                }

                else if (selectedTable == "Companies")
                {
                    selectedCompany = ((DataGrid)sender).SelectedItem as Companies;
                    buttonModify.IsEnabled = true;
                    buttonDelete.IsEnabled = true;
                }
                if (newSelectedItem == 2)
                {
                    buttonModify.IsEnabled = false;
                    buttonDelete.IsEnabled = false;
                    newSelectedItem = 1;
                }
            }
        }
Exemplo n.º 3
0
        private static TypesOfOffices CreatingTypesOfOfficesObjectFromEntryForm(EntryFormTypeOfOffice entryForm)
        {
            TypesOfOffices too = new TypesOfOffices();

            too.Capacity = short.Parse(entryForm.textBoxCapacity.Text);
            too.CostOfHiring = double.Parse(entryForm.textBoxCostOfHiring.Text);
            too.Name = entryForm.textBoxName.Text;
            return too;
        }
 public EntryFormTypeOfOffice(TypesOfOffices _typesOfOffices)
 {
     InitializeComponent();
     this.DataContext = _typesOfOffices;
     this.textBoxTOOfficeID.Text = _typesOfOffices.TOOfficeID.ToString();
 }