public ActionResult Edit(PurchaseRecord purchaserecord)
 {
     if (ModelState.IsValid)
     {
         db.Entry(purchaserecord).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(purchaserecord);
 }
        public ActionResult Create(PurchaseRecord purchaserecord)
        {
            if (ModelState.IsValid)
            {
                db.PurchaseRecords.Add(purchaserecord);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(purchaserecord);
        }