Exemple #1
0
 protected void AddAttachmentsControl(Table table, List <string> types)
 {
     foreach (var file in types)
     {
         var fileRow = new TableRow();
         var fileCell = new TableCell(); var fileCtrlCell = new TableCell();
         fileCtrlCell.ColSpan = 3;
         fileCtrlCell.Style   = "padding-right:40px;";
         fileCell.InnerText   = "文件";
         if (file == "MainFile")
         {
             fileCell.InnerText = "文件";
         }
         else if (file == "PdfFile")
         {
             fileCell.InnerText = "PDF文件";
         }
         else if (file == "PlotFile")
         {
             fileCell.InnerText = "Plot文件";
         }
         else if (file == "XrefFile")
         {
             fileCell.InnerText = "引用文件";
         }
         else if (file == "DwfFile")
         {
             fileCell.InnerText = "Dwf文件";
         }
         else if (file == "TiffFile")
         {
             fileCell.InnerText = "Tiff文件";
         }
         else if (file == "SignPdfFile")
         {
             fileCell.InnerText = "盖章PDF文件";
         }
         else if (file == "Attachments")
         {
             fileCell.InnerText = "其它附件";
         }
         if (file == "Attachments")
         {
             var fControl = new MiniFileMulti(file);
             fControl.Src = "DocSystem";
             fileCtrlCell.AddControl(fControl);
         }
         else
         {
             var fControl = new MiniFileSingle(file);
             fControl.Src = "DocSystem";
             fileCtrlCell.AddControl(fControl);
         }
         fileRow.AddControl(fileCell); fileRow.AddControl(fileCtrlCell);
         table.AddControl(fileRow);
     }
 }
Exemple #2
0
        public IControl GetQueryForm()
        {
            var form      = new Form(); form.ID = "queryForm";
            var queryList = this.S_DOC_Space.S_DOC_ListConfig.FirstOrDefault(d => d.RelationID == this.ID).S_DOC_QueryParam.OrderBy(d => d.QuerySort).ToList();
            var table     = ControlGenrator.CreateDefaultQueryFormTable();

            for (int i = 0; i < queryList.Count; i++)
            {
                var query = queryList[i];
                if (i % 3 == 0)
                {
                    var row = new TableRow();
                    table.AddControl(row);
                }
                var currentRow = table.Rows.LastOrDefault();
                var cell       = new TableCell();
                cell.InnerText = query.AttrName;
                cell.Style     = " text-align: center; ";
                var contronCell = new TableCell();
                contronCell.AddControl(query.GetCtontrol());
                currentRow.AddControl(cell); currentRow.AddControl(contronCell);
            }
            form.AddControl(table);
            return(form);
        }
Exemple #3
0
        public IControl GetEditForm()
        {
            var form = new Form();

            form.Style = "padding-left: 11px; padding-top: 5px;";
            var idHidden       = new MiniHidden("ID"); form.AddControl(idHidden);
            var parentIDHidden = new MiniHidden("ParentID"); form.AddControl(parentIDHidden);

            foreach (var attr in this.S_DOC_NodeAttr.Where(d => d.Visible == "False").ToList())
            {
                var hidden = new MiniHidden(attr.AttrField); form.AddControl(hidden);
            }
            var  table     = ControlGenrator.CreateDefaultFormTable();
            bool changeRow = true;

            foreach (var attr in this.S_DOC_NodeAttr.Where(d => d.Visible == "True").OrderBy(d => d.AttrSort).ToList())
            {
                if (attr.IsFullRow)
                {
                    var row  = new TableRow();
                    var cell = new TableCell();
                    cell.InnerText = attr.AttrName;
                    row.AddControl(cell);
                    var ctrlCell = new TableCell(); ctrlCell.ColSpan = 3;
                    ctrlCell.Style = "padding-right:40px;";
                    var control = attr.GetCtontrol();
                    ctrlCell.AddControl(control);
                    row.AddControl(ctrlCell);
                    table.AddControl(row); changeRow = true;
                }
                else
                {
                    var cell = new TableCell();
                    cell.InnerText = attr.AttrName;
                    var ctrlCell = new TableCell();
                    ctrlCell.Style = "padding-right:40px;";
                    var control = attr.GetCtontrol();
                    ctrlCell.AddControl(control);
                    if (changeRow)
                    {
                        var row = new TableRow();
                        row.AddControl(cell); row.AddControl(ctrlCell);
                        table.AddControl(row);
                        changeRow = false;
                    }
                    else
                    {
                        var row = table.Rows.LastOrDefault();
                        row.AddControl(cell); row.AddControl(ctrlCell);
                        changeRow = true;
                    }
                }
            }
            form.AddControl(table);
            return(form);
        }
Exemple #4
0
        public IControl GetEditForm(bool showAttachment = true, bool isUpVersion = false)
        {
            var form = new Form();

            form.Style = "padding-left: 11px; padding-top: 5px;";
            var idHidden     = new MiniHidden("ID"); form.AddControl(idHidden);
            var nodeIDHidden = new MiniHidden("NodeID"); form.AddControl(nodeIDHidden);

            foreach (var attr in this.S_DOC_FileAttr.Where(d => d.Visible == "False").ToList())
            {
                var hidden = new MiniHidden(attr.FileAttrField);
                form.AddControl(hidden);
            }
            var AllType     = new string[] { "MainFile", "PdfFile", "PlotFile", "XrefFile", "DwfFile", "TiffFile", "SignPdfFile", "Attachments" };
            var archiveType = System.Configuration.ConfigurationManager.AppSettings["ArchiveType"];
            var ArchiveType = (string.IsNullOrEmpty(archiveType) ? "PdfFile" : archiveType).Split(',').ToList();
            var ShowType    = new List <string>();

            foreach (var type in AllType)
            {
                if (showAttachment && (type == "MainFile" || type == "Attachments" || ArchiveType.Contains(type)))
                {
                    ShowType.Add(type);
                }
                else
                {
                    var hidden = new MiniHidden(type);
                    form.AddControl(hidden);
                }
            }

            var  table     = ControlGenrator.CreateDefaultFormTable();
            bool changeRow = true;

            foreach (var attr in this.S_DOC_FileAttr.Where(d => d.Visible == "True").OrderBy(d => d.AttrSort).ToList())
            {
                if (attr.IsFullRow)
                {
                    var row  = new TableRow();
                    var cell = new TableCell();
                    cell.InnerText = attr.FileAttrName;
                    row.AddControl(cell);
                    var ctrlCell = new TableCell(); ctrlCell.ColSpan = 3;
                    ctrlCell.Style = "padding-right:40px;";
                    var control = attr.GetCtontrol(isUpVersion);
                    ctrlCell.AddControl(control);
                    row.AddControl(ctrlCell);
                    table.AddControl(row); changeRow = true;
                }
                else
                {
                    var cell = new TableCell();
                    cell.InnerText = attr.FileAttrName;
                    var ctrlCell = new TableCell();
                    var control  = attr.GetCtontrol(isUpVersion);
                    ctrlCell.Style = "padding-right:40px;";
                    ctrlCell.AddControl(control);
                    if (changeRow)
                    {
                        var row = new TableRow();
                        row.AddControl(cell); row.AddControl(ctrlCell);
                        table.AddControl(row);
                        changeRow = false;
                    }
                    else
                    {
                        var row = table.Rows.LastOrDefault();
                        row.AddControl(cell); row.AddControl(ctrlCell);
                        changeRow = true;
                    }
                }
            }
            if (showAttachment)
            {
                AddAttachmentsControl(table, ShowType);
            }

            form.AddControl(table);
            return(form);
        }