protected void bindMenu() { clientID = Core.SessionHelper.getClientId(); DataMenuItem letterSubMenuItem = null; List <ClientLetterTemplate> letterTemplates = LetterTemplateManager.GetAll(clientID); // get letters menu DataMenuItem letterMenu = topMenu.Items[2].Items[0]; if (letterTemplates != null && letterTemplates.Count > 0) { letterMenu.Items.Clear(); foreach (ClientLetterTemplate letterTemplate in letterTemplates) { letterSubMenuItem = new DataMenuItem(); letterSubMenuItem.ImageUrl = "~/Images/letter.png"; letterSubMenuItem.Key = "letter"; letterSubMenuItem.Text = letterTemplate.Description; letterSubMenuItem.Value = letterTemplate.TemplateID.ToString(); letterMenu.Items.Add(letterSubMenuItem); } } }
protected void bindData() { List <ClientLetterTemplate> templates = LetterTemplateManager.GetAll(clientID); gvLetter.DataSource = templates; gvLetter.DataBind(); }
protected void loadData() { List <ClientLetterTemplate> templates = null; int clientID = Core.SessionHelper.getClientId(); //int roleID = SessionHelper.getUserRoleId(); //if (roleID == (int)UserRole.Administrator) { // templates = LetterTemplateManager.GetAll(); //} //else if ((roleID == (int)UserRole.Client || roleID == (int)UserRole.SiteAdministrator) && clientID > 0) { // templates = LetterTemplateManager.GetAll(clientID); //} templates = LetterTemplateManager.GetAll(clientID); gvLetterTemplate.DataSource = templates; gvLetterTemplate.DataBind(); }