public ActionResult PosApplyView(Guid id) { if (!base.HasPermission("PosApply", PermissionOperate.view)) { return(base.ShowNotPermissionTip("")); } PosApply apply = _posApplyService.GetById(id); PosAuth posAuth = _posAuthService.GetUnique(p => p.MpUserId == apply.MpUserId); ViewBag.PosAuth = posAuth; return(View(apply)); }
public ActionResult PosApply(string isEdit) { //当前登录用户 MpUser mpUser = _mpUserService.GetById(MpUserID); PosAuth posAuth = _posAuthService.GetUnique(pos => pos.MpUserId == mpUser.Id); ViewBag.IsAuth = false; if (posAuth != null) { ViewBag.IsAuth = posAuth.IsAuth > 0; } ViewBag.Name = mpUser.Name; if (mpUser.Sex == 1) { ViewBag.Sex = "先生"; } else if (mpUser.Sex == 2) { ViewBag.Sex = "女士"; } else { ViewBag.Sex = ""; } //用户最近的一笔贷款申请[未撤销] PosApply posApply = _posApplyService.GetUnique(pos => pos.MpUserId == MpUserID && pos.Status == 0 && pos.ProcessStatus == 0, "CreateDate", false); //有未过期的贷款申请 if (posApply != null && !(isEdit == "1" && (DateTime.Now - posApply.CreateDate).Hours <= 24)) { return(RedirectToAction("PosMessage", new { })); } if (posApply == null) { posApply = new PosApply(); } return(View(posApply)); }