コード例 #1
0
        public ActionResult ChangelogTableExpressPartialDelete(string Id)
        {
            Id = Id.Replace("\"", "");
            if (string.IsNullOrEmpty(Id))
            {
                Id = "0";
            }
            int id    = Int32.Parse(Id);
            var model = new ChangelogsListPartialModel();

            if (id > 0)
            {
                try
                {
                    var a = db.Read(id);
                    var s = adb.Read(a.Asset.Id);
                    if (isAuthorized(s.Customer.Id) == AuthState.UserAuth || isAuthorized(s.Customer.Id) == AuthState.NoAuth)
                    {
                        return(PartialView("NotAuthorizedPatialPopup"));
                    }
                    db.Delete(a);
                    model.Changelogs = db.ReadAllWithFk(a.Asset.Id);
                }
                catch (Exception e)
                {
                    ViewData["EditError"] = e.Message;
                }
            }
            return(PartialView("~/Views/Customers/_ChangelogTableExpressPartial.cshtml", model));
        }
コード例 #2
0
        public ActionResult ChangelogTableExpressPartial(int assetid)
        {
            var a = adb.Read(assetid);

            if (a == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            if (isAuthorized(a.Customer.Id) == AuthState.NoAuth)
            {
                return(PartialView("NotAuthorizedPartical"));
            }
            var model = new ChangelogsListPartialModel();

            model.Changelogs = db.ReadAllWithFk(assetid);
            model.assetid    = assetid;
            return(PartialView("~/Views/Customers/_ChangelogTableExpressPartial.cshtml", model));
        }