public void LayoutTable(string id, string tableid) { m_TableID = tableid; m_TempleteID = id; Test_Table_Templete tabletemplete = SystemManager.Instance.Services.Test_Table_TempleteService.GetModel(int.Parse(id)); List <Test_Field_Templete> Fieldtempletelist = SystemManager.Instance.Services.Test_Field_TempleteService.GetModelList("F_PID=" + id); Test_Table testTable = SystemManager.Instance.Services.Test_TableService.GetModel(int.Parse(tableid)); List <Library.Model.Test_Field> testFields = SystemManager.Instance.Services.Test_FieldService.GetModelList("F_PID=" + tableid); if (!string.IsNullOrEmpty(tabletemplete.F_Banner)) { Banner_1_Edit bannerEdit = new Banner_1_Edit(); bannerEdit.LoadTemplete(tabletemplete); bannerEdit.LoadData(testTable); XGrid.Children.Add(bannerEdit); m_BannerEdit = bannerEdit; } m_Control = new GridAutoControl(); m_Control.LayoutEditGrid(tabletemplete, Fieldtempletelist); m_Control.LoadData(testFields); XGrid.Children.Add(m_Control); }
internal void LoadData(List <Library.Model.Test_Table> tables, double time) { Index = 0; lc.Clear(); lg.Clear(); ntime = time; foreach (Library.Model.Test_Table t in tables) { Test_Table_Templete tabletemplete = SystemManager.Instance.Services.Test_Table_TempleteService.GetModel(t.F_TempleteID.Value); Color c = tabletemplete.ShowBackColor; DataGridShow grid = new DataGridShow(); grid.MouseLeftButtonDown += new MouseButtonEventHandler(grid_MouseLeftButtonDown); grid.LoadData(t.F_TempleteID.Value, t.F_ID); lc.Add(c); lg.Add(grid); } Timer.Interval = TimeSpan.FromSeconds(time); Timer.Tick += new EventHandler(Timer_Tick); Timer.Start(); this.Frame1.Source = lg[Index]; this.Background = new SolidColorBrush(lc[Index]); Index++; }
public void LoadData(int templeteid, int id) { Test_Table_Templete tabletemplete = SystemManager.Instance.Services.Test_Table_TempleteService.GetModel(templeteid); List <Test_Field_Templete> Fieldtempletelist = SystemManager.Instance.Services.Test_Field_TempleteService.GetModelList("F_PID=" + templeteid); Test_Table testTable = SystemManager.Instance.Services.Test_TableService.GetModel(id); List <Library.Model.Test_Field> testFields = SystemManager.Instance.Services.Test_FieldService.GetModelList("F_PID=" + id); TextBlock txtBander = new TextBlock(); string[] values = testTable.F_BannerContent.Split('$'); txtBander.FontSize = double.Parse(tabletemplete.F_ShowFontSize.ToString()); txtBander.Foreground = new SolidColorBrush(tabletemplete.ShowFontColor); txtBander.Margin = new Thickness(0, 10, 0, 10); foreach (string value in values) { if (string.IsNullOrEmpty(value)) { txtBander.Text += "--- "; } else { txtBander.Text += value + " "; } } XGrid.Children.Add(txtBander); GridAutoControl m_Control = new GridAutoControl(); m_Control.LayoutShowGrid(tabletemplete, Fieldtempletelist, testFields); XGrid.Children.Add(m_Control); }
public void LoadData(int templeteid, int id) { Test_Table_Templete tabletemplete = SystemManager.Instance.Services.Test_Table_TempleteService.GetModel(templeteid); scrolls.Background = new SolidColorBrush(tabletemplete.ShowBackColor); DataGridShow grid = new DataGridShow(); grid.LoadData(templeteid, id); scrolls.Content = grid; }
void m_TreeControl_NodeClick(TreeNodeInfo t) { if (t.Tag != null) { tmepmodel = SystemManager.Instance.Services.Test_Table_TempleteService.GetModel(int.Parse(t.ID)); F_ShowWidth.Text = tmepmodel.F_ShowWidth.Value.ToString(); F_ShowHeight.Text = tmepmodel.F_ShowHeight.Value.ToString(); F_ShowFontSize.Text = tmepmodel.F_ShowFontSize.Value.ToString(); F_ShowBorderColor.Text = tmepmodel.F_ShowBorderColor; F_ShowFontColor.Text = tmepmodel.F_ShowFontColor; F_ShowBackColor.Text = tmepmodel.F_ShowBackColor; } }
public void LayoutShowGrid(Test_Table_Templete tabletemplete, List <Test_Field_Templete> Fieldtempletelist, List <Library.Model.Test_Field> testFields) { GridFrame.BorderBrush = new SolidColorBrush(tabletemplete.ShowBorderColor); if (tabletemplete.F_ShowWidth != null) { GridFrame.MinWidth = double.Parse(tabletemplete.F_ShowWidth.Value.ToString()); } if (tabletemplete.F_ShowHeight != null) { GridFrame.MinHeight = double.Parse(tabletemplete.F_ShowHeight.Value.ToString()); } for (int r = 0; r < tabletemplete.F_RowCount; r++) { RowDefinition rowdef = new RowDefinition(); rowdef.Height = new GridLength(1, GridUnitType.Star); GridAuto.RowDefinitions.Add(rowdef); } for (int c = 0; c < tabletemplete.F_ColunmCount; c++) { ColumnDefinition coldef = new ColumnDefinition(); coldef.Width = new GridLength(1, GridUnitType.Star); GridAuto.ColumnDefinitions.Add(coldef); } Dictionary <string, string> dic = new Dictionary <string, string>(); foreach (Library.Model.Test_Field f in testFields) { dic.Add(f.F_RowIndex + "_" + f.F_ColIndex, f.F_Value); } foreach (Test_Field_Templete field in Fieldtempletelist) { string sKey = field.F_RowIndex + "_" + field.F_ColIndex; if (dic.ContainsKey(sKey)) { field.F_Value = dic[sKey]; } GridAutoItemText item = new GridAutoItemText(); item.LayoutShowField(tabletemplete, field); GridAuto.Children.Add(item); } }
public void LayoutEditGrid(Test_Table_Templete tabletemplete, List <Test_Field_Templete> Fieldtempletelist) { m_Fields = new List <GridAutoItemValue>(); if (tabletemplete.F_DefineWidth != null) { GridFrame.MinWidth = double.Parse(tabletemplete.F_DefineWidth.Value.ToString()); } if (tabletemplete.F_DefineHeight != null) { GridFrame.MinHeight = double.Parse(tabletemplete.F_DefineHeight.Value.ToString()); } for (int r = 0; r < tabletemplete.F_RowCount; r++) { RowDefinition rowdef = new RowDefinition(); rowdef.Height = new GridLength(1, GridUnitType.Star); GridAuto.RowDefinitions.Add(rowdef); } for (int c = 0; c < tabletemplete.F_ColunmCount; c++) { ColumnDefinition coldef = new ColumnDefinition(); coldef.Width = new GridLength(1, GridUnitType.Star); GridAuto.ColumnDefinitions.Add(coldef); } foreach (Test_Field_Templete field in Fieldtempletelist) { if (field.F_Type.Equals(0)) { GridAutoItemText item = new GridAutoItemText(); item.LayoutEditField(tabletemplete, field); GridAuto.Children.Add(item); } else { GridAutoItemValue item = new GridAutoItemValue(); item.LayoutField(tabletemplete, field); GridAuto.Children.Add(item); item.Tag = field; m_Fields.Add(item); } } }
public void LoadTemplete(Test_Table_Templete tabletemplete) { this.MinWidth = double.Parse(tabletemplete.F_DefineWidth.Value.ToString()); this.MinHeight = tabletemplete.F_DefineHeight.Value * 1.0 / tabletemplete.F_RowCount.Value; Panels.Children.Clear(); string[] Inputs = tabletemplete.F_Banner.Split('$'); index = 0; foreach (string input in Inputs) { if (input.StartsWith("{") && input.EndsWith("}")) { TextBox txtbox = new TextBox(); txtbox.Name = "txt" + index; txtbox.AcceptsReturn = true; txtbox.Text = input.Replace("{", "").Replace("}", ""); txtbox.MinWidth = 60; txtbox.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch; txtbox.Margin = new Thickness(0, 10, 0, 10); txtbox.VerticalContentAlignment = System.Windows.VerticalAlignment.Center; txtbox.VerticalAlignment = System.Windows.VerticalAlignment.Center; txtbox.FontSize = double.Parse(tabletemplete.F_DefineFontSize.Value.ToString()); Panels.Children.Add(txtbox); } else { TextBlock txtbox = new TextBlock(); txtbox.Name = "txt" + index; txtbox.Text = input; txtbox.HorizontalAlignment = System.Windows.HorizontalAlignment.Right; txtbox.Margin = new Thickness(10, 0, 0, 0); txtbox.VerticalAlignment = System.Windows.VerticalAlignment.Center; txtbox.FontSize = double.Parse(tabletemplete.F_DefineFontSize.Value.ToString()); Panels.Children.Add(txtbox); } index++; } }