Exemplo n.º 1
0
        //显示全路径名称
        public string GetFinalFullPathName(string fileNodeID, string configID, string relateDocType, string fileNodeName)
        {
            var           docConfigEntities = Formula.FormulaHelper.GetEntities <DocConfigEntities>();
            S_DOC_Node    docNode           = null;
            S_DOC_File    docFile           = null;
            List <string> fullPathNameTemp  = new List <string>();

            if (relateDocType.ToLower().Equals("node"))
            {
                docNode = docConfigEntities.S_DOC_Node.FirstOrDefault(a => a.ID.Equals(configID));

                Dictionary <string, object> extentionJson = JsonHelper.ToObject(docNode.ExtentionJson);
                string UseFullName = extentionJson.ContainsKey("Ext_Car_UseFullName") ? extentionJson["Ext_Car_UseFullName"].ToString() : "";
                if (string.IsNullOrEmpty(UseFullName) || UseFullName.ToLower() != "true")//判断是否显示全路径
                {
                    return("");
                }
                fullPathNameTemp = GetFullPathName(docNode.SpaceID, fileNodeID);
                return(ReplaceFullPathName(extentionJson, fileNodeName, fullPathNameTemp));
            }
            else
            {
                docFile = docConfigEntities.S_DOC_File.FirstOrDefault(b => b.ID.Equals(configID));
                Dictionary <string, object> extentionJson = new Dictionary <string, object>();
                extentionJson = JsonHelper.ToObject(docFile.ExtentionJson);
                string UseFullName = extentionJson.ContainsKey("Ext_Car_UseFullName") ? extentionJson["Ext_Car_UseFullName"].ToString() : "";
                if (string.IsNullOrEmpty(UseFullName) || UseFullName.ToLower() != "true")
                {
                    return("");
                }
                fullPathNameTemp = GetFullPathName(docFile.SpaceID, fileNodeID);
                return(ReplaceFullPathName(extentionJson, fileNodeName, fullPathNameTemp));
            }
        }
Exemplo n.º 2
0
        private string renderSelectorScipts(S_DOC_File file)
        {
            var           baseEntities = FormulaHelper.GetEntities <Base.Logic.Domain.BaseEntities>();
            StringBuilder sb           = new StringBuilder();
            var           fields       = file.S_DOC_FileAttr.Where(d => d.InputType.IndexOf(ControlType.ButtonEdit.ToString()) >= 0)
                                         .ToList();

            foreach (var field in fields)
            {
                if (string.IsNullOrEmpty(field.SelectorKey))
                {
                    continue;
                }
                string returnParams = "value:ID,text:Name";
                if (!string.IsNullOrEmpty(field.ReturnParams))
                {
                    returnParams = field.ReturnParams;
                }
                if (field.SelectorKey == "SystemUser")
                {
                    if (field.MultiSelect == "True")
                    {
                        sb.AppendFormat("addMultiUserSelector('{0}',{{returnParams:'{1}',UrlParams:'{2}'}});\n", field.FileAttrField, returnParams, "");
                    }
                    else
                    {
                        sb.AppendFormat("addSingleUserSelector('{0}',{{returnParams:'{1}',UrlParams:'{2}'}});\n", field.FileAttrField, returnParams, "");
                    }
                }
                else if (field.SelectorKey == "SystemOrg")
                {
                    if (field.MultiSelect == "True")
                    {
                        sb.AppendFormat("addMultiOrgSelector('{0}',{{returnParams:'{1}',UrlParams:'{2}'}});\n", field.FileAttrField, returnParams, "");
                    }
                    else
                    {
                        sb.AppendFormat("addSingleOrgSelector('{0}',{{returnParams:'{1}',UrlParams:'{2}'}});\n", field.FileAttrField, returnParams, "");
                    }
                }
                else
                {
                    var selector = baseEntities.Set <Base.Logic.Domain.S_UI_Selector>().SingleOrDefault(c => c.Code == field.SelectorKey);
                    if (selector == null)
                    {
                        throw new Exception("选择器【" + field.SelectorKey + "】不存在,绘制选择器控件【" + field.FileAttrName + "】失败");
                    }
                    var url = selector.URLSingle;
                    if (field.MultiSelect == "True")
                    {
                        url = selector.URLMulti;
                    }
                    sb.AppendFormat("addSelector('{0}', '{1}', {{ allowResize: true,title:'{2}',width:'{3}',height:'{4}',returnParams:'{5}' }});\n"
                                    , field.FileAttrField, url, selector.Title, selector.Width, selector.Height, returnParams);
                }
            }
            return(sb.ToString());
        }