private void SearchOrders(WorkStationSearchViewModel model) { IList <SelectListItem> selList = new List <SelectListItem>(); selList.Add(new SelectListItem { Text = "全部", Value = "00000000-0000-0000-0000-000000000000", Selected = true }); IList <MSDS_WorkShop> shops = _workshopService.GetAll(WorkContext.CurrentMembershipUser.Company.Id); foreach (var item in shops) { selList.Add(new SelectListItem { Text = item.WorkShop_Name, Value = item.Id.ToString(), Selected = false }); } model.WorkShops = selList; Guid workshop_id = Guid.Parse(model.WorkShop_Id); var searchModel = new WorkStationSearchModel { PageIndex = model.PageIndex, PageSize = model.PageSize, KeyWord = model.KeyWord, WorkShop_Id = workshop_id }; model.ViewList = _workstationService.Search(searchModel); }
public ActionResult Index(WorkStationSearchViewModel searchModel) { try { SearchOrders(searchModel); return(View(searchModel)); } catch (Exception ex) { var model = new WorkStationSearchViewModel(); SearchOrders(model); ErrorNotification(ex); return(View(model)); } }