public ActionResult Details(System.Int64 id) { if ((_crud & Zippy.SaaS.Entity.CRUD.Read) != Zippy.SaaS.Entity.CRUD.Read) { return(RedirectToAction("NoPermission", "Error")); } Z01Customer entity = Z01CustomerHelper.Create(db, id); ViewBag.act = "detail"; return(View(entity)); }
public ActionResult Edit(System.Int64?id, string act) { Z01Customer entity = null; ViewBag.act = act; if (id.HasValue && id > 0) { if (act == "detail") { if ((_crud & Zippy.SaaS.Entity.CRUD.Read) != Zippy.SaaS.Entity.CRUD.Read) { return(RedirectToAction("NoPermission", "Error")); } ViewData["VTitle"] = "查看客户信息"; ViewData["IsDetail"] = true; } else { if ((_crud & Zippy.SaaS.Entity.CRUD.Update) != Zippy.SaaS.Entity.CRUD.Update) { return(RedirectToAction("NoPermission", "Error")); } ViewData["VTitle"] = "修改客户信息"; } entity = Z01CustomerHelper.Create(db, id.Value); if (entity.Principal != _user.UserID) { return(RedirectToAction("NoPermission", "Error")); } } else { if ((_crud & Zippy.SaaS.Entity.CRUD.Create) != Zippy.SaaS.Entity.CRUD.Create) { return(RedirectToAction("NoPermission", "Error")); } ViewData["VTitle"] = "新增客户"; entity = new Z01Customer(); } string returnUrl = Request["ReturnUrl"]; if (returnUrl.IsNullOrEmpty()) { returnUrl = "/" + _ContollerName; } ViewData["ReturnUrl"] = returnUrl; return(View(entity)); }