public async Task <ActionResult> DeleteConfirmed(int id)
        {
            MyBerat myBerat = await db.MyBerats.FindAsync(id);

            db.MyBerats.Remove(myBerat);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
        public async Task <ActionResult> Edit([Bind(Include = "Id,Tanggal,Max,Min,Perbedaan")] MyBerat myBerat)
        {
            if (ModelState.IsValid)
            {
                db.Entry(myBerat).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(myBerat));
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,Tanggal,Max,Min,Perbedaan")] MyBerat myBerat)
        {
            if (ModelState.IsValid)
            {
                myBerat.Perbedaan = (myBerat.Max - myBerat.Min);
                db.MyBerats.Add(myBerat);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(myBerat));
        }
        // GET: MyBerats/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MyBerat myBerat = await db.MyBerats.FindAsync(id);

            if (myBerat == null)
            {
                return(HttpNotFound());
            }
            return(View(myBerat));
        }