예제 #1
0
 public void Actualizar(TIPO_ASIENTO P)
 {
     try
     {
         new DatTipo_Asiento().Actualizar(P);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #2
0
 public int Insertar(TIPO_ASIENTO P)
 {
     try
     {
         return(new DatTipo_Asiento().Insertar(P));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #3
0
        public TIPO_ASIENTO GetById(int CTipoAsiento)
        {
            try
            {
                ContextoDB   ct           = new ContextoDB();
                TIPO_ASIENTO TIPO_ASIENTO = ct.TIPO_ASIENTO.Where(x => x.CTipoAsiento == CTipoAsiento).SingleOrDefault();

                return(TIPO_ASIENTO);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #4
0
 public int Insertar(TIPO_ASIENTO P)
 {
     try
     {
         ContextoDB ct = new ContextoDB();
         ct.TIPO_ASIENTO.Add(P);
         ct.SaveChanges();
         return(P.CTipoAsiento);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #5
0
 public void Eliminar(int CTipoAsiento)
 {
     try
     {
         ContextoDB   ct           = new ContextoDB();
         TIPO_ASIENTO TIPO_ASIENTO = ct.TIPO_ASIENTO.Where(x => x.CTipoAsiento == CTipoAsiento).SingleOrDefault();
         if (TIPO_ASIENTO != null)
         {
             ct.TIPO_ASIENTO.Remove(TIPO_ASIENTO);
             ct.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #6
0
        public void Actualizar(TIPO_ASIENTO P)
        {
            try
            {
                ContextoDB   ct           = new ContextoDB();
                TIPO_ASIENTO TIPO_ASIENTO = ct.TIPO_ASIENTO.Where(x => x.CTipoAsiento == P.CTipoAsiento).SingleOrDefault();

                if (TIPO_ASIENTO != null)
                {
                    ct.Entry(TIPO_ASIENTO).CurrentValues.SetValues(P);
                    ct.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }