Пример #1
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));
        }
Пример #2
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));
        }
Пример #3
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));
        }