public static string getAlphByIndex(int index, int tid) { using (AskDBContent ddb = new AskDBContent()) { var askContents = (from o in ddb.AskContent where o.IndexNum < index && o.TopicId == tid select o).ToList(); return(AskTopic.AlphaList[askContents.Count]); } }
public static List <SelectListItem> GetAllAskPage() { if (AllAskPageSelect.Count != 0) { return(AllAskPageSelect); } AllAskPageSelect.Clear(); using (AskDBContent con = new AskDBContent()) { AllAskPageModel = con.AskPage.ToList(); } AllAskPageModel.ForEach(m => { SelectListItem item = new SelectListItem(); item.Text = m.Name + ""; item.Value = m.id + ""; AllAskPageSelect.Add(item); }); return(AllAskPageSelect); }