private void GenerateTabItem() { DatabaseHandle dbHandle = new DatabaseHandle(); string tabJson = dbHandle.GetListOfSection(); List <SectionModel> lstSectionModel = JsonConvert.DeserializeObject <List <SectionModel> >(tabJson); for (int i = 0; i < lstSectionModel.Count; i++) { TabItem ti = new TabItem(); ti.Header = lstSectionModel[i].Name; ti.Name = lstSectionModel[i].Name + lstSectionModel[i].SectionID.ToString(); ti.Width = 100; ti.Height = 50; Grid grid = new Grid(); grid.Name = "section" + lstSectionModel[i].Name; grid.AllowDrop = true; Button btnTest = new Button(); btnTest.Name = "btnTest3"; btnTest.Margin = new Thickness(195, 113, 0, 0); btnTest.Width = 100; btnTest.Height = 100; grid.Children.Add(btnTest); ti.Content = grid; tcTable.Items.Insert(tcTable.Items.Count - 1, ti); } }
private void InitializeGlobalHelper() { DatabaseHandle dbHandle = new DatabaseHandle(); GlobalHelper.SectionDetail = JsonConvert.DeserializeObject <List <SectionModel> >(dbHandle.GetListOfSection()); GlobalHelper.TableDetail = JsonConvert.DeserializeObject <List <TableModal> >(dbHandle.GetListTable()); GlobalHelper.LocationMenuDetail = JsonConvert.DeserializeObject <List <LocationMenuModel> >(dbHandle.GetListLocationMenu()); GlobalHelper.LocationTabDetail = JsonConvert.DeserializeObject <List <LocationTabModel> >(dbHandle.GetListOfLocationTab()); }