public ActionResult AjaxDetail(System.Int64 id) { if ((_crud & Zippy.SaaS.Entity.CRUD.Read) != Zippy.SaaS.Entity.CRUD.Read) { return(RedirectToAction("NoPermission", "Error")); } Z01CustomerPerson entity = Z01CustomerPersonHelper.Create(db, id); return(View(entity)); }
public ActionResult Index(int?PageIndex, int?PageSize, string qName, string qNickname, long?qCustomerID, int?orderCol) { if ((_crud & Zippy.SaaS.Entity.CRUD.Read) != Zippy.SaaS.Entity.CRUD.Read) { return(RedirectToAction("NoPermission", "Error")); } System.Text.StringBuilder sbMenu = new System.Text.StringBuilder(); if ((_crud & Zippy.SaaS.Entity.CRUD.Create) == Zippy.SaaS.Entity.CRUD.Create) { sbMenu.AppendLine("<a href='/" + _ContollerName + "/Edit?qCustomerID=" + qCustomerID + "&ReturnUrl=" + System.Web.HttpUtility.UrlEncode("/" + _ContollerName + "/?PageSize=" + PageSize + "&qCustomerID=" + qCustomerID) + "' class='btn img'><i class='icon i_create'></i>添加<b></b></a>"); } if ((_crud & Zippy.SaaS.Entity.CRUD.Read) == Zippy.SaaS.Entity.CRUD.Read) { sbMenu.AppendLine("<a href='javascript:;' class='btn list img' id='search'><i class='icon i_search'></i>查询<b></b></a>"); } if ((_crud & Zippy.SaaS.Entity.CRUD.Delete) == Zippy.SaaS.Entity.CRUD.Delete) { sbMenu.AppendLine("<a href='javascript:;' class='btn img' id='bDelete'><i class='icon i_delete'></i>删除<b></b></a>"); } sbMenu.AppendLine("<a href='javascript:;' class='btn img' id='bReload'><i class='icon i_refresh'></i>刷新<b></b></a>"); if (qCustomerID.HasValue) { var cus = db.FindUnique <Z01Customer>("CustomerID=@CustomerID", db.CreateParameter("CustomerID", qCustomerID)); sbMenu.AppendLine("当前客户:" + cus.Title); sbMenu.AppendLine(" | <a href='/Z30Customer/'>返回客户列表</a>"); } ViewData["TopMenu"] = sbMenu.ToString(); ViewData.Add("db", db); ViewData.Add("PageSize", PageSize ?? 10); int currentPageSize = PageSize ?? 10; int currentPageIndex = PageIndex ?? 1; Hashtable hs = new Hashtable(); hs.Add("qName", qName); hs.Add("qNickname", qNickname); hs.Add("qCustomerID", qCustomerID); PaginatedList <Z01CustomerPerson> result = Z01CustomerPersonHelper.Query(db, _tenant.TenantID.Value, currentPageSize, currentPageIndex, hs, orderCol); result.QueryParameters = hs; return(View(result)); }
public ActionResult Edit(System.Int64?id, long?qCustomerID, string act) { Z01CustomerPerson entity = null; 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 = Z01CustomerPersonHelper.Create(db, id.Value); } else { if ((_crud & Zippy.SaaS.Entity.CRUD.Create) != Zippy.SaaS.Entity.CRUD.Create) { return(RedirectToAction("NoPermission", "Error")); } ViewData["VTitle"] = "新增客户联系人"; entity = new Z01CustomerPerson(); } ViewData["qCustomerID"] = qCustomerID; return(View(entity)); }