Esempio n. 1
0
 public ActionResult Edit(Stringing stringing)
 {
     if (ModelState.IsValid)
     {
         db.Entry(stringing).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(stringing);
 }
Esempio n. 2
0
        public ActionResult Create(Stringing stringing)
        {
            if (ModelState.IsValid)
            {
                db.Stringings.Add(stringing);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(stringing);
        }
Esempio n. 3
0
 public static void Apply(Stringing f, int param1, double param2)
 {
     Console.WriteLine(f(param1, param2));
 }
Esempio n. 4
0
        public SaveResult UpdateStringing(Stringing stringing)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.Stringings.Attach(stringing);

            db.ObjectStateManager.ChangeObjectState(stringing, System.Data.EntityState.Modified);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error updating Stringing";
            }

            return result;
        }
Esempio n. 5
0
        public SaveResult DeleteStringing(Stringing stringing)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.Stringings.DeleteObject(stringing);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error deleting Stringing";
            }

            return result;
        }
Esempio n. 6
0
        public Stringing CreateStringing(Stringing stringing)
        {
            db.Stringings.AddObject(stringing);

            SaveChanges();

            return stringing;
        }