//显示全路径名称 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)); } }
private void addNewRowToDT(DataTable toInsertDT, DataRow nodeRow, List <string> updateCols, S_DOC_Space space, S_DOC_Node nodeConfig) { var newRow = toInsertDT.NewRow(); newRow["ID"] = FormulaHelper.CreateGuid(); newRow["CreateDate"] = DateTime.Now; newRow["ModifyDate"] = DateTime.Now; newRow["CreateUserID"] = this.CurrentUserInfo.UserID; newRow["CreateUser"] = this.CurrentUserInfo.UserName; newRow["ModifyUserID"] = this.CurrentUserInfo.UserID; newRow["ModifyUser"] = this.CurrentUserInfo.UserName; newRow["OrgID"] = this.CurrentUserInfo.UserOrgID; newRow["CompanyID"] = this.CurrentUserInfo.UserCompanyID; newRow["State"] = IdentifyState.Create.ToString(); newRow["SpaceID"] = space.ID; newRow["SpaceName"] = space.Name; newRow["NodeID"] = nodeRow["ID"].ToString(); newRow["ConfigID"] = nodeConfig.ID; newRow["DataType"] = nodeConfig.Name; newRow["KeepYearToToday"] = GetKeepYearToToday(Convert.ToDateTime(nodeRow["ArchiveDate"])); foreach (var item in updateCols) { newRow[item] = nodeRow[item]; } toInsertDT.Rows.Add(newRow); }
private string renderSelectorScipts(S_DOC_Node node) { var baseEntities = FormulaHelper.GetEntities <Base.Logic.Domain.BaseEntities>(); StringBuilder sb = new StringBuilder(); var fields = node.S_DOC_NodeAttr.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.AttrField, returnParams, ""); } else { sb.AppendFormat("addSingleUserSelector('{0}',{{returnParams:'{1}',UrlParams:'{2}'}});\n", field.AttrField, returnParams, ""); } } else if (field.SelectorKey == "SystemOrg") { if (field.MultiSelect == "True") { sb.AppendFormat("addMultiOrgSelector('{0}',{{returnParams:'{1}',UrlParams:'{2}'}});\n", field.AttrField, returnParams, ""); } else { sb.AppendFormat("addSingleOrgSelector('{0}',{{returnParams:'{1}',UrlParams:'{2}'}});\n", field.AttrField, 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.AttrName + "】失败"); } 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.AttrField, url, selector.Title, selector.Width, selector.Height, returnParams); } } return(sb.ToString()); }