Exemplo n.º 1
0
        public SIT_SOL_DOC dmlSelectID(SIT_SOL_DOC oDatos)
        {
            String sSQL = " SELECT * FROM SIT_SOL_DOC WHERE  docclave = :P0 AND solclave = :P1 ";

            return(CrearListaMDL <SIT_SOL_DOC>(ConsultaDML(sSQL, oDatos.docclave, oDatos.solclave) as DataTable)[0]);
        }
Exemplo n.º 2
0
        public int dmlBorrar(SIT_SOL_DOC oDatos)
        {
            String sSQL = " DELETE FROM SIT_SOL_DOC WHERE  docclave = :P0 AND solclave = :P1 ";

            return((int)EjecutaDML(sSQL, oDatos.docclave, oDatos.solclave));
        }
Exemplo n.º 3
0
        public Object dmlAgregar(SIT_SOL_DOC oDatos)
        {
            String sSQL = " INSERT INTO SIT_SOL_DOC( docclave, solclave) VALUES (  :P0, :P1) ";

            return(EjecutaDML(sSQL, oDatos.docclave, oDatos.solclave));
        }
Exemplo n.º 4
0
 public int dmlEditar(SIT_SOL_DOC oDatos)
 {
     // NO SE IMPLEMENTA PORQUE TODO ES LLAVE
     throw new NotImplementedException();
 }
Exemplo n.º 5
0
        protected bool GrabarDocSol(Int64 isolClave)
        {
            long iDocId = 0;
            SIT_DOC_DOCUMENTODao docDao;
            AdmDocContNeg        admDocNeg;

            if (_afdEdoDataMdl.lstDocContenidoMdl == null)
            {
                return(true);
            }

            // SIEMPRE TENER A LA SOLICITUD
            if (_afdEdoDataMdl.lstDocContenidoMdl.Count > 0)
            {
                docDao = new SIT_DOC_DOCUMENTODao(_cn, _transaction, _sDataAdapter);
                SIT_SOL_DOCDao soldocDao = new SIT_SOL_DOCDao(_cn, _transaction, _sDataAdapter);
                admDocNeg = new AdmDocContNeg(_afdEdoDataMdl.SharePointCxn, _afdEdoDataMdl.solicitud.solfecsol);

                try
                {
                    foreach (DocContenidoMdl docContMdl in _afdEdoDataMdl.lstDocContenidoMdl)
                    {
                        if (docContMdl != null)
                        {
                            if (docContMdl.docnombre != " ")
                            {
                                docContMdl.docmd5 = admDocNeg.ObtenerMD5(docContMdl);
                                iDocId            = (int)docDao.dmlSelectDocNombreMD5(docContMdl.docmd5);
                            }
                            else
                            {
                                iDocId = 0;
                            }

                            // VERIFICAR QUE NO EXISTA EL DOCUMENTO
                            if (iDocId == 0)
                            {
                                if (docContMdl.docnombre != " " && docContMdl.doc_contenido != null)
                                {
                                    docContMdl.docruta = admDocNeg.Grabar(docContMdl);
                                }

                                docDao.dmlAgregar(docContMdl);
                                iDocId = docDao.iSecuencia;

                                SIT_SOL_DOC docSol = new SIT_SOL_DOC(docclave: iDocId, solclave: isolClave);
                                soldocDao.dmlAgregar(docSol);
                            }
                            else
                            {
                                // REEMPLAZAR
                                docDao.dmlEditar(docContMdl);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    _sMsjError = ex.ToString();
                    throw new Exception("Error al grabar al grabar un documento " + ex.ToString());
                }
            }
            return(true);
        }