コード例 #1
0
 public void Actualizar(TIPOEMPLEADO P)
 {
     try
     {
         new DatTIPOEMPLEADO().Actualizar(P);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #2
0
 public int Insertar(TIPOEMPLEADO P)
 {
     try
     {
         return(new DatTIPOEMPLEADO().Insertar(P));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #3
0
ファイル: DatTipo_Empleado.cs プロジェクト: dambert/Repo
        public TIPOEMPLEADO GetById(int CTipoEmpleado)
        {
            try
            {
                ContextoDB   ct           = new ContextoDB();
                TIPOEMPLEADO TIPOEMPLEADO = ct.TIPOEMPLEADO.Where(x => x.CTipoEmpleado == CTipoEmpleado).SingleOrDefault();

                return(TIPOEMPLEADO);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #4
0
ファイル: DatTipo_Empleado.cs プロジェクト: dambert/Repo
 public int Insertar(TIPOEMPLEADO P)
 {
     try
     {
         ContextoDB ct = new ContextoDB();
         ct.TIPOEMPLEADO.Add(P);
         ct.SaveChanges();
         return(P.CTipoEmpleado);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #5
0
ファイル: DatTipo_Empleado.cs プロジェクト: dambert/Repo
 public void Eliminar(int CTipoEmpleado)
 {
     try
     {
         ContextoDB   ct           = new ContextoDB();
         TIPOEMPLEADO TIPOEMPLEADO = ct.TIPOEMPLEADO.Where(x => x.CTipoEmpleado == CTipoEmpleado).SingleOrDefault();
         if (TIPOEMPLEADO != null)
         {
             ct.TIPOEMPLEADO.Remove(TIPOEMPLEADO);
             ct.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #6
0
ファイル: DatTipo_Empleado.cs プロジェクト: dambert/Repo
        public void Actualizar(TIPOEMPLEADO P)
        {
            try
            {
                ContextoDB   ct           = new ContextoDB();
                TIPOEMPLEADO TIPOEMPLEADO = ct.TIPOEMPLEADO.Where(x => x.CTipoEmpleado == P.CTipoEmpleado).SingleOrDefault();

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