예제 #1
0
        public ActionResult Details(System.Int64 id)
        {
            if ((_crud & Zippy.SaaS.Entity.CRUD.Read) != Zippy.SaaS.Entity.CRUD.Read)
            {
                return(RedirectToAction("NoPermission", "Error"));
            }
            Z01Bank entity = Z01BankHelper.Create(db, id);

            return(View(entity));
        }
예제 #2
0
        public ActionResult Edit(System.Int64?id, string act)
        {
            Z01Bank 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 = Z01BankHelper.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 Z01Bank();
            }

            string returnUrl = Request["ReturnUrl"];

            if (returnUrl.IsNullOrEmpty())
            {
                returnUrl = "/" + _ContollerName;
            }
            ViewData["ReturnUrl"] = returnUrl;
            return(View(entity));
        }
예제 #3
0
        public ActionResult Index(int?PageIndex, int?PageSize, string qTitle, string qAccount, 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?ReturnUrl=" + System.Web.HttpUtility.UrlEncode("/" + _ContollerName + "/?PageSize=" + PageSize) + "' 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>");
            }
            if ((_crud & Zippy.SaaS.Entity.CRUD.Update) == Zippy.SaaS.Entity.CRUD.Update)
            {
                sbMenu.AppendLine("<a href='/" + _ContollerName + "/Sort/0' class='btn img' id='bDelete'><i class='icon i_sort'></i>排序<b></b></a>");
            }
            sbMenu.AppendLine("<a href='javascript:;' class='btn img' id='bReload'><i class='icon i_refresh'></i>刷新<b></b></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("qTitle", qTitle);
            hs.Add("qAccount", qAccount);

            PaginatedList <Z01Bank> result = Z01BankHelper.Query(db, _tenant.TenantID.Value, currentPageSize, currentPageIndex, hs, orderCol);

            result.QueryParameters = hs;
            return(View(result));
        }