public SogWebControl GetControl(SYS_COLUMNS c, string type) { SogWebControl cto = new SogWebControl(); if (c.SC_CONTROL_TYPE == "SogTextBox") { cto = new SogTextBox(); } if (c.SC_CONTROL_TYPE == "SOGDropDownList") { SOGDropDownList s = new SOGDropDownList(); s.DataSource = GetControlData1(c.SC_CONTROL_DATA); cto = s; } if (c.SC_CONTROL_TYPE == "SogTextArea") { SogTextArea s = new SogTextArea(); cto = s; } if (c.SC_CONTROL_TYPE == "SogFileUpload") { SogFileUpload s = new SogFileUpload(); cto = s; } if (c.SC_CONTROL_TYPE == "SogFolderUpload") { SogFolderUpload s = new SogFolderUpload(); cto = s; } if (c.SC_CONTROL_TYPE == "SogDate") { SogDate s = new SogDate(); s.CssClass += "SogDate"; cto = s; } if (c.SC_CONTROL_TYPE == "SogDateTime") { SogDateTime s = new SogDateTime(); s.CssClass += "SogDateTime"; cto = s; } cto.CssClass = "SogControl"; cto.ID = type + "_" + c.SC_COLUMN_NAME; cto.placeholder = c.SC_COLUMN_DESC; cto.target = c.SC_COLUMN_NAME; cto.rule = c.SC_RULE; cto.rule_desc = c.SC_RULE_DESC; return(cto); }
private void SogModalInit(List <SYS_COLUMNS> list_column, string type) { Dictionary <string, string> ht = new Dictionary <string, string>(); ht.Add("add", "新增"); ht.Add("edit", "编辑"); SogDiv SogModal = new SogDiv(); SogModal.CssClass = "SogModal"; SogModal.ID = "div_" + type; Form.Controls.Add(SogModal); SogDiv modal_title = new SogDiv(); modal_title.CssClass = "modal_title"; modal_title.InnerText = ht[type] + OBJECT.SO_ITEM_DESC; SogModal.Controls.Add(modal_title); SogIcon ic = new SogIcon(); ic.CssClass = "fa fa-times-circle SogRight CoverClose"; ic.Attributes.Add("aria-hidden", "true"); modal_title.Controls.Add(ic); SogDiv modal_content = new SogDiv(); modal_content.CssClass = "modal_content"; SogModal.Controls.Add(modal_content); foreach (SYS_COLUMNS c in list_column) { SogDiv modal_item = new SogDiv(); modal_item.CssClass = "modal_item"; modal_content.Controls.Add(modal_item); SogSpan modal_item_title = new SogSpan(); modal_item_title.InnerText = c.SC_COLUMN_DESC; modal_item_title.CssClass = "modal_item_title"; modal_item.Controls.Add(modal_item_title); SogDiv modal_item_content = new SogDiv(); modal_item_content.CssClass = "modal_item_content"; modal_item.Controls.Add(modal_item_content); SogWebControl txt = GetControl(c, type); modal_item_content.Controls.Add(txt); } SogDiv modal_function = new SogDiv(); modal_function.CssClass = "modal_function"; SogModal.Controls.Add(modal_function); SogSpan btn_full = new SogSpan(); btn_full.CssClass = "btn_full"; btn_full.InnerText = "提交"; btn_full.ID = "btn_" + type + "_save"; modal_function.Controls.Add(btn_full); SogSpan btn_empty = new SogSpan(); btn_empty.CssClass = "btn_empty CoverClose"; btn_empty.InnerText = "取消"; modal_function.Controls.Add(btn_empty); }