/// <summary> /// Update list of document /// </summary> /// <returns></returns> private async Task <ObservableCollection <DocModel> > UpdateDocsAsync() { var collec = DocsModel.ToList(); DocsModel = null; ObservableCollection <DocModel> tcollect = new ObservableCollection <DocModel>(collec); return(tcollect); }
/// <summary> /// Filter the documents by status and update the view /// </summary> /// <returns></returns> private async Task ValidateFilters() { ObservableCollection <DocModel> saveList = new ObservableCollection <DocModel>(); if (!string.IsNullOrEmpty(SearchText)) { saveList = await FilterWithSearchText(saveList); } else { saveList = await FilterWithEmptySearchText(saveList); } DocsModel = saveList; NumberDocuments = DocsModel.Count(); }
public ActionResult Doc() { //this.Init(); ViewBag.MenuItem = "doc"; DocsModel docsModel = new DocsModel(); docsModel.Docs = db.Docs.Where(d => d.CustID == Cust.CustId).OrderByDescending(a => a.Ddat).Take(10).ToList(); docsModel.IsCustom = false; if (!String.IsNullOrWhiteSpace(Cust.Cod1s)) { docsModel.IsCustom = true; docsModel.CustomInfo = db.CustomInfos.FirstOrDefault(d => d.Cod1s == Cust.Cod1s); } return(View(docsModel)); }