예제 #1
0
파일: busCliente.cs 프로젝트: dambert/Repo
        public void Actualizar(CLIENTE P, USUARIO P2)
        {

            try
            {
                 new DatCliente().Actualizar(P,P2);
            }
            catch (Exception e)
            {

                throw e;
            }
        }
예제 #2
0
파일: busEmpleado.cs 프로젝트: dambert/Repo
        public void Actualizar(EMPLEADO P, USUARIO P2)
        {
            try
            {
                new DatEmpleado().Actualizar(P,P2);
            }
            catch (Exception e)
            {

                throw e;
            }

        }
예제 #3
0
파일: busCliente.cs 프로젝트: dambert/Repo
        public int Insertar(CLIENTE P, USUARIO P2)
        {

            try
            {
                return new DatCliente().Insertar(P,P2);
            }
            catch (Exception e)
            {

                throw e;
            }
        }
예제 #4
0
파일: busUsuario.cs 프로젝트: dambert/Repo
        public int Insertar(USUARIO P)
        {
            try
            {
                return new DatUsuario().Insertar(P);
            }
            catch (Exception ex)
            {

                throw ex;
            }

        }
예제 #5
0
파일: busEmpleado.cs 프로젝트: dambert/Repo
        public int Insertar(EMPLEADO P, USUARIO P2)
        {
            try
            {
                return new DatEmpleado().Insertar(P,P2);
            }
            catch (Exception e)
            {

                throw e;
            }

        }
예제 #6
0
파일: busUsuario.cs 프로젝트: dambert/Repo
        public void Actualizar(USUARIO P)
        {
            try
            {
                new DatUsuario().Actualizar(P);

            }
            catch (Exception ex)
            {

                throw ex;
            }

        }
예제 #7
0
파일: DatUsuario.cs 프로젝트: dambert/Repo
        public int Insertar(USUARIO P)
        {
            try
            {
                ContextoDB ct = new ContextoDB();
                ct.USUARIO.Add(P);
                ct.SaveChanges();
                return P.CUsuario;
            }
            catch (Exception ex)
            {

                throw ex;
            }

        }
예제 #8
0
파일: DatEmpleado.cs 프로젝트: dambert/Repo
        public int Insertar(EMPLEADO P,USUARIO P2)
        {
            try
            {
                ContextoDB ct = new ContextoDB();
                ct.USUARIO.Add(P2);
                P.CEmpleado = P2.CUsuario;
                ct.EMPLEADO.Add(P);
                ct.SaveChanges();
                return P.CEmpleado;
            }
            catch (Exception ex)
            {

                throw ex;
            }

        }
예제 #9
0
파일: DatCliente.cs 프로젝트: dambert/Repo
        public int Insertar(CLIENTE P, USUARIO P2)
        {
            try
            {
                ContextoDB ct = new ContextoDB();
                ct.USUARIO.Add(P2);
                P.CCliente = P2.CUsuario;
                ct.CLIENTE.Add(P);
                ct.SaveChanges();
                return P.CCliente;
            }
            catch (Exception ex)
            {

                throw ex;
            }

        }
예제 #10
0
파일: DatUsuario.cs 프로젝트: dambert/Repo
        public void Actualizar(USUARIO P)
        {
            try
            {
                ContextoDB ct = new ContextoDB();
                USUARIO USUARIO = ct.USUARIO.Where(x => x.CUsuario == P.CUsuario).SingleOrDefault();

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

                throw ex;
            }

        }
예제 #11
0
파일: DatEmpleado.cs 프로젝트: dambert/Repo
        public void Actualizar(EMPLEADO P, USUARIO P2)
        {
            try
            {
                ContextoDB ct = new ContextoDB();
                USUARIO USUARIO = ct.USUARIO.Where(x => x.CUsuario == P2.CUsuario).SingleOrDefault();
                EMPLEADO EMPLEADO = ct.EMPLEADO.Where(x => x.CEmpleado == P.CEmpleado).SingleOrDefault();                
                if (EMPLEADO != null && USUARIO!=null)
                {
                   
                    ct.Entry(EMPLEADO).CurrentValues.SetValues(P);
                    ct.Entry(USUARIO).CurrentValues.SetValues(P2);
                    ct.SaveChanges();
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }

        }
예제 #12
0
파일: DatCliente.cs 프로젝트: dambert/Repo
        public void Actualizar(CLIENTE P, USUARIO P2)
        {
            try
            {
                ContextoDB ct = new ContextoDB();
                USUARIO USUARIO = ct.USUARIO.Where(x => x.CUsuario == P2.CUsuario).SingleOrDefault();
                CLIENTE CLIENTE = ct.CLIENTE.Where(x => x.CCliente == P.CCliente).SingleOrDefault();
                if (CLIENTE != null && USUARIO != null)
                {

                    ct.Entry(CLIENTE).CurrentValues.SetValues(P);
                    ct.Entry(USUARIO).CurrentValues.SetValues(P2);
                    ct.SaveChanges();
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }

        }