Пример #1
0
 public ActionResult Detail(int deployId)
 {
     DeployRecordBusiness b = new DeployRecordBusiness();
     var o = b.GetDeployRecord(deployId);
     ViewBag.DeployId = deployId;
     return View(o);
 }
Пример #2
0
 public ActionResult Create(int packageId)
 {
     DeployRecordBusiness b = new DeployRecordBusiness();
     var o = b.AddDeployRecord(packageId);
     if (o != null)
         return RedirectToAction("Detail", new { deployId = o.DeployId });
     return View();
 }
Пример #3
0
 public JsonResult GetNewDeployedPackageUUId(bool verified)
 {
     DeployRecordBusiness b = new DeployRecordBusiness();
     Package p = b.GetNewDeployedPackage(verified);
     return Json(new
     {
         status = 0,
         result = new
         {
             uuid = p == null ? "" : p.Fingerprint
         }
     }, JsonRequestBehavior.AllowGet);
 }
Пример #4
0
 public ActionResult Index()
 {
     DeployRecordBusiness b = new DeployRecordBusiness();
     var list = b.GetDeployedRecordList();
     return View(list);
 }
        //
        // GET: /Package/
        public ActionResult Index(int pageIndex = 1, int pageSize = 10)
        {
            PackageBusiness b = new PackageBusiness();
            var list = b.GetPackageList();
            var count = b.GetPackageCount();

            DeployRecordBusiness drb = new DeployRecordBusiness();
            var packageIdAndDeployedCountPairs = drb.GetDeployCountForPackage(list.Select(p => p.PackageId));

            List<PackageModel> results = new List<PackageModel>();
            list.ForEach(p =>
            {
                var q = ObjectCopier.Copy<PackageModel>(p);
                q.ExtraInfo = "暂未发布";
                if (packageIdAndDeployedCountPairs.ContainsKey(p.PackageId))
                    q.ExtraInfo = string.Format("已发布{0}次", packageIdAndDeployedCountPairs[p.PackageId]);
                results.Add(q);
            });

            return View(results);
        }