public ActionResult DeleteConfirmed(int id) { Logdetail logdetail = db.Logdetail.Find(id); db.Logdetail.Remove(logdetail); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,busId,code,date,url,postData,postType,returnData,result,description,mark")] Logdetail logdetail) { if (ModelState.IsValid) { db.Entry(logdetail).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(logdetail)); }
public ActionResult Create([Bind(Include = "id,busId,code,date,url,postData,postType,returnData,result,description,mark")] Logdetail logdetail) { if (ModelState.IsValid) { db.Logdetail.Add(logdetail); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(logdetail)); }
public ActionResult Index() { QHTEntities db = new QHTEntities(); List <BusinessMdel> lbusinessMdel = new List <BusinessMdel>(); List <Models.Business> buslist = db.Business.ToList(); buslist.ForEach(a => { Logdetail log = db.Logdetail.Where(l => l.busId == a.ID).OrderByDescending(l => l.date).FirstOrDefault(); Count count = db.Count.Where(c => c.BusId == a.ID).FirstOrDefault(); if (log == null) { log = new Logdetail() { id = 0, busId = a.ID, code = string.Empty, date = string.Empty, description = string.Empty, mark = string.Empty, postData = string.Empty, postType = string.Empty, result = string.Empty, returnData = string.Empty, url = string.Empty }; } if (count == null) { count = new Count() { id = 0, BusId = a.ID, failcount = 0, failsum = 0, lattime = null, succount = 0, sucsum = 0 }; } BusinessMdel businessMdel = new BusinessMdel() { business = a, count = count, log = log }; lbusinessMdel.Add(businessMdel); }); TimeAPI.Models.BusinessMdellist businessMdellist = new BusinessMdellist(); businessMdellist.busiMoList = lbusinessMdel; return(View(businessMdellist)); }
// GET: Logdetails/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Logdetail logdetail = db.Logdetail.Find(id); if (logdetail == null) { return(HttpNotFound()); } return(View(logdetail)); }