public ActionResult DeleteConfirmed(int id) { SBReceive sbreceive = db.SBReceives.Find(id); db.SBReceives.Remove(sbreceive); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,DRDate,DRTime,EID,Remarks,SBDSBId,Status,DIDId")] SBReceive sbreceive) { if (ModelState.IsValid) { return(RedirectToAction("Index")); } ViewBag.SBDSBId = new SelectList(db.SBDSBs, "Id", "Name", sbreceive.SBDSBId); return(View(sbreceive)); }
// GET: /SbReceive/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SBReceive sbreceive = transectionManager.GetReceives().Find(a => a.Id == id); if (sbreceive == null) { return(HttpNotFound()); } return(View(sbreceive)); }
// GET: /SbReceive/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SBReceive sbreceive = db.SBReceives.Find(id); if (sbreceive == null) { return(HttpNotFound()); } return(View(sbreceive)); }
// GET: /SbReceive/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SBReceive sbreceive = db.SBReceives.Find(id); if (sbreceive == null) { return(HttpNotFound()); } ViewBag.SBDSBId = new SelectList(db.SBDSBs, "Id", "Name", sbreceive.SBDSBId); return(View(sbreceive)); }
public string Receive(SBReceive sbReceive) { if (IsDispatched(sbReceive.EID) == null) { return("File with Enrollment Id" + sbReceive.EID + "has not been dispatched yet"); } else { if (IsReceived(sbReceive.EID) == null) { if (receiveGateway.Receive(sbReceive) > 0) { return("File with Enrollment Id " + sbReceive.EID + "has been received " + sbReceive.Status + "ly"); } return("Failed"); } else { if (GetReceives().Last(a => a.EID == sbReceive.EID).Status == "Positive") { return("File with Enrollment Id " + sbReceive.EID + "has already been dealt"); } else { if (GetDispatches().Count(a => a.EID == sbReceive.EID) == GetReceives().Count(a => a.EID == sbReceive.EID) + 1) { if (receiveGateway.Receive(sbReceive) > 0) { return("File with Enrollment Id " + sbReceive.EID + "has been received " + sbReceive.Status + "ly"); } return("Failed"); } else { return("Wait for file to be dispatched"); } } } } }
public ActionResult ReceivePositive([Bind(Include = "Id,DRDate,DRTime,EID,Remarks,SBDSBId,Status,DIDId")] SBReceive sbreceive) { sbreceive.DRDate = DateTime.Today; sbreceive.DRTime = DateTime.Now; sbreceive.Remarks = "Receive"; if (ModelState.IsValid) { ViewBag.Message = transectionManager.Receive(sbreceive); if (ViewBag.Message == "File with Enrollment Id " + sbreceive.EID + "has been received " + sbreceive.Status + "ly") { return(RedirectToAction("Index")); } else { ViewBag.SBDSBId = new SelectList(db.SBDSBs, "Id", "Name", sbreceive.SBDSBId); return(View()); } } ViewBag.SBDSBId = new SelectList(db.SBDSBs, "Id", "Name", sbreceive.SBDSBId); return(View(sbreceive)); }
public int EditReceives(SBReceive sbReceive) { db.Entry(sbReceive).State = EntityState.Modified; return(db.SaveChanges()); }
public int Receive(SBReceive sbReceive) { db.SBReceives.Add(sbReceive); return(db.SaveChanges()); }
public SBReceive IsReceived(string eId) { SBReceive receive = GetReceives().Find(a => a.EID == eId); return(receive); }