예제 #1
0
        public static Cliente Cliente_GetByIdEntrada(int idEntrada)
        {
            Cliente oC = new Cliente();

            try
            {
                Entrada oE = new Entrada()
                {
                    Id = idEntrada
                };
                EntradaMng oEMng = new EntradaMng()
                {
                    O_Entrada = oE
                };
                oEMng.selById();

                oC = new Cliente()
                {
                    Id = oE.Id_cliente
                };
                ClienteMng oCMng = new ClienteMng()
                {
                    O_Cliente = oC
                };
                oCMng.selById();
            }
            catch
            {
                throw;
            }
            return(oC);
        }
예제 #2
0
        public static List <Cliente> Cliente_FillAllLst()
        {
            List <Cliente> lst = new List <Cliente>();

            try
            {
                ClienteMng oCMng = new ClienteMng();
                oCMng.fillAllLst();
                lst = oCMng.Lst;
            }
            catch
            {
                throw;
            }
            return(lst);
        }
예제 #3
0
        public static List <Cliente> Cliente_GetAll()
        {
            List <Cliente> lst = new List <Cliente>();

            try
            {
                ClienteMng oMng = new ClienteMng();
                oMng.fillLst();
                lst = oMng.Lst;
            }
            catch (Exception)
            {
                throw;
            }
            return(lst);
        }
예제 #4
0
        public static Cliente Cliente_GetById(int id)
        {
            Cliente    oC    = new Cliente();
            ClienteMng oCMng = new ClienteMng();

            oC.Id           = id;
            oCMng.O_Cliente = oC;
            try
            {
                oCMng.selById();
            }
            catch
            {
                throw;
            }

            return(oC);
        }
예제 #5
0
        public static void Cliente_udt(Cliente oC)
        {
            IDbTransaction trans = null;

            try
            {
                trans = GenericDataAccess.BeginTransaction();
                ClienteMng oCMng = new ClienteMng();
                oCMng.O_Cliente = oC;
                oCMng.udt(trans);

                Cliente_documentoMng oCDMng = new Cliente_documentoMng();
                Cliente_documento    oCDDlt = new Cliente_documento();
                oCDDlt.Id_cliente          = oC.Id;
                oCDMng.O_Cliente_documento = oCDDlt;
                oCDMng.dltByCliente(trans);

                foreach (Cliente_documento oCD in oC.PLstDocReq)
                {
                    oCD.Id_cliente             = oC.Id;
                    oCDMng.O_Cliente_documento = oCD;
                    oCDMng.add(trans);
                }

                Cliente_copia_operacionMng oCCOpMng = new Cliente_copia_operacionMng();
                oCCOpMng.dltByCliente(oC.Id, trans);
                foreach (Cliente_copia_operacion oCCOp in oC.PLstCopiaOp)
                {
                    oCCOp.Id_cliente = oC.Id;
                    oCCOpMng.O_Cliente_copia_operacion = oCCOp;
                    oCCOpMng.add(trans);
                }
                GenericDataAccess.CommitTransaction(trans);
            }
            catch
            {
                if (trans != null)
                {
                    GenericDataAccess.RollbackTransaction(trans);
                }
                throw;
            }
        }
예제 #6
0
        public static void Cliente_changeStatus(Cliente oC, bool status)
        {
            try
            {
                ClienteMng oCMng = new ClienteMng();

                oCMng.O_Cliente = oC;
                if (status)
                {
                    oCMng.dlt();
                }
                else
                {
                    oCMng.reactive();
                }
            }
            catch
            {
                throw;
            }
        }