public IActionResult UpdateLocalizationLabel(Guid objectId, string columnName) { UpdateLocalizationLabelModel model = new UpdateLocalizationLabelModel { ObjectLabels = _localizedLabelService.Query(n => n.Where(f => f.ObjectColumnName == columnName && f.ObjectId == objectId)), Languages = _languageService.Query(n => n.Sort(s => s.SortAscending(f => f.Name))), ObjectColumnName = columnName, ObjectId = objectId }; return(View(model)); }
private void WrapLocalizedLabel(IList <Domain.Report> datas) { if (datas.NotEmpty()) { var ids = datas.Select(f => f.ReportId); var labels = _localizedLabelService.Query(n => n.Where(f => f.LanguageId == this._appContext.BaseLanguage && f.ObjectId.In(ids))); foreach (var d in datas) { d.Name = _localizedLabelService.GetLabelText(labels, d.ReportId, "LocalizedName", d.Name); d.Description = _localizedLabelService.GetLabelText(labels, d.ReportId, "Description", d.Description); } } }
private List <LocalizedLabel> GetLabels() { List <Guid> objectIds = new List <Guid>(); if (Form.Header != null && Form.Header.Rows.NotEmpty()) { //header foreach (var row in Form.Header.Rows) { foreach (var cell in row.Cells) { if (!cell.Id.Equals(Guid.Empty) && cell.Label.IsNotEmpty()) { objectIds.Add(cell.Id); } } } } if (Form.NavGroups.NotEmpty()) { //navs foreach (var navg in Form.NavGroups) { if (!navg.Id.Equals(Guid.Empty) && navg.Label.IsNotEmpty()) { objectIds.Add(navg.Id); } foreach (var item in navg.NavItems) { if (!item.Id.Equals(Guid.Empty) && item.Label.IsNotEmpty()) { objectIds.Add(item.Id); } } } } if (Form.Panels.NotEmpty()) { //tabs foreach (var tab in Form.Panels) { if (!tab.Id.Equals(Guid.Empty) && tab.Label.IsNotEmpty()) { objectIds.Add(tab.Id); } foreach (var sec in tab.Sections) { if (!sec.Id.Equals(Guid.Empty) && sec.Label.IsNotEmpty()) { objectIds.Add(sec.Id); } foreach (var row in sec.Rows) { foreach (var cell in row.Cells) { if (!cell.Id.Equals(Guid.Empty) && cell.Label.IsNotEmpty()) { objectIds.Add(cell.Id); } } } } } } if (Form.Footer != null && Form.Footer.Rows.NotEmpty()) { //footer foreach (var row in Form.Footer.Rows) { foreach (var cell in row.Cells) { if (!cell.Id.Equals(Guid.Empty) && cell.Label.IsNotEmpty()) { objectIds.Add(cell.Id); } } } } if (objectIds.NotEmpty()) { var labels = _localizedLabelService.Query(n => n.Where(f => f.LanguageId == this._user.UserSettings.LanguageId && f.ObjectId.In(objectIds))); return(labels); } return(null); }