public ActionResult Index() { try { ViewBag.StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T"); ViewBag.EndTime = DateTime.Now.Date.AddDays(1).AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T"); ViewBag.Villages = VillageServices.QueryVillageByEmployeeMobilePhone(WeiXinUser.MobilePhone); return(View()); } catch (Exception ex) { ExceptionsServices.AddExceptionToDbAndTxt("CarVisitor", "获取访客车场失败", ex, LogFrom.WeiXin); return(RedirectToAction("Index", "ErrorPrompt", new { message = "获取访客车场失败" })); } }
public ActionResult Passed(string recordId) { try { List <BaseVillage> villages = VillageServices.QueryVillageByEmployeeMobilePhone(WeiXinUser.MobilePhone); List <EnumContext> parkContexts = new List <EnumContext>(); if (villages.Count > 0) { List <BaseParkinfo> parkings = ParkingServices.QueryParkingByVillageIds(villages.Select(p => p.VID).ToList()); foreach (var item in parkings) { EnumContext model = new EnumContext(); model.Description = item.PKName; model.EnumString = item.PKID; parkContexts.Add(model); } } ViewBag.ParkContexts = parkContexts; ParkMonthlyCarApply monthlyCarApply = ParkMonthlyCarApplyServices.QueryByRecordID(recordId); if (monthlyCarApply == null) { throw new MyException("申请信息不存在"); } List <ParkArea> areas = ParkAreaServices.GetParkAreaByParkingId(monthlyCarApply.PKID); List <EnumContext> areaContexts = new List <EnumContext>(); foreach (var item in areas) { EnumContext model = new EnumContext(); model.Description = item.AreaName; model.EnumString = item.AreaID; areaContexts.Add(model); } ViewBag.AreaContexts = areaContexts; List <EnumContext> gateContexts = new List <EnumContext>(); foreach (var item in areaContexts) { List <ParkGate> gates = ParkGateServices.QueryByParkAreaRecordIds(new List <string>() { item.EnumString }); foreach (var gate in gates) { EnumContext model = new EnumContext(); model.Description = gate.GateName; model.EnumString = string.Format("{0}|{1}", gate.GateID, item.EnumString); gateContexts.Add(model); } } ViewBag.GateContexts = gateContexts; return(View(monthlyCarApply)); } catch (Exception ex) { ExceptionsServices.AddExceptionToDbAndTxt("AdminAduitCarApply", "查看月租车申请详情失败", ex, LogFrom.WeiXin); return(RedirectToAction("Index", "AdminAduitCarApply", new { RemindUserContent = "审核失败" })); } }