Beispiel #1
0
        public int InsertFile(SEDocumentosServicios doc, out string NV)
        {
            //Usamos el stored procedure "spInsDocumentoServiciosInit"
            int val = 0;

            NV = string.Empty;
            ObjectParameter VV            = new ObjectParameter("VValor_Mensaje", typeof(Int32));
            ObjectParameter VM            = new ObjectParameter("VMensaje", typeof(String));
            ObjectParameter nombreVirtual = new ObjectParameter("Nombre_Virtual", typeof(String));
            ObjectParameter idDocumento   = new ObjectParameter("Id_Documento", typeof(Int32));

            try
            {
                using (ClusmextContext context = new ClusmextContext())
                {
                    context.spInsDocumentoServiciosInit(doc.Nombre, doc.Id_FTP, doc.CreadoPor, 0, doc.IdServicio, doc.IdTipoDocumentoServicio, nombreVirtual, idDocumento, VV, VM);
                    if (VV.Value.ToString() == "0")
                    {
                        val = 1;
                        NV  = nombreVirtual.Value.ToString();
                    }
                }
            }
            catch (Exception ex)
            {
            }
            return(val);
        }