public ActionResult AddRate(Rate rate)
 {
     TxtCreator tx = new TxtCreator();
     var result = db.RateDb.Insert(rate);
     if (result)
     {
         return RedirectToAction("Adminka", new { message = "Тариф добавлен" });
     }
     else
     {
         return RedirectToAction("Adminka", new { message = "Оишбка" });
     }
 }
 public void Update(Rate rate)
 {
     db.Entry(rate).State = EntityState.Modified;
     this.Save();
 }
 public void Insert(Rate rate)
 {
     db.Rate.Add(rate);
     this.Save();
 }
        public ActionResult EditRate(Rate rate)
        {
            var result = db.RateDb.Update(rate);
            if (result)
            {

                return RedirectToAction("Adminka", new { message = "Сохранения изменены" });
            }
            else
            {
                return RedirectToAction("Adminka", new { message = "Оишбка" });
            }
        }