public void InsertarTest()
        {
            ExpedienteBLL obj = new ExpedienteBLL();
            //ExpedienteDTO expediente = new ExpedienteDTO{
            //    Cuantia = 500,
            //    Identificacion="dd",
            //    Nombre="jj",
            //    Obligacion= new ObligacionDTO{
            //        Cuantia=500
            //    }
            //};
            ObligacionDTO obligacion = new ObligacionDTO
            {
                Cuantia = 500
            };
            ExpedienteDTO expediente = new ExpedienteDTO
            {
                Cuantia        = 500,
                Identificacion = "dd",
                Nombre         = "jj",
                Obligacion     = obligacion
            };

            obj.Insertar(expediente);
            Assert.AreEqual("Se realizó la operación satisfactoriamente", obj.Insertar(expediente));
        }
コード例 #2
0
        private void SaveCotizacion()
        {
            ExpedienteBLL capanegocios = new ExpedienteBLL();
            ExpedienteBE  objeto       = new ExpedienteBE();

            try
            {
                objeto.CodigoExpediente = txtExpediente.Text.Trim();
                objeto.CodigoCotizacion = txtCotizacion.Text.Trim();
                objeto.IdTipoCliente    = Convert.ToInt32(ddlTipoCliente.SelectedValue);
                objeto.FechaCotizacion  = Convert.ToDateTime(txtFecCotizacion.Text.Trim());
                objeto.Correo           = txtCorreo.Text.Trim();
                objeto.DocumentoFisico  = txtDocFisico.Text.Trim();
                objeto.DocumentoAnexo   = txtDocAnexo.Text.Trim();
                objeto.Oficio           = string.Empty;
                objeto.FechaOficio      = Convert.ToDateTime(doMain.Utils.FechaNulaUtils.FechaNula());
                objeto.ActaPesquisa     = string.Empty;
                objeto.FechaPesquisa    = Convert.ToDateTime(doMain.Utils.FechaNulaUtils.FechaNula());
                objeto.IdUsuario        = 1;

                capanegocios.SaveCotizacion(objeto);
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }
コード例 #3
0
        private void GetExpedientebyId(int pIdExpediente)
        {
            ExpedienteBLL capanegocios = new ExpedienteBLL();
            ExpedienteBE  objeto       = new ExpedienteBE();

            try
            {
                objeto.IdExpediente = pIdExpediente;

                var lstExpediente = new ExpedienteBLL().GetExpediente(objeto);

                foreach (ExpedienteBE oExpediente in lstExpediente)
                {
                    ListTipoCliente();
                    ddlTipoCliente.SelectedValue = Convert.ToString(oExpediente.IdTipoCliente);
                    txtCotizacion.Text           = oExpediente.CodigoCotizacion;
                    txtExpediente.Text           = oExpediente.CodigoExpediente;
                    txtFecCotizacion.Text        = string.Format("{0:d}", oExpediente.FechaCotizacion);
                    txtCliente.Text        = oExpediente.Cliente;
                    txtProducto.Text       = oExpediente.Producto;
                    txtLote.Text           = oExpediente.Lote;
                    txtFecVencimiento.Text = string.Format("{0:d}", oExpediente.FechaVencimiento);
                    txtCorreo.Text         = oExpediente.Correo;
                    txtDocFisico.Text      = oExpediente.DocumentoFisico;
                    txtDocAnexo.Text       = oExpediente.DocumentoAnexo;
                }
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }
コード例 #4
0
        private void EnviarExpediente()
        {
            ExpedienteBLL capanegocios = new ExpedienteBLL();
            ExpedienteBE  objeto       = new ExpedienteBE();

            try
            {
                ArrayList ArrayList    = new ArrayList();
                CheckBox  ChkBoxHeader = (CheckBox)gdvExpediente.HeaderRow.FindControl("chkboxSelectAll");

                foreach (GridViewRow row in gdvExpediente.Rows)
                {
                    CheckBox ChkBoxRows = (CheckBox)row.FindControl("chkboxSelect");

                    if (ChkBoxRows.Checked == true)
                    {
                        objeto.IdEstado = Convert.ToInt32(Constante.Estados.Enviado);

                        String IdExpediente = Convert.ToString(gdvExpediente.DataKeys[row.RowIndex]["IDEXPEDIENTE"]);

                        objeto.IdExpediente       = Convert.ToInt32(IdExpediente);
                        objeto.IdUsuarioActualiza = 1;
                        capanegocios.UpdateEstadoExpediente(objeto);
                    }
                }
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }
コード例 #5
0
        private void AnularCotizacion(int IdExpediente)
        {
            ExpedienteBLL capanegocios = new ExpedienteBLL();
            ExpedienteBE  objeto       = new ExpedienteBE();

            try
            {
                objeto.IdExpediente    = IdExpediente;
                objeto.MotivoAnulacion = txtanulacion.Text.Trim();

                capanegocios.UpdateAnulacionCotizacion(objeto);
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }
コード例 #6
0
        public string validaVoucherBNacion(int idProcedimiento, string nroRecibo, string fecha)
        {
            // 000186 v bn -- fecha --- 2020 04 21
            //
            ResultadoProcedimientoVM resultado = new ResultadoProcedimientoVM();
            var validaExisteVoucher            = new ExpedienteBLL().ConsultaRecibo(nroRecibo);

            if (validaExisteVoucher.CodResultado == 1) // si existe el vucher
            {
                resultado.CodResultado = 1;
                resultado.NomResultado = validaExisteVoucher.NomResultado;
                //return resultado;
            }
            else
            {
                string fechaMes        = Convert.ToDateTime(fecha).Month.ToString("D2");
                string fechaDia        = Convert.ToDateTime(fecha).Day.ToString("D2");
                string fechaAnio       = Convert.ToDateTime(fecha).Year.ToString();
                var    fechaConvertida = fechaAnio + fechaMes + fechaDia;
                //
                resultado = new PagoBLL().ConsultarNacion(idProcedimiento, nroRecibo, fechaConvertida);
                //
                if (resultado.CodAuxiliar == 0)//el voucher no es valido
                {
                    resultado.CodResultado = 0;
                    resultado.NomResultado = "No es válido.";
                }
                else
                {
                    resultado.CodResultado = 1;
                    resultado.NomResultado = "Es válido.";
                    //es valido
                }
            }

            JavaScriptSerializer jss = new JavaScriptSerializer();
            string rptaJSON          = jss.Serialize(resultado);

            return(rptaJSON);
        }
コード例 #7
0
        private void UpdateCotizacion(int pIdExpediente)
        {
            ExpedienteBLL capanegocios = new ExpedienteBLL();
            ExpedienteBE  objeto       = new ExpedienteBE();

            try
            {
                objeto.IdExpediente       = pIdExpediente;
                objeto.CodigoExpediente   = txtExpediente.Text.Trim();
                objeto.CodigoCotizacion   = txtCotizacion.Text.Trim();
                objeto.IdTipoCliente      = Convert.ToInt32(ddlTipoCliente.SelectedValue);
                objeto.FechaCotizacion    = Convert.ToDateTime(txtFecCotizacion.Text.Trim());
                objeto.Correo             = txtCorreo.Text.Trim();
                objeto.DocumentoFisico    = txtDocFisico.Text.Trim();
                objeto.DocumentoAnexo     = txtDocAnexo.Text.Trim();
                objeto.IdUsuarioActualiza = 1;

                capanegocios.UpdateCotizacion(objeto);
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }
コード例 #8
0
        private void ExportarExcelPlantilla(System.Web.HttpResponse Response)
        {
            ExpedienteBLL capanegocios = new ExpedienteBLL();
            ExpedienteBE  objeto       = new ExpedienteBE();

            DataTable dtExpediente = new DataTable();

            try
            {
                if (txtFilExpediente.Text.Trim() != string.Empty)
                {
                    objeto.CodigoExpediente = txtFilExpediente.Text.Trim();
                }
                else
                {
                    objeto.CodigoExpediente = "*";
                }

                if (txtFilCotizacion.Text.Trim() != string.Empty)
                {
                    objeto.CodigoCotizacion = txtFilCotizacion.Text.Trim();
                }
                else
                {
                    objeto.CodigoCotizacion = "*";
                }

                objeto.IdTipoCliente = Convert.ToInt32(ddlFilTipoCliente.SelectedValue);

                if (txtFilCliente.Text.Trim() != string.Empty)
                {
                    objeto.Cliente = txtFilCliente.Text.Trim();
                }
                else
                {
                    objeto.Cliente = "*";
                }

                objeto.Producto = txtFilProducto.Text.Trim();

                if (txtFilFecCotiz.Text == string.Empty)
                {
                    objeto.FechaCotizacion = Convert.ToDateTime(doMain.Utils.FechaNulaUtils.FechaNula());
                }
                else
                {
                    objeto.FechaCotizacion = Convert.ToDateTime(txtFilFecCotiz.Text);
                }


                objeto.FechaIngreso = Convert.ToDateTime(doMain.Utils.FechaNulaUtils.FechaNula());


                objeto.IdEstado      = Convert.ToInt32(ddlFilEstado.SelectedValue);
                objeto.IdEnsayo      = Convert.ToInt32(ddlFilEnsayo.SelectedValue);
                objeto.IdAnalista    = Convert.ToInt32(ddlFilAnalista.SelectedValue);
                objeto.IdProcedencia = Convert.ToInt32(Constante.Numeros.Cero);

                var lstExpediente = new ExpedienteBLL().ExportExpediente(objeto);

                //crear datatable para enviar al metodo de descarga
                var dataTableDescargar = new System.Data.DataTable(Guid.NewGuid().ToString());
                var Expediente         = new DataColumn("Expediente", typeof(string));
                var Cliente            = new DataColumn("Cliente", typeof(string));
                var TipoCliente        = new DataColumn("TipoCliente", typeof(string));
                var Producto           = new DataColumn("Producto", typeof(string));
                var Lote              = new DataColumn("Lote", typeof(string));
                var DCI               = new DataColumn("DCI", typeof(string));
                var Clasificacion     = new DataColumn("Clasificacion", typeof(string));
                var Red               = new DataColumn("Red", typeof(string));
                var Norma             = new DataColumn("Norma", typeof(string));
                var Estado            = new DataColumn("Estado", typeof(string));
                var FechaIngreso      = new DataColumn("FechaIngreso", typeof(string));
                var FechaIngresoSIGEL = new DataColumn("FechaIngresoSIGEL", typeof(string));

                dataTableDescargar.Columns.AddRange(new DataColumn[] {
                    Expediente, Cliente, TipoCliente, Producto, Lote, DCI, Clasificacion, Red, Norma, Estado, FechaIngreso, FechaIngresoSIGEL
                });

                //Llenar data al datatable
                foreach (ExpedienteBE oExpediente in lstExpediente)
                {
                    DataRow RowFile = dataTableDescargar.NewRow();

                    RowFile["Expediente"]    = oExpediente.CodigoExpediente;
                    RowFile["Cliente"]       = oExpediente.Cliente;
                    RowFile["TipoCliente"]   = oExpediente.TipoCliente;
                    RowFile["Producto"]      = oExpediente.Producto;
                    RowFile["Lote"]          = oExpediente.Lote;
                    RowFile["DCI"]           = oExpediente.DCI;
                    RowFile["Clasificacion"] = oExpediente.Clasificacion;
                    RowFile["Red"]           = oExpediente.Red;
                    RowFile["Norma"]         = oExpediente.Norma;
                    RowFile["Estado"]        = oExpediente.Estado;

                    if (oExpediente.FechaIngreso != Convert.ToDateTime("01/01/1901"))
                    {
                        RowFile["FechaIngreso"] = string.Format("{0:d}", oExpediente.FechaIngreso);
                    }
                    else
                    {
                        RowFile["FechaIngreso"] = string.Empty;
                    }

                    if (oExpediente.FechaIngresoSIGEL != Convert.ToDateTime("01/01/1901"))
                    {
                        RowFile["FechaIngresoSIGEL"] = string.Format("{0:d}", oExpediente.FechaIngresoSIGEL);
                    }
                    else
                    {
                        RowFile["FechaIngresoSIGEL"] = string.Empty;
                    }

                    dataTableDescargar.Rows.Add(RowFile);
                }

                ExportarUtils ObjExporExcel = new ExportarUtils();

                object[] pNombreCabeceras = new object[] { "Expediente", "Cliente", "Tipo Cliente", "Producto", "Lote", "DCI", "Clasificacion", "Red", "Norma", "Estado", "Fecha Ingreso", "Fecha Ingreso SIGEL" };
                object[] pEstilos         = new object[] { new object[] { 11, OleDbType.Date }, new object[] { 12, OleDbType.Date } };
                string   MessageOut       = ObjExporExcel.DescargarDataTableToExcel(dataTableDescargar, "Archivo Seguimiento Expediente", pNombreCabeceras, pEstilos, Page.Response);

                if (MessageOut != "OK")
                {
                    //objMsgBox.MsgBoxCC(lblMensaje, MessageOut, "Error");
                }
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }
コード例 #9
0
        private void ListbyCriteriosExpediente(int pIdArea, bool aIsCompleteData)
        {
            ExpedienteBLL capanegocios = new ExpedienteBLL();
            ExpedienteBE  objeto       = new ExpedienteBE();
            Double        Total;


            try
            {
                inStartRowIndex = ((currentPageNumber - 1) * PAGE_SIZE) + 1;

                if (aIsCompleteData)
                {
                    inEndRowIndex = (currentPageNumber * PAGE_SIZE);
                }
                else
                {
                    inEndRowIndex = (currentPageNumber * PAGE_SIZE);
                }

                objeto.StartRowIndex = inStartRowIndex;
                objeto.EndRowIndex   = inEndRowIndex;

                if (txtFilExpediente.Text.Trim() != string.Empty)
                {
                    objeto.CodigoExpediente = txtFilExpediente.Text.Trim();
                }
                else
                {
                    objeto.CodigoExpediente = "*";
                }

                if (txtFilCotizacion.Text.Trim() != string.Empty)
                {
                    objeto.CodigoCotizacion = txtFilCotizacion.Text.Trim();
                }
                else
                {
                    objeto.CodigoCotizacion = "*";
                }

                objeto.IdTipoCliente = Convert.ToInt32(ddlFilTipoCliente.SelectedValue);

                if (txtFilCliente.Text.Trim() != string.Empty)
                {
                    objeto.Cliente = txtFilCliente.Text.Trim();
                }
                else
                {
                    objeto.Cliente = "*";
                }

                objeto.Producto = txtFilProducto.Text.Trim();

                if (txtFilFecCotiz.Text == string.Empty)
                {
                    objeto.FechaCotizacion = Convert.ToDateTime(doMain.Utils.FechaNulaUtils.FechaNula());
                }
                else
                {
                    objeto.FechaCotizacion = Convert.ToDateTime(txtFilFecCotiz.Text);
                }


                objeto.FechaIngreso = Convert.ToDateTime(doMain.Utils.FechaNulaUtils.FechaNula());


                objeto.IdEstado      = Convert.ToInt32(ddlFilEstado.SelectedValue);
                objeto.IdEnsayo      = Convert.ToInt32(ddlFilEnsayo.SelectedValue);
                objeto.IdAnalista    = Convert.ToInt32(ddlFilAnalista.SelectedValue);
                objeto.IdProcedencia = Convert.ToInt32(Constante.Numeros.Cero);

                var lstExpediente = new ExpedienteBLL().ListExpedienteFisicoQuimico(objeto);
                gdvExpediente.DataSource = lstExpediente;
                gdvExpediente.DataBind();

                if (lstExpediente.Count > 0)
                {
                    Total = lstExpediente[0].NroExpediente;

                    lblContador.Text = "Total de Expediente(s): " + Total + " registro(s).";

                    lblTotalPages.Text = GetTotalPages(Total).ToString();

                    ddlPage.Items.Clear();
                    for (int i = 1; i < Convert.ToInt32(lblTotalPages.Text) + 1; i++)
                    {
                        ddlPage.Items.Add(new ListItem(i.ToString()));
                    }
                    ddlPage.SelectedValue = currentPageNumber.ToString();
                }

                if (currentPageNumber == 1)
                {
                    lnkbtnPre.Enabled    = false;
                    lnkbtnPre.CssClass   = "GridPagePreviousInactive";
                    lnkbtnFirst.Enabled  = false;
                    lnkbtnFirst.CssClass = "GridPageFirstInactive";

                    if (Int32.Parse(lblTotalPages.Text) > 0)
                    {
                        lnkbtnNext.Enabled  = true;
                        lnkbtnNext.CssClass = "GridPageNextActive";
                        lnkbtnLast.Enabled  = true;
                        lnkbtnLast.CssClass = "GridPageLastActive";
                    }
                    else
                    {
                        lnkbtnNext.Enabled  = false;
                        lnkbtnNext.CssClass = "GridPageNextInactive";
                        lnkbtnLast.Enabled  = false;
                        lnkbtnLast.CssClass = "GridPageLastInactive";
                    }
                }

                else
                {
                    lnkbtnPre.Enabled    = true;
                    lnkbtnPre.CssClass   = "GridPagePreviousActive";
                    lnkbtnFirst.Enabled  = true;
                    lnkbtnFirst.CssClass = "GridPageFirstActive";

                    if (currentPageNumber == Int32.Parse(lblTotalPages.Text))
                    {
                        lnkbtnNext.Enabled  = false;
                        lnkbtnNext.CssClass = "GridPageNextInactive";
                        lnkbtnLast.Enabled  = false;
                        lnkbtnLast.CssClass = "GridPageLastInactive";
                    }
                    else
                    {
                        lnkbtnNext.Enabled  = true;
                        lnkbtnNext.CssClass = "GridPageNextActive";
                        lnkbtnLast.Enabled  = true;
                        lnkbtnLast.CssClass = "GridPageLastActive";
                    }
                }
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }
コード例 #10
0
        public JsonResult registrarTramite(int tipoPersona, int modalidad, int tramite, int procedimiento,
                                           int tipoDocumento, string nroDocumento, string apepat, string apemat,
                                           string nombres, string reciboPago, string email, string ruc,
                                           int autorizaEmail, string nroTelefono, string direccion,
                                           int idBanco, string fechaPago, HttpPostedFileBase[] files)
        {
            TramiteSimpleVM t = new TramiteSimpleVM();

            t.TIPO_PERSONA      = tipoPersona;
            t.IDMODALIDAD       = modalidad;
            t.IDPROCEDIMIENTO   = procedimiento;
            t.IDTIPODOCUMENTO   = tipoDocumento;
            t.NRODOCUMENTO      = nroDocumento;
            t.APEPAT            = apepat;
            t.APEMAT            = apemat;
            t.NOMBRES           = nombres;
            t.NRORECIBOPAGO     = reciboPago;
            t.CORREOELECTRONICO = email;
            t.RUC             = ruc;
            t.ID_TIPO_PERSONA = tipoPersona;
            t.AUTORIZA_EMAIL  = autorizaEmail;
            t.NRO_TELEF       = nroTelefono;
            t.DIRECCION       = direccion;
            t.PLACA           = "";
            t.IDBANCO         = idBanco;
            t.FECHA_PAGO      = fechaPago;
            //Verifica El nro del recibo
            if (t.NRORECIBOPAGO.Length > 0)
            {
                var resultadoBusqueda = new TramiteSimpleBLL().busqueda_recibo(t.NRORECIBOPAGO);
                if (resultadoBusqueda.CodResultado == 1)
                {
                    return(Json(new
                    {
                        codResultado = 0,
                        desResultado = resultadoBusqueda.NomResultado,
                        codAuxiliar = 0,
                        resultadoex = ""
                    }));
                }
            }


            //Persona TRAMITE
            PersonaVM solicitante = new PersonaVM();

            solicitante.NRO_DOCUMENTO    = t.NRODOCUMENTO;
            solicitante.APELLIDO_PATERNO = t.APEPAT;
            solicitante.APELLIDO_MATERNO = t.APEMAT;
            solicitante.NOMBRES          = t.NOMBRES;
            solicitante.direccion        = "";
            solicitante.NRO_RUC          = t.RUC;
            solicitante.CORREO           = t.CORREOELECTRONICO;

            //Busca persona en STD si no lo encuentra entonces lo crea
            //var resultadoBusqueda = new PersonaBLL().ConsultaPersonaSTD(t.NRODOCUMENTO);
            var codResultado = 0;
            var desResultado = "";
            var codAuxiliar  = "";
            var resultadoex  = "";

            using (TransactionScope scope = new TransactionScope())
            {
                var registroTramite = new TramiteSimpleBLL().registrarTramiteSimple(t);
                try
                {
                    if (registroTramite.CodAuxiliar > 0)
                    {
                        #region  registrar STD
                        var personaSTD = new PersonaVM();
                        var empresaSTD = new EmpresaVM();

                        switch (t.TIPO_PERSONA)
                        {
                        case 1:                                                                    //juridica
                            #region consulta STD persona juridica si no lo encuentra entonces crea en STD
                            empresaSTD = new EmpresaBLL().ConsultaEmpresaSTD(solicitante.NRO_RUC); // persona
                            #endregion
                            break;

                        case 2:                                                            //persona natural
                            #region consulta STD persona si no lo encuentra entonces crea en STD
                            personaSTD = new PersonaBLL().ConsultaPersonaSTD(solicitante); // persona
                            #endregion
                            break;

                        default:
                            break;
                        }

                        //setea datos para STD segun tipo  Persona
                        STDVM resultadoExpediente = new STDVM();
                        switch (t.TIPO_PERSONA)
                        {
                        case 1:     //juridica
                            #region consulta STD persona juridica si no lo encuentra entonces crea en STD
                            STDVM STD_JURIDICA = new STDVM()
                            {
                                IDUNIDAD_STD  = 7,    //unidad de la institucion
                                CODPAIS       = empresaSTD.CODPAIS,
                                CODDPTO       = empresaSTD.CODDPTO,
                                CODPROV       = empresaSTD.CODPROV,
                                CODDIST       = empresaSTD.CODDIST,
                                DIRECCION_STD = personaSTD.direccion,
                                NOMBRE        = personaSTD.NOMBRES,

                                ID_PROCEDIMIENTO = t.IDPROCEDIMIENTO,
                                ID_PROVEEDOR     = empresaSTD.ID_EMPRESA,
                                //Proceso TUPA STD
                                TIPO_EXPEDIENTE = 3,
                                OBSERVACION     = "PROCEDIMIENTO TUPA",
                            };
                            resultadoExpediente = new ExpedienteBLL().creaSoloExpediente(STD_JURIDICA);
                            #endregion
                            break;

                        case 2:     //persona natural
                            #region registra expediente en STD

                            STDVM STD_NATURAL = new STDVM()
                            {
                                IDUNIDAD_STD     = 7, //unidad de la institucion
                                CODPAIS          = personaSTD.CODPAIS,
                                CODDPTO          = personaSTD.CODDPTO,
                                CODPROV          = personaSTD.CODPROV,
                                CODDIST          = personaSTD.CODDIST,
                                DIRECCION_STD    = personaSTD.direccion,
                                NOMBRE           = personaSTD.NOMBRES,
                                ID_PERSONA       = personaSTD.ID_PERSONA,
                                ID_PROCEDIMIENTO = t.IDPROCEDIMIENTO,
                                //ID_PROVEEDOR = modelo.ID_EMPRESA,
                                //Proceso TUPA STD
                                TIPO_EXPEDIENTE = 3,
                                OBSERVACION     = "PROCEDIMIENTO TUPA",
                            };

                            resultadoExpediente = new ExpedienteBLL().creaSoloExpediente(STD_NATURAL);
                            #endregion
                            break;

                        default:
                            break;
                        }
                        #endregion

                        int contador = 0;
                        try
                        {
                            var nombreArchivosSerializado = "";
                            foreach (HttpPostedFileBase file in files)
                            {
                                if (file != null)
                                {
                                    contador++;
                                    var    nombreArchivo           = Path.GetFileName(file.FileName);
                                    var    extensionArchivo        = Path.GetExtension(file.FileName);
                                    var    arrFileName             = nombreArchivo.Split('.');
                                    var    nuevoNombreArchivoExcel = "tramite_" + registroTramite.CodAuxiliar.ToString() + "_archivo_" + contador.ToString() + extensionArchivo;
                                    var    pathArchivo             = Server.MapPath("~/Adjunto/tramites/" + nuevoNombreArchivoExcel);
                                    string pathFinal = Path.Combine(pathArchivo);
                                    file.SaveAs(pathFinal);
                                    nombreArchivosSerializado += nuevoNombreArchivoExcel + "|";
                                }
                            }
                            var ssid_exp = resultadoExpediente.NUMERO_SID.ToString() + "-" + resultadoExpediente.NUMERO_ANIO;
                            var actualizacionNombresArchivo = new TramiteSimpleBLL().actualizarDataTramiteSimple(registroTramite.CodAuxiliar, nombreArchivosSerializado, resultadoExpediente.IDDOC, ssid_exp);

                            codResultado = actualizacionNombresArchivo.CodResultado;
                            desResultado = actualizacionNombresArchivo.NomResultado;

                            if (codResultado == 1 && resultadoExpediente.IDDOC > 0)
                            {
                                scope.Complete();
                                if (t.AUTORIZA_EMAIL == 1)
                                {
                                    var rptaEnvioCorreo = enviarCorreoSimple(solicitante.CORREO, solicitante.NOMBRES + " " + solicitante.APELLIDO_PATERNO + " " + solicitante.APELLIDO_MATERNO, solicitante.NRO_DOCUMENTO, resultadoExpediente.NUMERO_SID.ToString(), resultadoExpediente.NUMERO_ANIO);

                                    if (rptaEnvioCorreo == 0)
                                    {
                                        codResultado = 0;
                                        desResultado = "Ocurrio un error en el registro del trámite. (ERR5)";
                                        scope.Dispose();
                                        Conexion.finalizar(ref bdConn);
                                    }
                                }

                                codAuxiliar = resultadoExpediente.NUMERO_SID.ToString() + "-" + resultadoExpediente.NUMERO_ANIO;
                            }
                            else
                            {
                                codResultado = 0;
                                desResultado = "Ocurrio un error en el registro del trámite.(ERR4)";
                                scope.Dispose();
                                Conexion.finalizar(ref bdConn);
                            }
                        }
                        catch (Exception ex)
                        {
                            codResultado = 0;
                            desResultado = "Ocurrio un error en la carga de archivos.(ERR3)";
                            resultadoex  = ex.Message;
                            scope.Dispose();
                            Conexion.finalizar(ref bdConn);
                        }
                        //codAuxiliar = registroTramite.CodAuxiliar;
                    }
                    else
                    {
                        codResultado = 0;
                        desResultado = "Ocurrió un error en el registro del trámite.";
                        scope.Dispose();
                        Conexion.finalizar(ref bdConn);
                    }
                }
                catch (Exception ex)
                {
                    codResultado = 0;
                    desResultado = "Ocurrió un error en el registro del trámite.(ERR2)";
                    resultadoex  = ex.Message;
                    scope.Dispose();
                    Conexion.finalizar(ref bdConn);
                }
            }
            return(Json(new {
                codResultado = codResultado,
                desResultado = desResultado,
                codAuxiliar = codAuxiliar,
                resultadoex = resultadoex
            }));
        }
コード例 #11
0
        public ExpedienteBLLTests()
        {
            var lista = new List <Expediente>
            {
                new Expediente()
                {
                    ExpedienteId             = 1,
                    Cuantia                  = 525000,
                    Descripcion              = "Esto es una descripcion",
                    DireccionEjecutado       = "Esto es una direccion",
                    DireccionTituloEjecutivo = "Esto es una direcciond e titulo ejecutivo",
                    EntidadEncargada         = "Entidad encargada es maira",
                    FechaRadicacion          = new DateTime(2017, 03, 19),
                    Identificacion           = "1065824563",
                    NaturalezaObligacion     = "Naturaleza es algo",
                    Nombre = "Maira mindiola",
                    UbicacionExpediente = "Esta en el lote tal",
                },
                new Expediente()
                {
                    ExpedienteId             = 2,
                    Cuantia                  = 525000,
                    Descripcion              = "Esto es una descripcion",
                    DireccionEjecutado       = "Esto es una direccion",
                    DireccionTituloEjecutivo = "Esto es una direcciond e titulo ejecutivo",
                    EntidadEncargada         = "Entidad encargada es maira",
                    FechaRadicacion          = new DateTime(2017, 03, 19),
                    Identificacion           = "1065824563",
                    NaturalezaObligacion     = "Naturaleza es algo",
                    Nombre = "Maira mindiola",
                    UbicacionExpediente = "Esta en el lote tal",
                },
                new Expediente()
                {
                    ExpedienteId             = 3,
                    Cuantia                  = 555000,
                    Descripcion              = "Esto es una descripcion",
                    DireccionEjecutado       = "Esto es una direccion",
                    DireccionTituloEjecutivo = "Esto es una direcciond e titulo ejecutivo",
                    EntidadEncargada         = "Entidad encargada es maira",
                    FechaRadicacion          = new DateTime(2017, 03, 19),
                    Identificacion           = "1065824563",
                    NaturalezaObligacion     = "Naturaleza es algo",
                    Nombre = "Maira mindiola",
                    UbicacionExpediente = "Esta en el lote tal",
                }
            };
            var dbContext = new Mock <ApplicationDbContext>();
            var data      = lista.AsQueryable();

            var mockSet = new Mock <DbSet <Expediente> >();

            mockSet.As <IQueryable <Expediente> >().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As <IQueryable <Expediente> >().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As <IQueryable <Expediente> >().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As <IQueryable <Expediente> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());

            var mockContext = new Mock <ApplicationDbContext>();

            mockContext.Setup(c => c.Expedientes).Returns(mockSet.Object);

            servicio = new ExpedienteBLL(mockContext.Object);
        }
コード例 #12
0
        private void ExportarExcelPlantilla(System.Web.HttpResponse Response)
        {
            ExpedienteBLL capanegocios = new ExpedienteBLL();
            ExpedienteBE  objeto       = new ExpedienteBE();

            DataTable dtExpediente = new DataTable();

            try
            {
                if (txtFilExpediente.Text.Trim() != string.Empty)
                {
                    objeto.CodigoExpediente = txtFilExpediente.Text.Trim();
                }
                else
                {
                    objeto.CodigoExpediente = "*";
                }

                if (txtFilCotizacion.Text.Trim() != string.Empty)
                {
                    objeto.CodigoCotizacion = txtFilCotizacion.Text.Trim();
                }
                else
                {
                    objeto.CodigoCotizacion = "*";
                }

                objeto.IdTipoCliente = Convert.ToInt32(ddlFilTipoCliente.SelectedValue);

                if (txtFilCliente.Text.Trim() != string.Empty)
                {
                    objeto.Cliente = txtFilCliente.Text.Trim();
                }
                else
                {
                    objeto.Cliente = "*";
                }

                objeto.Producto = txtFilProducto.Text.Trim();

                if (txtFilFecCotiz.Text == string.Empty)
                {
                    objeto.FechaCotizacion = Convert.ToDateTime(doMain.Utils.FechaNulaUtils.FechaNula());
                }
                else
                {
                    objeto.FechaCotizacion = Convert.ToDateTime(txtFilFecCotiz.Text);
                }

                objeto.IdEstado      = Convert.ToInt32(ddlFilEstado.SelectedValue);
                objeto.IdEnsayo      = Convert.ToInt32(ddlFilEnsayo.SelectedValue);
                objeto.IdAnalista    = Convert.ToInt32(ddlFilAnalista.SelectedValue);
                objeto.IdProcedencia = Convert.ToInt32(ddlFilProcede.SelectedValue);

                var lstExpediente = new ExpedienteBLL().ExportExpediente(objeto);

                //crear datatable para enviar al metodo de descarga
                var dataTableDescargar = new System.Data.DataTable(Guid.NewGuid().ToString());
                var Expediente         = new DataColumn("Expediente", typeof(string));
                var Cotizacion         = new DataColumn("Cotizacion", typeof(string));
                var FechaCotizacion    = new DataColumn("FechaCotizacion", typeof(string));
                var Cliente            = new DataColumn("Cliente", typeof(string));
                var TipoCliente        = new DataColumn("TipoCliente", typeof(string));
                var Producto           = new DataColumn("Producto", typeof(string));
                var Lote            = new DataColumn("Lote", typeof(string));
                var Correo          = new DataColumn("Correo", typeof(string));
                var DocumentoFisico = new DataColumn("DocumentoFisico", typeof(string));
                var DocumentoAnexo  = new DataColumn("DocumentoAnexo", typeof(string));
                var Ubicacion       = new DataColumn("Ubicacion", typeof(string));
                var Estado          = new DataColumn("Estado", typeof(string));
                var Ensayo          = new DataColumn("Ensayo", typeof(string));
                var Analista        = new DataColumn("Analista", typeof(string));
                var Procede         = new DataColumn("Procede", typeof(string));
                var Situacion       = new DataColumn("Situacion", typeof(string));
                var MotivoAnulacion = new DataColumn("MotivoAnulacion", typeof(string));

                dataTableDescargar.Columns.AddRange(new DataColumn[] {
                    Expediente, Cotizacion, FechaCotizacion, Cliente, TipoCliente, Producto, Lote, Correo, DocumentoFisico, DocumentoAnexo, Ubicacion, Estado, Ensayo, Analista, Procede, Situacion, MotivoAnulacion
                });

                //Llenar data al datatable
                foreach (ExpedienteBE oExpediente in lstExpediente)
                {
                    DataRow RowFile = dataTableDescargar.NewRow();

                    RowFile["Expediente"] = oExpediente.CodigoExpediente;
                    RowFile["Cotizacion"] = oExpediente.CodigoCotizacion;

                    if (oExpediente.FechaCotizacion != Convert.ToDateTime("01/01/1901"))
                    {
                        RowFile["FechaCotizacion"] = string.Format("{0:d}", oExpediente.FechaCotizacion);
                    }
                    else
                    {
                        RowFile["FechaCotizacion"] = string.Empty;
                    }

                    RowFile["Cliente"]         = oExpediente.Cliente;
                    RowFile["TipoCliente"]     = oExpediente.TipoCliente;
                    RowFile["Producto"]        = oExpediente.Producto;
                    RowFile["Lote"]            = oExpediente.Lote;
                    RowFile["Correo"]          = oExpediente.Correo;
                    RowFile["DocumentoFisico"] = oExpediente.DocumentoFisico;
                    RowFile["DocumentoAnexo"]  = oExpediente.DocumentoAnexo;
                    RowFile["Ubicacion"]       = oExpediente.Usuario.Login;
                    RowFile["Estado"]          = oExpediente.Estado;
                    RowFile["Ensayo"]          = oExpediente.Ensayo.Nombre;
                    RowFile["Analista"]        = oExpediente.Evaluador.Nombre;
                    RowFile["Procede"]         = oExpediente.Evaluacion.Procede;
                    RowFile["Situacion"]       = oExpediente.Situacion;
                    RowFile["MotivoAnulacion"] = oExpediente.MotivoAnulacion;

                    dataTableDescargar.Rows.Add(RowFile);
                }

                ExportarUtils ObjExporExcel = new ExportarUtils();

                object[] pNombreCabeceras = new object[] { "Expediente", "Cotizacion", "Fecha Cotizacion", "Cliente", "Tipo Cliente", "Producto", "Lote", "Correo", "Documento Fisico", "Documento Anexo", "Ubicacion", "Estado", "Ensayo", "Analista", "Procede", "Situacion", "Motivo Anulacion" };
                object[] pEstilos         = new object[] { new object[] { 3, OleDbType.Date } };
                string   MessageOut       = ObjExporExcel.DescargarDataTableToExcel(dataTableDescargar, "Archivo Seguimiento Expediente", pNombreCabeceras, pEstilos, Page.Response);

                if (MessageOut != "OK")
                {
                    //objMsgBox.MsgBoxCC(lblMensaje, MessageOut, "Error");
                }
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }
コード例 #13
0
        public List <ExpedienteDTO> GetExpedientes()
        {
            ExpedienteBLL expediente = new ExpedienteBLL();

            return(expediente.GetExpedientes());
        }