Ejemplo n.º 1
0
        public override BaseEntity Update(object Obj)
        {
            dbEntities = new mpi_dbEntities();
            position position   = (position)Obj;
            position DBposition = (position)GetById(position.id);

            if (DBposition == null)
            {
                return(null);
            }
            dbEntities.Entry(DBposition).CurrentValues.SetValues(position);
            dbEntities.SaveChanges();
            return(position);
        }
Ejemplo n.º 2
0
        public override BaseEntity Update(object Obj)
        {
            dbEntities = new mpi_dbEntities();
            member Member   = (member)Obj;
            member DBmember = (member)GetById(Member.id);

            if (DBmember == null)
            {
                return(null);
            }
            dbEntities.Entry(DBmember).CurrentValues.SetValues(Member);
            dbEntities.SaveChanges();
            return(Member);
        }
        public override BaseEntity Update(object Obj)
        {
            dbEntities = new mpi_dbEntities();
            program program   = (program)Obj;
            program DBProgram = (program)GetById(program.id);

            if (DBProgram == null)
            {
                return(null);
            }
            dbEntities.Entry(DBProgram).CurrentValues.SetValues(program);
            dbEntities.SaveChanges();
            return(program);
        }
Ejemplo n.º 4
0
        public override BaseEntity Update(object Obj)
        {
            dbEntities = new mpi_dbEntities();
            @event @event = (@event)Obj;

            @event.created_date = DateTime.Now;
            @event DBEvent = (@event)GetById(@event.id);

            if (DBEvent == null)
            {
                return(null);
            }
            dbEntities.Entry(DBEvent).CurrentValues.SetValues(@event);
            dbEntities.SaveChanges();
            return(@event);
        }
Ejemplo n.º 5
0
        public override BaseEntity Update(object Obj)
        {
            dbEntities = new mpi_dbEntities();
            section section   = (section)Obj;
            section DBsection = (section)GetById(section.id);

            if (DBsection == null)
            {
                return(null);
            }
            dbEntities.Entry(DBsection).CurrentValues.SetValues(section);
            try
            {
                dbEntities.SaveChanges();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return(null);
            }
            return(section);
        }