public ActionResult Index(TimeSheetViewModel SearchModel) { if (Session["Username"] == null) { return(RedirectToAction("Login", "Login")); } else { TimeSheetViewModel model = new TimeSheetViewModel(); model.Projectlist = new SelectList(TimeSheetAPIHelperService.JMSProjects().Result, "ID", "Value"); model.OpportunityNumberList = new SelectList(TimeSheetAPIHelperService.CostModelProject().Result, "ID", "OpportunityNumber"); var listitem = TimeSheetAPIHelperService.CostModelProject().Result.Select(x => new ListItemViewModel() { Id = x.Id, Value = x.Value }); int opportunityId = listitem.FirstOrDefault().Id; model.ActivityList = new SelectList(TimeSheetAPIHelperService.ProjectActivities(opportunityId).Result, "ID", "Value"); model.WarehouseNameList = new SelectList(ListItemService.Warehouses().Result, "ID", "Value"); model.CandidateNameList = new SelectList(ListItemService.Resources().Result, "ID", "Value"); var Search = new SearchViewModel { ProjectID = SearchModel.ProjectID, WarehouseNameId = SearchModel.WarehouseID, CandidateNameId = SearchModel.ResourceID, OpportunityNumberID = SearchModel.OpportunityID }; model.CandidateTimeSheetList = SearchFilterService.SearchTimeSheetRecord(Search).Result; return(View(model)); } }
public ActionResult TimeSheet() { TimeSheetViewModel model = new TimeSheetViewModel(); ListItemViewModel listitems = new ListItemViewModel(); model.Projectlist = new SelectList(TimeSheetAPIHelperService.CostModelProject().Result, "ID", "Value"); model.OpportunityNumberList = new SelectList(TimeSheetAPIHelperService.CostModelProject().Result, "ID", "OpportunityNumber"); var listitem = TimeSheetAPIHelperService.CostModelProject().Result.Select(x => new ListItemViewModel() { Id = x.Id, Value = x.Value }); int opportunityId = listitem.FirstOrDefault().Id; model.ActivityList = new SelectList(TimeSheetAPIHelperService.ProjectActivities(opportunityId).Result, "ID", "Value"); return(View(model)); }
public ActionResult Index() { if (Session["Username"] == null) { return(RedirectToAction("Login", "Login")); } else { TimeSheetViewModel model = new TimeSheetViewModel(); model.Projectlist = new SelectList(TimeSheetAPIHelperService.CostModelProject().Result, "ID", "Value"); // model.OpportunityNumberList = new SelectList(TimeSheetAPIHelperService.CostModelProject().Result, "ID", "OpportunityNumber"); model.WarehouseNameList = new SelectList(ListItemService.Warehouses().Result, "ID", "Value"); model.CandidateNameList = new SelectList(ListItemService.Resources().Result, "ID", "Value"); model.CandidateTimeSheetList = TimeSheetAPIHelperService.TimeSheetList().Result; return(View(model)); } }
public ActionResult Register() { TimeSheetViewModel model = new TimeSheetViewModel(); model.Projectlist = new SelectList(TimeSheetAPIHelperService.CostModelProject().Result, "ID", "Value"); model.OpportunityNumberList = new SelectList(TimeSheetAPIHelperService.CostModelProject().Result, "ID", "OpportunityNumber"); var listitem = TimeSheetAPIHelperService.CostModelProject().Result.Select(x => new ListItemViewModel() { Id = x.Id, Value = x.Value }); int opportunityId = listitem.FirstOrDefault().Id; model.ActivityList = new SelectList(TimeSheetAPIHelperService.ProjectActivities(opportunityId).Result, "ID", "Value"); model.WarehouseNameList = new SelectList(ListItemService.Warehouses().Result, "ID", "Value"); model.CandidateNameList = new SelectList(ListItemService.Resources().Result, "ID", "Value"); model.CandidateTimeSheetList = TimeSheetAPIHelperService.TimeSheetList().Result; return(PartialView("Register", model)); }