public ActionResult DeleteConfirmed(int id) { AsSales asSales = db.AsSales.Find(id); db.AsSales.Remove(asSales); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: Accounting/AsSales/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AsSales asSales = db.AsSales.Find(id); if (asSales == null) { return(HttpNotFound()); } return(View(asSales)); }
public ActionResult Create([Bind(Include = "Id,TrxDate,TrxDesc,Amount,DateEntered,AsCostCenterId,AsIncCategoryId,AsIncClientId, OrRef")] AsSales asSales) { if (ModelState.IsValid) { asSales.DateEntered = System.DateTime.Now; db.AsSales.Add(asSales); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AsCostCenterId = new SelectList(db.AsCostCenters, "Id", "ccName", asSales.AsCostCenterId); ViewBag.AsIncCategoryId = new SelectList(db.AsIncCategories, "Id", "Desc", asSales.AsIncCategoryId); ViewBag.AsIncClientId = new SelectList(db.AsIncClients, "Id", "ShortName", asSales.AsIncClientId); return(View(asSales)); }
public ActionResult Edit([Bind(Include = "Id,TrxDate,TrxDesc,Amount,DateEntered,AsCostCenterId,AsIncCategoryId,AsIncClientId,OrRef")] AsSales asSales) { if (ModelState.IsValid) { //asSales.DateEntered = DateTime.Now; //asSales.DateEntered = (System.DateTime)asSales.DateEntered.ToString("MM/dd/yyyy"); db.Entry(asSales).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AsCostCenterId = new SelectList(db.AsCostCenters, "Id", "ccName", asSales.AsCostCenterId); ViewBag.AsIncCategoryId = new SelectList(db.AsIncCategories, "Id", "Desc", asSales.AsIncCategoryId); ViewBag.AsIncClientId = new SelectList(db.AsIncClients, "Id", "ShortName", asSales.AsIncClientId); return(View(asSales)); }
// GET: Accounting/AsSales/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AsSales asSales = db.AsSales.Find(id); if (asSales == null) { return(HttpNotFound()); } ViewBag.AsCostCenterId = new SelectList(db.AsCostCenters, "Id", "ccName", asSales.AsCostCenterId); ViewBag.AsIncCategoryId = new SelectList(db.AsIncCategories, "Id", "Desc", asSales.AsIncCategoryId); ViewBag.AsIncClientId = new SelectList(db.AsIncClients, "Id", "ShortName", asSales.AsIncClientId); return(View(asSales)); }