private static Descriptions CreatingDescriptionObjectFromEntryForm(EntryFormDescription entryForm) { Descriptions newDescription = new Descriptions(); newDescription.String = entryForm.textBoxString.Text; newDescription.ProjectsProjectID = int.Parse(entryForm.textBoxProjectID.Text); return newDescription; }
public void AddToDescriptions() { using (var contex = new BusinessCodingModelContex()) { Descriptions tmp = new Descriptions(); tmp.String = "testUnit"; var restult = from x in contex.Projects where x.Name == "Nowy iOS" select x; tmp.ProjectsProjectID = restult.First().ProjectID; contex.Descriptions.Add(tmp); } }
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; } } }
public EntryFormDescription(Descriptions _descriptions) { InitializeComponent(); this.DataContext = _descriptions; this.textBoxDescriptionID.Text = _descriptions.DescriptionID.ToString(); }