Beispiel #1
0
        private static TestFkTable CreateFromFilter(IQueryFilter filter, Database database = null)
        {
            Database db  = database ?? Db.For <TestFkTable>();
            var      dao = new TestFkTable();

            filter.Parameters.Each(p =>
            {
                dao.Property(p.ColumnName, p.Value);
            });
            dao.Save(db);
            return(dao);
        }
Beispiel #2
0
 public ActionResult Update(Bam.Net.DaoRef.TestFkTable dao)
 {
     try
     {
         dao.Save();
         return(Json(new { Success = true, Message = "", Dao = dao.ToJsonSafe() }));
     }
     catch (Exception ex)
     {
         return(GetErrorResult(ex));
     }
 }
Beispiel #3
0
 public ActionResult Delete(long id)
 {
     try
     {
         string msg = "";
         Bam.Net.DaoRef.TestFkTable dao = Bam.Net.DaoRef.TestFkTable.OneWhere(c => c.KeyColumn == id);
         if (dao != null)
         {
             dao.Delete();
         }
         else
         {
             msg = string.Format("The specified id ({0}) was not found in the table (TestFkTable)", id);
         }
         return(Json(new { Success = true, Message = msg, Dao = "" }));
     }
     catch (Exception ex)
     {
         return(GetErrorResult(ex));
     }
 }
Beispiel #4
0
 public static void SetOneWhere(WhereDelegate <TestFkTableColumns> where, out TestFkTable result, Database database = null)
 {
     result = GetOneWhere(where, database);
 }
Beispiel #5
0
 public ActionResult Create(Bam.Net.DaoRef.TestFkTable dao)
 {
     return(Update(dao));
 }