Пример #1
0
        public ActionResult SelectProduct(long id, int?PageIndex, int?PageSize, long?qProductID, string qProductTitle, int?orderCol)
        {
            if ((_crud & Zippy.SaaS.Entity.CRUD.Read) != Zippy.SaaS.Entity.CRUD.Read)
            {
                return(RedirectToAction("NoPermission", "Error"));
            }



            ViewData.Add("db", db);
            ViewData.Add("PageSize", PageSize ?? 10);

            int currentPageSize  = PageSize ?? 10;
            int currentPageIndex = PageIndex ?? 1;

            Hashtable hs = new Hashtable();

            hs.Add("qDepotID", id);
            hs.Add("qProductID", qProductID);
            hs.Add("orderCol", orderCol);
            hs.Add("qProductTitle", qProductTitle);

            PaginatedList <EAP.Logic.Z10.View.V_DepotProduct> result = Z10DepotProductHelper.Query(db, _tenant.TenantID.Value, currentPageSize, currentPageIndex, hs, orderCol);

            result.QueryParameters = hs;

            return(View(result));
        }
Пример #2
0
        public ActionResult EditDepotProduct(System.Int64?id)
        {
            if ((_crud & Zippy.SaaS.Entity.CRUD.Create) != Zippy.SaaS.Entity.CRUD.Create)
            {
                return(RedirectToAction("NoPermission", "Error"));
            }
            Z10DepotProduct entity = null;

            if (id.HasValue && id > 0)
            {
                if ((_crud & Zippy.SaaS.Entity.CRUD.Update) != Zippy.SaaS.Entity.CRUD.Update)
                {
                    return(RedirectToAction("NoPermission", "Error"));
                }
                ViewData["VTitle"] = "修改库存信息";

                entity = Z10DepotProductHelper.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 Z10DepotProduct();
            }

            return(View(entity));
        }
Пример #3
0
        public ActionResult DepotProducts(int?PageIndex, int?PageSize, long?qProductID, long?qDepotID, 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.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>");
            }
            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("qDepotID", qDepotID);
            hs.Add("qProductID", qProductID);
            hs.Add("orderCol", orderCol);

            PaginatedList <EAP.Logic.Z10.View.V_DepotProduct> result = Z10DepotProductHelper.Query(db, _tenant.TenantID.Value, currentPageSize, currentPageIndex, hs, orderCol);

            result.QueryParameters = hs;

            ViewData["DepotOptions"] = EAP.Logic.Z10.HtmlHelper.DepotSelectOptions(_tenant.TenantID.Value, db);
            return(View(result));
        }
Пример #4
0
        public ActionResult Details(System.Int64 id)
        {
            if ((_crud & Zippy.SaaS.Entity.CRUD.Read) != Zippy.SaaS.Entity.CRUD.Read)
            {
                return(RedirectToAction("NoPermission", "Error"));
            }
            Z10DepotProduct entity = Z10DepotProductHelper.Create(db, id);

            return(View(entity));
        }
Пример #5
0
        public ActionResult Edit(System.Int64?id, string act)
        {
            Z10DepotProduct 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 = Z10DepotProductHelper.Create(db, id.Value);
                ViewData["DepotOptions"] = EAP.Logic.Z10.HtmlHelper.DepotSelectOptions(_tenant.TenantID.Value, entity.DepotID, db);
                ViewData["ProductTitle"] = db.FindUnique <Z01Beetle.Entity.Z01Product>("ProductID=@ProductID and TenantID=@TenantID",
                                                                                       "Title", db.CreateParameter("ProductID", entity.ProductID), db.CreateParameter("TenantID", _tenant.TenantID.Value));
            }
            else
            {
                if ((_crud & Zippy.SaaS.Entity.CRUD.Create) != Zippy.SaaS.Entity.CRUD.Create)
                {
                    return(RedirectToAction("NoPermission", "Error"));
                }
                ViewData["VTitle"]       = "新增库存产品";
                entity                   = new Z10DepotProduct();
                ViewData["DepotOptions"] = EAP.Logic.Z10.HtmlHelper.DepotSelectOptions(_tenant.TenantID.Value, db);
            }

            string returnUrl = Request["ReturnUrl"];

            if (returnUrl.IsNullOrEmpty())
            {
                returnUrl = "/" + _ContollerName;
            }
            ViewData["ReturnUrl"] = returnUrl;
            return(View(entity));
        }
Пример #6
0
        public ActionResult Index(int?PageIndex, int?PageSize, Int64?qProductIDStart, Int64?qProductIDEnd, Int64?qDepotIDStart, Int64?qDepotIDEnd, 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>");
            }
            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("qProductIDStart", qProductIDStart);
            hs.Add("qProductIDEnd", qProductIDEnd);
            hs.Add("qDepotIDStart", qDepotIDStart);
            hs.Add("qDepotIDEnd", qDepotIDEnd);

            PaginatedList <EAP.Logic.Z10.View.V_DepotProduct> result = Z10DepotProductHelper.Query(db, _tenant.TenantID.Value, currentPageSize, currentPageIndex, hs, orderCol);

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