예제 #1
0
        public JsonResult InsertTodoItem(String id)
        {
            try
            {
                Simple.Models.Datum oDatum = new Simple.Models.Datum();
                oDatum.Todo = id;
                oDatum.Sort =db.Data.Count()+1;
                db.Data.AddObject(oDatum);
                db.SaveChanges();

                return Json(true, JsonRequestBehavior.AllowGet);

            }
            catch (Exception ex) { }
            return null;
        }
예제 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Data EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToData(Datum datum)
 {
     base.AddObject("Data", datum);
 }
예제 #3
0
 /// <summary>
 /// Create a new Datum object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="sort">Initial value of the Sort property.</param>
 public static Datum CreateDatum(global::System.Int32 id, global::System.Int32 sort)
 {
     Datum datum = new Datum();
     datum.Id = id;
     datum.Sort = sort;
     return datum;
 }