Um Curso.
Наследование: IModel
Пример #1
0
 //        public T Create <T>(T model) where T : class
 //        {
 //            using (var c = new Mono.Data.Sqlite.SqliteConnection(Database.ConnectionString)) {
 //                c.Insert<T>(model);
 //            }
 //            return model;
 //        }
 public void Create(Curso model)
 {
     using (var c = new Mono.Data.Sqlite.SqliteConnection(Database.ConnectionString)) {
         c.Open();
         var m = model.ToDynamic();
         m.SetorId = model.Setor.Id;
         (m as IDictionary<string, object>).Remove("Setor");
         c.Insert((object)m, "Curso");
     }
 }
Пример #2
0
 public bool Delete(Curso model)
 {
     using (var c = new Mono.Data.Sqlite.SqliteConnection(Database.ConnectionString)) {
         return c.Delete (model);
     }
 }
Пример #3
0
 public bool Update(Guid id, Curso newT)
 {
     throw new NotImplementedException ();
 }
Пример #4
0
 public bool Update(Curso oldT, Curso newT)
 {
     throw new NotImplementedException ();
 }
Пример #5
0
 public bool Update(Curso entity)
 {
     using (var c = new Mono.Data.Sqlite.SqliteConnection(Database.ConnectionString)) {
        return c.Update<Curso>(entity);
     }
 }
Пример #6
0
 public static bool Update(Curso curso)
 {
     var dao = TinyIoCContainer.Current.Resolve<DataFacade>();
     return dao.UpdateCurso(curso);
 }
Пример #7
0
 //        public static Curso Insert(Curso colaborador)
 //        {
 //            var dao = TinyIoCContainer.Current.Resolve<DataFacade>();
 //            return dao.CreateCurso(colaborador);
 //        }
 public static void Insert(Curso curso)
 {
     var dao = TinyIoCContainer.Current.Resolve<DataFacade>();
     dao.CreateCurso(curso);
 }