Beispiel #1
0
        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);
        }
Beispiel #2
0
        /// <summary>
        /// 筛选区域初始化
        /// </summary>
        public virtual void SogConditionInit()
        {
            SogDiv SogCondition = new SogDiv();

            SogCondition.CssClass = "SogCondition";
            G_SogCondition        = SogCondition;
            Form.Controls.Add(SogCondition);

            SogDiv open = new SogDiv();

            open.CssClass = "open";
            open.Attributes.Add("style", "display: none;");
            SogCondition.Controls.Add(open);

            foreach (SYS_COLUMNS c in COLUMNS_SEARCH)
            {
                if (!string.IsNullOrEmpty(c.SC_CONTROL_DATA))
                {
                    condition_item obj_ci = new condition_item();
                    obj_ci.ID          = "search_" + c.SC_COLUMN_NAME;
                    obj_ci.HeadText    = c.SC_COLUMN_DESC;
                    obj_ci.target      = c.SC_COLUMN_NAME;
                    obj_ci.DataSource  = GetControlData(c.SC_CONTROL_DATA);
                    obj_ci.IsShowEmpty = true;
                    open.Controls.Add(obj_ci);
                }
            }

            List <SYS_COLUMNS> list = COLUMNS_SEARCH.Where(o => string.IsNullOrEmpty(o.SC_CONTROL_DATA) == true).ToList();

            if (list.Count > 0)
            {
                SogDiv condition_item = new SogDiv();
                condition_item.CssClass = "condition_item";
                condition_item.Attributes.Add("style", "padding-left:100px");
                open.Controls.Add(condition_item);

                SogTextSearch obj_SogTextSearch = new SogTextSearch();

                StringBuilder placeholder = new StringBuilder();
                StringBuilder target      = new StringBuilder();
                foreach (SYS_COLUMNS c in list)
                {
                    placeholder.Append("/" + c.SC_COLUMN_DESC);
                    target.Append("," + c.SC_COLUMN_NAME);
                }
                obj_SogTextSearch.placeholder = placeholder.ToString().Substring(1);
                obj_SogTextSearch.target      = "SogText";
                obj_SogTextSearch.CssClass    = "SogText";
                obj_SogTextSearch.ID          = "btn_search";
                condition_item.Controls.Add(obj_SogTextSearch);
            }


            SogDiv close = new SogDiv();

            close.CssClass = "close";
            SogCondition.Controls.Add(close);


            SogDiv condition_head = new SogDiv();

            condition_head.CssClass  = "condition_head";
            condition_head.InnerText = "筛选条件";
            close.Controls.Add(condition_head);

            foreach (SYS_COLUMNS c in COLUMNS_SEARCH)
            {
                if (!string.IsNullOrEmpty(c.SC_CONTROL_DATA))
                {
                    condition_desc d = new condition_desc();
                    d.HeadText = c.SC_COLUMN_DESC;
                    d.ParentID = "search_" + c.SC_COLUMN_NAME;
                    close.Controls.Add(d);
                }
            }

            SogDiv handler = new SogDiv();

            handler.CssClass = "handler";
            SogCondition.Controls.Add(handler);

            SogIcon obj_i = new SogIcon();

            obj_i.CssClass = "small_btn fa fa-chevron-down";

            handler.Controls.Add(obj_i);
        }