public void loadEditRepairWindow(Client client = null, Device device = null) { textBox_NumberEditRepair.IsEnabled = false; textBox_DateEditRepair.IsEnabled = false; textBox_AddressEditRepair.IsEnabled = false; textBox_ContactEditRepair.IsEnabled = false; textBox_EmailEditRepair.IsEnabled = false; textBox_PhoneEditRepair.IsEnabled = false; this.client = client; this.device = device; //Load Repair number textBox_NumberEditRepair.Text = idRepair.ToString(); //Load Date textBox_DateEditRepair.Text = (sql.getDateByIdRepair(idRepair)).ToString(); LoadClients(); LoadCategories(); /* LoadBrandsByCategory(); * * * LoadModelByCategoryAndBrand();*/ LoadEngineers(); LoadStatusRepairs(); LoadTypesRepairs(); //get Repair // if (client == null && device == null) // { comboBox_nameClientEditRepair.Text = sql.getNameClientByIdRepair(idRepair); textsforTextboxes((Client)comboBox_nameClientEditRepair.SelectedItem); sql.getRepair(idRepair, repair); textBox_SNEditRepair.Text = repair.SN; textBox_DefectEditRepair.Text = repair.Defect; textBox_kitViewEditRepair.Text = repair.KitView; textBox_ResultEditRepair.Text = repair.Result; textBox_PriceEditRepair.Text = repair.Price.ToString(); comboBox_CategoriesEditRepair.Text = sql.getNameCategoryByIdModel(repair.IdModel); comboBox_BrandsEditRepair.Text = sql.getNameBrandByIdModel(repair.IdModel); comboBox_ModelsEditRepair.Text = sql.getNameModelByIdModel(repair.IdModel); comboBox_EngineerEditRepair.Text = sql.getEngineerById(repair.IdEngineer); comboBox_StatusRepairEditRepair.Text = sql.getStatusById(repair.IdStatus); comboBox_TypeRepairEditRepair.Text = sql.getTypeRepairById(repair.IdType); // } }