Exemplo n.º 1
0
        public XElement InsertarActualizarPuesto(string tipo_transaccion, E_PUESTO V_M_PUESTO, List <UDTT_ARCHIVO> pLstArchivoTemporales, List <E_DOCUMENTO> pLstDocumentos, string usuario, string programa, string pXmlOcupacion)
        {
            using (context = new SistemaSigeinEntities())
            {
                var pXmlResultado = new SqlParameter("@XML_RESULTADO", SqlDbType.Xml)
                {
                    Direction = ParameterDirection.Output
                };

                XElement vXmlDocumentos = new XElement("DOCUMENTOS");
                pLstDocumentos.ForEach(s => vXmlDocumentos.Add(new XElement("DOCUMENTO",
                                                                            new XAttribute("ID_ITEM", s.ID_ITEM),
                                                                            new XAttribute("ID_DOCUMENTO", s.ID_DOCUMENTO ?? 0),
                                                                            new XAttribute("ID_ARCHIVO", s.ID_ARCHIVO ?? 0),
                                                                            new XAttribute("NB_DOCUMENTO", s.NB_DOCUMENTO),
                                                                            new XAttribute("CL_TIPO_DOCUMENTO", s.CL_TIPO_DOCUMENTO))
                                                               ));

                List <UDTT_ARCHIVO> vLstArchivos = pLstArchivoTemporales;

                DataTable dtArchivos = new DataTable();
                dtArchivos.Columns.Add(new DataColumn("ID_ITEM", typeof(SqlGuid)));
                dtArchivos.Columns.Add(new DataColumn("ID_ARCHIVO", typeof(int)));
                dtArchivos.Columns.Add(new DataColumn("NB_ARCHIVO"));
                dtArchivos.Columns.Add(new DataColumn("FI_ARCHIVO", typeof(SqlBinary)));

                vLstArchivos.ForEach(f => dtArchivos.Rows.Add(f.ID_ITEM, f.ID_ARCHIVO ?? 0, f.NB_ARCHIVO, f.FI_ARCHIVO));

                var pArchivos = new SqlParameter("@PIN_ARCHIVOS", SqlDbType.Structured);
                pArchivos.Value    = dtArchivos;
                pArchivos.TypeName = "ADM.UDTT_ARCHIVO";

                context.Database.ExecuteSqlCommand("EXEC " +
                                                   "[ADM].[SPE_INSERTA_ACTUALIZA_M_PUESTO] " +
                                                   "@XML_RESULTADO OUTPUT " +
                                                   ",@PIN_ID_PUESTO " +
                                                   ",@PIN_CL_USUARIO " +
                                                   ",@PIN_NB_PROGRAMA " +
                                                   ",@PIN_TIPO_TRANSACCION " +
                                                   ",@PIN_XML_PUESTO " +
                                                   ",@PIN_XML_DOCUMENTOS " +
                                                   ",@PIN_XML_PUESTO_OCUPACION " +
                                                   ",@PIN_ARCHIVOS "
                                                   , pXmlResultado
                                                   , new SqlParameter("@PIN_ID_PUESTO", (object)V_M_PUESTO.ID_PUESTO ?? DBNull.Value)
                                                   , new SqlParameter("@PIN_CL_USUARIO", usuario)
                                                   , new SqlParameter("@PIN_NB_PROGRAMA", programa)
                                                   , new SqlParameter("@PIN_TIPO_TRANSACCION", tipo_transaccion)
                                                   , new SqlParameter("@PIN_XML_PUESTO", (object)V_M_PUESTO.XML_PUESTO ?? DBNull.Value)
                                                   , new SqlParameter("@PIN_XML_DOCUMENTOS", SqlDbType.Xml)
                {
                    Value = new SqlXml(vXmlDocumentos.CreateReader())
                }
                                                   , new SqlParameter("@PIN_XML_PUESTO_OCUPACION", pXmlOcupacion)
                                                   , pArchivos
                                                   );
                return(XElement.Parse(pXmlResultado.Value.ToString()));
            }
        }
        protected void EliminarPuesto(int pIdPuesto)
        {
            ContextoConsultasComparativas.oCandidatoVsPuestos.Where(w => w.vIdCandidatoVsPuestos == vIdCandidatoVsPuestos).FirstOrDefault().vListaPuestos.Remove(pIdPuesto);
            E_PUESTO vPuesto = vlstPuesto.Where(w => w.ID_PUESTO == pIdPuesto).FirstOrDefault();

            if (vPuesto != null)
            {
                vlstPuesto.Remove(vPuesto);
            }
        }
        public XElement InsertaActualizaDescriptivo(string PIN_ID_PUESTO, int?ID_CAMBIO = null, string CL_USUARIO = "", string NB_PROGRAMA = "", string tipo_transaccion = "", E_PUESTO V_M_PUESTO = null)
        {
            using (context = new SistemaSigeinEntities())
            {
                //Declaramos el objeto de valor de retorno
                ObjectParameter pout_clave_retorno = new ObjectParameter("XML_RESULTADO", typeof(XElement));

                context.SPE_INSERTA_ACTUALIZA_M_PUESTO_PDE(pout_clave_retorno, PIN_ID_PUESTO, ID_CAMBIO, CL_USUARIO, NB_PROGRAMA, tipo_transaccion, V_M_PUESTO.XML_PUESTO);
                //regresamos el valor de retorno de sql
                return(XElement.Parse(pout_clave_retorno.Value.ToString()));
            }
        }
Exemplo n.º 4
0
        public E_RESULTADO InsertaActualizaDescriptivo(string PIN_ID_PUESTO, int?ID_CAMBIO = null, string CL_USUARIO = "", string NB_PROGRAMA = "", string tipo_transaccion = "", E_PUESTO V_M_PUESTO = null)
        {
            DescriptivoPuestoOperaciones operaciones = new DescriptivoPuestoOperaciones();

            return(UtilRespuesta.EnvioRespuesta(operaciones.InsertaActualizaDescriptivo(PIN_ID_PUESTO, ID_CAMBIO, CL_USUARIO, NB_PROGRAMA, tipo_transaccion, V_M_PUESTO)));
        }
Exemplo n.º 5
0
        public E_RESULTADO InsertaActualizaPuesto(string tipo_transaccion, E_PUESTO V_M_PUESTO, List <UDTT_ARCHIVO> pLstArchivoTemporales, List <E_DOCUMENTO> pLstDocumentos, string usuario, string programa, string pXmlOcupacion)
        {
            PuestoOperaciones operaciones = new PuestoOperaciones();

            return(UtilRespuesta.EnvioRespuesta(operaciones.InsertarActualizarPuesto(tipo_transaccion, V_M_PUESTO, pLstArchivoTemporales, pLstDocumentos, usuario, programa, pXmlOcupacion)));
        }