private string GenerateToolTip(FileItDocument d, FileItCabinet c) { var sb = new System.Text.StringBuilder(); d.IndexInformation.Keys.ToList().ForEach(k => { sb.Append(c.Template.TemplateDefinitions.Single(td => td.INDEXNUM == k).INDEXNAME + " = " + d.IndexInformation[k] + Environment.NewLine); }); return(sb.ToString()); }
public FileItCabinet GetCabinet(string user, string pass, string cabinetId) { FileItCabinet response = null; using (var db = new FileItDataLayer.Models.SystemFileitEntities()) { var userObj = db.USERS.FirstOrDefault(u => u.USERNAME.Equals(user, StringComparison.CurrentCultureIgnoreCase)); if (userObj != null && userObj.Authenticate(pass)) { var cabinet = db.CABINETS.Single(c => c.CABINETID.Equals(cabinetId)); var def = new List <FileItTemplateDefinition>(); var template = new FileItTemplate(); template.ConvertFromTEMPLATE(cabinet.Template); response = new FileItCabinet() { CabinetId = cabinet.CABINETID, CabinetName = cabinet.CABINETNAME, Template = template }; } } return(response); }