private void frmRegSolicitudEPSEdit_Load(object sender, EventArgs e)
        {
            deFecha.EditValue = DateTime.Now;

            if (pOperacion == Operacion.Nuevo)
            {
                this.Text = "Registro Solicitud de Información de EPS - Nuevo ";
            }
            else if (pOperacion == Operacion.Modificar)
            {
                this.Text = "Registro Solicitud de Información de EPS - Modificar ";
                SolicitudBE objE_Solicitud = null;
                objE_Solicitud = new SolicitudBL().Selecciona(IdSolicitud);
                if (objE_Solicitud != null)
                {
                    IdSolicitud          = objE_Solicitud.IdSolicitud;
                    deFecha.EditValue    = objE_Solicitud.Fecha;
                    txtNumero.Text       = objE_Solicitud.Numero;
                    intIdSolicitante     = objE_Solicitud.IdPersona;
                    txtSolicitante.Text  = objE_Solicitud.Solicitante;
                    intIdEmpresa         = objE_Solicitud.IdEmpresa;
                    intIdUnidadMinera    = objE_Solicitud.IdUnidadMinera;
                    intIdArea            = objE_Solicitud.IdArea;
                    txtEmpresa.Text      = objE_Solicitud.RazonSocial;
                    txtUnidadMinera.Text = objE_Solicitud.DescUnidadMinera;
                    txtArea.Text         = objE_Solicitud.DescArea;
                    txtCargo.Text        = objE_Solicitud.Cargo;
                }
            }
        }
Esempio n. 2
0
        private void tlbMenu_DeleteClick()
        {
            try
            {
                Cursor = Cursors.WaitCursor;
                if (XtraMessageBox.Show("Esta seguro de anular la solicitud de EPS?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    int intIdSolicitud = int.Parse(gvSolicitud.GetFocusedRowCellValue("IdSolicitud").ToString());
                    int intIdSituacion = int.Parse(gvSolicitud.GetFocusedRowCellValue("IdSituacion").ToString());

                    if (intIdSituacion == Parametros.intSCEPSGenerada)
                    {
                        SolicitudBL objBL_Solicitud = new SolicitudBL();
                        objBL_Solicitud.ActualizaSituacion(intIdSolicitud, Parametros.intSCEPSAnulada);
                        XtraMessageBox.Show("La solicitud de EPS se anuló correctamente", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        Cargar();
                    }
                    else
                    {
                        XtraMessageBox.Show("No se puede anular una solicitud diferente al Estado Generada", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                Cursor = Cursors.Default;
                XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 3
0
        public ObtenerSolicitudResponseDTO ObtenerSolicitud(ObtenerSolicitudRequestDTO request)
        {
            ObtenerSolicitudResponseDTO response = new ObtenerSolicitudResponseDTO();

            try
            {
                var solicitudBL = new SolicitudBL();
                response = solicitudBL.ObtenerSolicitud(request);


                return(response);
            }
            catch (ResultException ex)
            {
                ManejadorExcepciones.PublicarExcepcion(string.Format("{0}: {1}", MethodBase.GetCurrentMethod().Name, ex.Result.Mensaje));
                ex.Result.Satisfactorio = false;
                response.Result         = ex.Result;

                return(response);
            }
            catch (Exception ex)
            {
                ManejadorExcepciones.PublicarExcepcion(ex, PoliticaExcepcion.ServicioWCF);
                response.Result = new Result {
                    Satisfactorio = false, Mensaje = "Ocurrio un problema interno en el servicio", IdError = Guid.NewGuid()
                };

                return(response);
            }
        }
 protected void btnRecurso_Click(object sender, EventArgs e)
 {
     try
     {
         Database1Entities1 db = new Database1Entities1();
         SolicitudBL        sl = new SolicitudBL();
         ResponsableBL      rs = new ResponsableBL();
         List <Responsable> ls = new List <Responsable>();
         Responsable        r  = new Responsable();
         if (TxtNombreSolicitante.Text.Trim().Equals("") || TxtFechaSolicitud.Text.Trim().Equals("") || TxtDescripcionSolicitud.Text.Trim().Equals(""))
         {
             return;
         }
         else
         {
             sl.AgregarSolicitud(TxtNombreSolicitante.Text.Trim(), Convert.ToDateTime(TxtFechaSolicitud), TimeSpan.Parse(comboxHoraSolicitud.SelectedItem.Text), comboxGruaSolicitud.SelectedItem.Text, TxtDescripcionSolicitud.Text.Trim(), "Por Determinar");
             TxtDescripcionSolicitud.Text = "";
             TxtFechaSolicitud.Text       = "";
             TxtNombreSolicitante.Text    = "";
             Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('Solicitud Enviada');</script>");
         }
     }
     catch (Exception es)
     {
         LbMensaje.Text = es.Message.ToString();
     }
 }
Esempio n. 5
0
        public ConsultarSolicitudResponseDTO ConsultarSolicitud(ConsultarSolicitudRequestDTO request)
        {
            ManejadorLog manejadorLog = new ManejadorLog();

            manejadorLog.GrabarLog(request.FechaFin.ToString());
            manejadorLog.GrabarLog(request.FechaFin.ToString());

            ConsultarSolicitudResponseDTO result = new ConsultarSolicitudResponseDTO();

            try
            {
                SolicitudBL solicitud = new SolicitudBL();
                result = solicitud.ConsultarSolicitud(request);
            }
            catch (ResultException ex)
            {
                ManejadorExcepciones.PublicarExcepcion(string.Format("{0}: {1}", MethodBase.GetCurrentMethod().Name,
                                                                     ex.Result.Mensaje));
                ex.Result.Satisfactorio = false;
                result.Result           = ex.Result;
            }
            catch (Exception ex)
            {
                ManejadorExcepciones.PublicarExcepcion(ex, PoliticaExcepcion.ServicioWCF);
                result.Result = new Result
                {
                    Satisfactorio = false,
                    Mensaje       = "Ocurrio un problema interno en el servicio",
                    IdError       = Guid.NewGuid()
                };
            }
            return(result);
        }
Esempio n. 6
0
        private void CargarDatos()
        {
            try
            {
                SolicitudBE oEntity = new SolicitudBE();
                oEntity.OPCION      = 1;
                oEntity.USUARIO     = General.General.GetCodigoUsuario;
                oEntity.IdSolicitud = Codigo;
                DataSet ds = new SolicitudBL().ProcesarSolicitud(oEntity);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    txtIdSolicitud.Text            = ds.Tables[0].Rows[0]["IdSolicitud"].ToString();
                    dtSolicitud.Value              = Convert.ToDateTime(ds.Tables[0].Rows[0]["dtSolicitud"].ToString());
                    txtIdArea_tt_Dsc.Text          = ds.Tables[0].Rows[0]["IdArea_tt_Dsc"].ToString();
                    txtIdTipoSolicitud_tt_Dsc.Text = ds.Tables[0].Rows[0]["IdTipoSolicitud_tt_Dsc"].ToString();
                    txtIdSocio.Text              = ds.Tables[0].Rows[0]["IdSocio"].ToString();
                    txtcRucSocio.Text            = ds.Tables[0].Rows[0]["cRucSocio"].ToString();
                    txtRazonSocialSocio.Text     = ds.Tables[0].Rows[0]["vRazonSocialSocio"].ToString();
                    txtvConyugue.Text            = ds.Tables[0].Rows[0]["vConyugue"].ToString();
                    txtvConyugueDNI.Text         = ds.Tables[0].Rows[0]["vConyugueDNI"].ToString();
                    txtvConyugueDomicilio.Text   = ds.Tables[0].Rows[0]["vConyugueDomicilio"].ToString();
                    txtNroPartidaSB.Text         = ds.Tables[0].Rows[0]["NroPartidaSB"].ToString();
                    dtNroPartidaDB.Value         = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["dtNroPartidaDB"].ToString()) ? DateTime.MinValue : Convert.ToDateTime(ds.Tables[0].Rows[0]["dtNroPartidaDB"].ToString());
                    txtIdPagadora.Text           = ds.Tables[0].Rows[0]["IdPagadora"].ToString();
                    txtcRucPagadora.Text         = ds.Tables[0].Rows[0]["cRucPagadora"].ToString();
                    txtvRazonSocialPagadora.Text = ds.Tables[0].Rows[0]["vRazonSocialPagadora"].ToString();
                    txtIdMoneda_tt_Dsc.Text      = ds.Tables[0].Rows[0]["IdMoneda_tt_Dsc"].ToString();
                    txtnImporte.Text             = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["nImporte"].ToString()) ? "0" : Convert.ToDecimal(ds.Tables[0].Rows[0]["nImporte"].ToString()).ToString("N2");
                    txtnTEA.Text                = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["nTEA"].ToString()) ? "0" : Convert.ToDecimal(ds.Tables[0].Rows[0]["nTEA"].ToString()).ToString("N2");
                    txtnTEAMinDol.Text          = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["nTEAMinDol"].ToString()) ? "0" : Convert.ToDecimal(ds.Tables[0].Rows[0]["nTEAMinDol"].ToString()).ToString("N2");
                    txtnTEAMaxSol.Text          = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["nTEAMaxSol"].ToString()) ? "0" : Convert.ToDecimal(ds.Tables[0].Rows[0]["nTEAMaxSol"].ToString()).ToString("N2");
                    txtnTEAMaxDol.Text          = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["nTEAMaxDol"].ToString()) ? "0" : Convert.ToDecimal(ds.Tables[0].Rows[0]["nTEAMaxDol"].ToString()).ToString("N2");
                    txtiPlazo.Text              = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["iPlazo"].ToString()) ? "0" : ds.Tables[0].Rows[0]["iPlazo"].ToString();
                    dtVencimiento.Value         = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["dtVencimiento"].ToString()) ? DateTime.MinValue : Convert.ToDateTime(ds.Tables[0].Rows[0]["dtVencimiento"].ToString());
                    txtvDomicilioRealPag.Text   = ds.Tables[0].Rows[0]["vDomicilioRealPag"].ToString();
                    txtvDomicilioLegalPag.Text  = ds.Tables[0].Rows[0]["vDomicilioLegalPag"].ToString();
                    txtvPartidaElectronica.Text = ds.Tables[0].Rows[0]["vPartidaElectronica"].ToString();
                    txtvDomicilioRealSoc.Text   = ds.Tables[0].Rows[0]["vDomicilioRealSoc"].ToString();
                    txtvDomicilioAnexoSoc.Text  = ds.Tables[0].Rows[0]["vDomicilioAnexoSoc"].ToString();
                    txtvObjetoSocial.Text       = ds.Tables[0].Rows[0]["vObjetoSocial"].ToString();
                    txtvCapSocialSoc.Text       = ds.Tables[0].Rows[0]["vCapSocialSoc"].ToString();
                    ChkIncluyeLC.Checked        = ds.Tables[0].Rows[0]["FlgLetraCambio"].ToString().Equals("1") ? true: false;

                    if (ds.Tables[0].Rows[0]["FlgDefinitivo"].ToString().Equals("1"))
                    {
                        btnGenerarDefinitivo.Visible = false;
                        btnGenerarFormatos.Text      = "Descargar Formatos";
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 7
0
        private void btnGenerarDefinitivo_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = 0;

            try
            {
                DataSet     dsDatos      = new DataSet();
                SolicitudBE oEntityDatos = new SolicitudBE();
                oEntityDatos.USUARIO     = General.General.GetCodigoUsuario;
                oEntityDatos.OPCION      = 14;
                oEntityDatos.IdSolicitud = txtIdSolicitud.Text;
                dsDatos = new SolicitudBL().ProcesarSolicitud(oEntityDatos);

                DataSet     ds      = new DataSet();
                SolicitudBE oEntity = new SolicitudBE();
                oEntity.USUARIO     = General.General.GetCodigoUsuario;
                oEntity.OPCION      = 12;
                oEntity.IdSolicitud = txtIdSolicitud.Text;
                ds = new SolicitudBL().ProcesarSolicitud(oEntity);

                string filepath = ConfigurationManager.AppSettings["RutaImageFisical"].ToString() + "//LegalSistemas//" + txtcRucSocio.Text.Trim() + "//Contratos//";

                if (ds.Tables.Count > 0)
                {
                    dialogResult = MessageBox.Show("¿Usted está seguro de generar los formatos definitivamente?", "Confirme", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (dialogResult == DialogResult.Yes)
                    {
                        foreach (DataRow dr in ds.Tables[0].Rows)
                        {
                            General.WordDocumentWrite WD = new General.WordDocumentWrite();
                            WD.WordDocument(dr["Archivo"].ToString(), filepath);

                            foreach (DataColumn dc in dsDatos.Tables[0].Columns)
                            {
                                WD.FindAndReplace(dc.ColumnName.ToString(), dsDatos.Tables[0].Rows[0][dc.ColumnName].ToString());
                            }

                            WD.SaveDocument();
                            WD.CloseDocument();
                        }
                        MessageBox.Show("Los formatos se generarón correctamente en la ruta: " + filepath, "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 8
0
        private void CargarDatos()
        {
            try
            {
                SolicitudBE oEntity = new SolicitudBE();
                oEntity.OPCION      = 1;
                oEntity.USUARIO     = General.General.GetCodigoUsuario;
                oEntity.IdSolicitud = Codigo;
                DataSet ds = new SolicitudBL().ProcesarSolicitud(oEntity);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    dtSolicitud.Value                   = Convert.ToDateTime(ds.Tables[0].Rows[0]["dtSolicitud"].ToString());
                    cboIdArea_tt.SelectedValue          = ds.Tables[0].Rows[0]["IdArea_tt"].ToString();
                    cboIdTipoSolicitud_tt.SelectedValue = ds.Tables[0].Rows[0]["IdTipoSolicitud_tt"].ToString();
                    txtcRucSocio.Text                   = ds.Tables[0].Rows[0]["cRucSocio"].ToString();
                    txtRazonSocialSocio.Text            = ds.Tables[0].Rows[0]["vRazonSocialSocio"].ToString();
                    txtvConyugue.Text                   = ds.Tables[0].Rows[0]["vConyugue"].ToString();
                    txtvConyugueDNI.Text                = ds.Tables[0].Rows[0]["vConyugueDNI"].ToString();
                    txtvConyugueDomicilio.Text          = ds.Tables[0].Rows[0]["vConyugueDomicilio"].ToString();
                    txtNroPartidaSB.Text                = ds.Tables[0].Rows[0]["NroPartidaSB"].ToString();
                    dtNroPartidaDB.Value                = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["dtNroPartidaDB"].ToString()) ? DateTime.MinValue : Convert.ToDateTime(ds.Tables[0].Rows[0]["dtNroPartidaDB"].ToString());
                    txtcRucPagadora.Text                = ds.Tables[0].Rows[0]["cRucPagadora"].ToString();
                    txtvRazonSocialPagadora.Text        = ds.Tables[0].Rows[0]["vRazonSocialPagadora"].ToString();
                    //cboIdTipoLinea_tt.SelectedValue = !string.IsNullOrEmpty(ds.Tables[0].Rows[0]["IdTipoLinea_tt"].ToString()) ? ds.Tables[0].Rows[0]["IdTipoLinea_tt"].ToString() : string.Empty;
                    cboIdMoneda_tt.SelectedValue = !string.IsNullOrEmpty(ds.Tables[0].Rows[0]["IdMoneda_tt"].ToString()) ? ds.Tables[0].Rows[0]["IdMoneda_tt"].ToString() : string.Empty;
                    txtnImporte.Text             = !string.IsNullOrEmpty(ds.Tables[0].Rows[0]["nImporte"].ToString()) ? "0" : Convert.ToDecimal(ds.Tables[0].Rows[0]["nImporte"].ToString()).ToString("N2");
                    txtnTEA.Text         = !string.IsNullOrEmpty(ds.Tables[0].Rows[0]["nTEA"].ToString()) ? "0" : Convert.ToDecimal(ds.Tables[0].Rows[0]["nTEA"].ToString()).ToString("N2");
                    txtiPlazo.Text       = !string.IsNullOrEmpty(ds.Tables[0].Rows[0]["iPlazo"].ToString()) ? "0" : ds.Tables[0].Rows[0]["iPlazo"].ToString();
                    dtVencimiento.Value  = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["dtVencimiento"].ToString()) ? DateTime.MinValue : Convert.ToDateTime(ds.Tables[0].Rows[0]["dtVencimiento"].ToString());
                    ChkIncluyeLC.Checked = ds.Tables[0].Rows[0]["FlgLetraCambio"].ToString().Equals("1") ? true : false;

                    if (!ds.Tables[0].Rows[0]["IdEstado_tt"].ToString().Equals("00312"))
                    {
                        btnAceptar.Visible                 = false;
                        btnGuardarEnviarLegal.Visible      = false;
                        btnAgregarDocumentoPagador.Visible = false;
                        btnAgregarDocumentoSocio.Visible   = false;
                    }

                    cboIdTipoSolicitud_tt.Enabled = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     try
     {
         SolicitudBE oEntity = new SolicitudBE();
         oEntity.OPCION           = 10;
         oEntity.USUARIO          = General.General.GetCodigoUsuario;
         oEntity.dtSolicitud      = dtSolicitudInput.Value;
         oEntity.FlgVerHistoricos = chkVerHistoricos.Checked ? 1 : 0;
         DataSet ds = new SolicitudBL().ProcesarSolicitud(oEntity);
         dgvSolicitud.DataSource = ds.Tables[0];
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 10
0
        private void CargarDatos()
        {
            try
            {
                SolicitudBE oEntity = new SolicitudBE();
                oEntity.USUARIO      = General.General.GetCodigoUsuario;
                oEntity.OPCION       = 8;
                oEntity.IdSolicitud  = Codigo;
                oEntity.cRucPagadora = _RUC;
                oEntity.cRucSocio    = _RUC;

                DataSet ds = new SolicitudBL().ProcesarSolicitud(oEntity);
                dgvSolicitud.DataSource = ds.Tables[0];
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 11
0
        private void btnGenerarFormatos_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet     dsDatos      = new DataSet();
                SolicitudBE oEntityDatos = new SolicitudBE();
                oEntityDatos.USUARIO     = General.General.GetCodigoUsuario;
                oEntityDatos.OPCION      = 13;
                oEntityDatos.IdSolicitud = txtIdSolicitud.Text;
                dsDatos = new SolicitudBL().ProcesarSolicitud(oEntityDatos);

                DataSet     ds      = new DataSet();
                SolicitudBE oEntity = new SolicitudBE();
                oEntity.USUARIO     = General.General.GetCodigoUsuario;
                oEntity.OPCION      = 12;
                oEntity.IdSolicitud = txtIdSolicitud.Text;
                ds = new SolicitudBL().ProcesarSolicitud(oEntity);

                if (ds.Tables.Count > 0)
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        General.WordDocumentWrite WD = new General.WordDocumentWrite();
                        WD.WordDocument(dr["Archivo"].ToString(), ConfigurationManager.AppSettings["RutaPCUsertTmp"].ToString());

                        foreach (DataColumn dc in dsDatos.Tables[0].Columns)
                        {
                            WD.FindAndReplace(dc.ColumnName.ToString(), dsDatos.Tables[0].Rows[0][dc.ColumnName].ToString());
                        }

                        WD.SaveDocument();
                        WD.CloseDocument();
                    }

                    MessageBox.Show("Los formatos se generarón correctamente en la ruta: " + ConfigurationManager.AppSettings["RutaPCUsertTmp"].ToString(), "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 12
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     try
     {
         SolicitudBE oEntity = new SolicitudBE();
         oEntity.OPCION             = Opcion;
         oEntity.USUARIO            = General.General.GetCodigoUsuario;
         oEntity.dtSolicitud        = dtSolicitudInput.Value;
         oEntity.IdEstado_tt        = cboIdEstado_tt.SelectedValue.ToString(); //FlgLegal == 0 ? "00312" : "00313";
         oEntity.IdPersonaSolicitud = cboIdPersonaSolicitud.SelectedValue.ToString().Equals("<<Todos>>") ? string.Empty : cboIdPersonaSolicitud.SelectedValue.ToString();
         oEntity.FlgVerHistoricos   = chkVerHistoricos.Checked ? 1 : 0;
         oEntity.vRazonSocialSocio  = txtvRazonSocialSocio.Text;
         DataSet ds = new SolicitudBL().ProcesarSolicitud(oEntity);
         dgvSolicitud.DataSource = ds.Tables[0];
         lblRegistros.Text       = dgvSolicitud.Rows.Count + " registro(s)";
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 13
0
        private void ConsultarDatosConyugue(string IdSocio)
        {
            try
            {
                DataSet     ds      = new DataSet();
                SolicitudBE IEntity = new SolicitudBE();
                IEntity.OPCION  = 15;
                IEntity.IdSocio = IdSocio;
                ds = new SolicitudBL().ProcesarSolicitud(IEntity);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    txtvConyugue.Text          = ds.Tables[0].Rows[0]["nombreCompleto"].ToString();
                    txtvConyugueDNI.Text       = ds.Tables[0].Rows[0]["perNumDoc"].ToString();
                    txtvConyugueDomicilio.Text = ds.Tables[0].Rows[0]["dirDireccion"].ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 14
0
        public RegistrarSolicitudResponseDTO RegistrarSolicitud(RegistrarSolicitudRequestDTO request)
        {
            RegistrarSolicitudResponseDTO response = new RegistrarSolicitudResponseDTO();

            try
            {
                //Newtonsoft.Json.JsonConvert.SerializeObject(request);
                var solicitudBL = new SolicitudBL();
                response = solicitudBL.RegistraSolicitud(request);
            }
            catch (Exception ex)
            {
                ManejadorExcepciones.PublicarExcepcion(ex, PoliticaExcepcion.ServicioWCF);
                response.Result = new Result
                {
                    Satisfactorio = false,
                    Mensaje       = "Ocurrio un problema interno en el servicio",
                    IdError       = Guid.NewGuid()
                };
            }
            return(response);
        }
Esempio n. 15
0
        private bool GuardarSolicitud()
        {
            bool bResult = true;

            try
            {
                if (dtSolicitud.Value == DateTime.MinValue)
                {
                    MessageBox.Show("Se debe ingresar una fecha", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }

                if (string.IsNullOrEmpty(cboIdArea_tt.SelectedValue.ToString()))
                {
                    MessageBox.Show("Se debe seleccionar una área", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }

                if (string.IsNullOrEmpty(cboIdTipoSolicitud_tt.SelectedValue.ToString()))
                {
                    MessageBox.Show("Se debe seleccionar el tipo de solicitud", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }

                if (string.IsNullOrEmpty(txtcRucSocio.Text) && cboIdTipoSolicitud_tt.SelectedValue.ToString() != "00300") //00300 Estudio Poderes Pagadora
                {
                    MessageBox.Show("Ingrese el número de documento del socio", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }

                if (string.IsNullOrEmpty(txtRazonSocialSocio.Text) && cboIdTipoSolicitud_tt.SelectedValue.ToString() != "00300") //00300 Estudio Poderes Pagadora
                {
                    MessageBox.Show("Ingrese un socio", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }

                if (string.IsNullOrEmpty(txtcRucPagadora.Text) && cboIdTipoSolicitud_tt.SelectedValue.ToString() != "00365") //00365 Estudio Poderes Socio
                {
                    MessageBox.Show("Ingrese el número de documento de la pagadora", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }

                if (string.IsNullOrEmpty(txtvRazonSocialPagadora.Text) && cboIdTipoSolicitud_tt.SelectedValue.ToString() != "00365") //00365 Estudio Poderes Socio
                {
                    MessageBox.Show("Ingrese una pagadora", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }

                //00300	Estudio Poderes Pagadora || 00365	Estudio Poderes Socio
                if (cboIdTipoSolicitud_tt.SelectedValue.ToString() != "00300" && cboIdTipoSolicitud_tt.SelectedValue.ToString() != "00365")
                {
                    if (string.IsNullOrEmpty(cboIdMoneda_tt.SelectedValue.ToString()))
                    {
                        MessageBox.Show("Seleccione una moneda", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return(false);
                    }

                    if (string.IsNullOrEmpty(txtnImporte.Text))
                    {
                        MessageBox.Show("Ingrese el importe de la operacion", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return(false);
                    }
                }

                /*
                 * if (string.IsNullOrEmpty(txtnTEA.Text))
                 * {
                 *  MessageBox.Show("Ingrese la TEA de la operacion", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 *  return false;
                 * }
                 *
                 * if (string.IsNullOrEmpty(txtiPlazo.Text))
                 * {
                 *  MessageBox.Show("Ingrese el plazo de la operacion", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 *  return false;
                 * }
                 *
                 * if (dtVencimiento.Value == DateTime.MinValue)
                 * {
                 *  MessageBox.Show("Se debe ingresar una fecha de vencimiento de la operación", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 *  return false;
                 * }*/

                SolicitudBE oEntity = new SolicitudBE();
                oEntity.OPCION               = 2;
                oEntity.USUARIO              = General.General.GetCodigoUsuario;
                oEntity.IdSolicitud          = Codigo;
                oEntity.dtSolicitud          = dtSolicitud.Value;
                oEntity.IdPersonaSolicitud   = General.General.GetCodigoUsuario;
                oEntity.IdArea_tt            = cboIdArea_tt.SelectedValue.ToString();
                oEntity.IdTipoSolicitud_tt   = cboIdTipoSolicitud_tt.SelectedValue.ToString();
                oEntity.cRucSocio            = txtcRucSocio.Text;
                oEntity.vRazonSocialSocio    = txtRazonSocialSocio.Text;
                oEntity.vConyugue            = txtvConyugue.Text;
                oEntity.vConyugueDNI         = txtvConyugueDNI.Text;
                oEntity.vConyugueDomicilio   = txtvConyugueDomicilio.Text;
                oEntity.NroPartidaSB         = txtNroPartidaSB.Text;
                oEntity.dtNroPartidaDB       = dtNroPartidaDB.Value;
                oEntity.cRucPagadora         = txtcRucPagadora.Text.Trim();
                oEntity.vRazonSocialPagadora = txtvRazonSocialPagadora.Text;
                //oEntity.IdTipoLinea_tt = cboIdTipoLinea_tt.SelectedValue.ToString();
                oEntity.IdMoneda_tt    = cboIdMoneda_tt.SelectedValue.ToString();
                oEntity.nImporte       = string.IsNullOrEmpty(txtnImporte.Text)? 0 : Convert.ToDecimal(txtnImporte.Text);
                oEntity.nTEA           = string.IsNullOrEmpty(txtnTEA.Text) ? 0 : Convert.ToDecimal(txtnTEA.Text);
                oEntity.iPlazo         = string.IsNullOrEmpty(txtiPlazo.Text) ? 0 : int.Parse(txtiPlazo.Text);
                oEntity.iPlanPago      = 0;
                oEntity.dtVencimiento  = dtVencimiento.Value;
                oEntity.FlgLetraCambio = ChkIncluyeLC.Checked ? 1 : 0;
                DataSet ds = new SolicitudBL().ProcesarSolicitud(oEntity);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    Codigo = ds.Tables[0].Rows[0]["IdSolicitud"].ToString();
                    txtIdSolicitud.Text = Codigo;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(bResult);
        }
 public SolicitudService()
 {
     solicitudBL = new SolicitudBL();
 }
        private void btnGrabar_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor = Cursors.WaitCursor;
                if (!ValidarIngreso())
                {
                    SolicitudBE objSolicitud    = new SolicitudBE();
                    SolicitudBL objBL_Solicitud = new SolicitudBL();

                    objSolicitud.IdSolicitud    = IdSolicitud;
                    objSolicitud.IdEmpresa      = intIdEmpresa;
                    objSolicitud.IdUnidadMinera = intIdUnidadMinera;
                    objSolicitud.IdArea         = intIdArea;
                    objSolicitud.Numero         = txtNumero.Text;
                    objSolicitud.IdPersona      = intIdSolicitante;
                    objSolicitud.Solicitante    = txtSolicitante.Text;
                    objSolicitud.Cargo          = txtCargo.Text;
                    objSolicitud.Fecha          = Convert.ToDateTime(deFecha.DateTime.ToShortDateString());
                    objSolicitud.IdSituacion    = Parametros.intSCEPSGenerada;
                    objSolicitud.FlagEstado     = true;
                    objSolicitud.Usuario        = Parametros.strUsuarioLogin;
                    objSolicitud.Maquina        = WindowsIdentity.GetCurrent().Name.ToString();

                    if (pOperacion == Operacion.Nuevo)
                    {
                        int    intNumero = 0;
                        string strNumero = "";
                        intNumero      = objBL_Solicitud.Inserta(objSolicitud);
                        strNumero      = FuncionBase.AgregarCaracter(intNumero.ToString(), "0", 7);
                        txtNumero.Text = strNumero;

                        //ActualizaNumero
                        SolicitudBL objBSolicitud = new SolicitudBL();
                        objBSolicitud.ActualizaNumero(intNumero, txtNumero.Text);

                        StringBuilder strMensaje = new StringBuilder();
                        strMensaje.Append("********************************************************************************************************************************************************************************************\n\n");
                        strMensaje.Append("Se Generó el N° de Solicitud de Información de EPS : " + strNumero + "\n\n");
                        strMensaje.Append("Se adjunta información acerca de la EPS (Plan de Salud y Boletín Informativo) así como los formatos para afiliación, los mismos que deberán ser llenados y firmados por el solicitante. Presentar al Área de Bienestar Seguridad y Salud en el Trabajo" + "\n");
                        strMensaje.Append("hasta el 24 del presente, para que la vigencia inicie el primer día del mes siguiente (si los documentos se presentan luego del día 24, la vigencia demorará un mes más)." + "\n\n");
                        strMensaje.Append("Adjuntar:" + "\n");
                        strMensaje.Append("1. Partida de Matrimonio en caso de ser casado." + "\n");
                        strMensaje.Append("2. Unión de Hecho en caso de ser conviviente" + "\n");
                        strMensaje.Append("3. DNI escaneados de los titulares y dependientes a incorporar en el Seguro." + "\n");
                        strMensaje.Append("4. Constancia de afiliación en EPS anterior (para mantener preexistencias)." + "\n\n");
                        strMensaje.Append("Bienestar realizará la gestión del Seguro." + "\n\n");
                        strMensaje.Append("Cualquier información adicional al 989059808 o al anexo 2267. (Zarella Monteverde)" + "\n\n");
                        strMensaje.Append("*******************************************************************************************************************************************************************************************\n\n");

                        string strArchivo1 = Path.Combine(Directory.GetCurrentDirectory(), "Formato de afiliación EPS 1.jpg");
                        string strArchivo2 = Path.Combine(Directory.GetCurrentDirectory(), "Formato de afiliación EPS 2.jpg");
                        string strArchivo3 = Path.Combine(Directory.GetCurrentDirectory(), "Plan de Salud EPS.pdf");
                        string strArchivo4 = Path.Combine(Directory.GetCurrentDirectory(), "Boletin Informativo EPS.pdf");

                        BSUtils.EmailSend(strEmailSolicitante, "Solicitud de Información de EPS", strMensaje.ToString(), strArchivo1, strArchivo2, strArchivo3, strArchivo4);

                        Application.DoEvents();

                        StringBuilder strMensajeDestino = new StringBuilder();
                        strMensajeDestino.Append("*****************************************************************************\n\n");
                        strMensajeDestino.Append("Se Generó el N° de Solicitud de Información de EPS : " + strNumero + "\n\n");
                        strMensajeDestino.Append("Fecha de Solicitud : " + deFecha.DateTime.ToString().Substring(0, 10) + "\n\n");
                        strMensajeDestino.Append("Solictante : " + txtSolicitante.Text + "\n\n");
                        strMensajeDestino.Append("Cargo : " + txtCargo.Text + "\n\n");
                        strMensajeDestino.Append("Fecha de Ingreso : " + strFechaIngreso + "\n\n");
                        strMensajeDestino.Append("Empresa : " + txtEmpresa.Text + "\n\n");
                        strMensajeDestino.Append("Sede : " + txtUnidadMinera.Text + "\n\n");
                        strMensajeDestino.Append("Area : " + txtArea.Text + "\n\n");
                        strMensajeDestino.Append("Emitido Por el Area de Bienestar Seguridad y Salud en el Trabajo" + "\n\n");
                        strMensajeDestino.Append("*****************************************************************************\n\n");

                        BSUtils.EmailSend("*****@*****.**", "Solicitud de Información de EPS", strMensajeDestino.ToString(), "", "", "", "");

                        XtraMessageBox.Show("Se creó la Solicitud de Información de EPS N° : " + txtNumero.Text, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        objBL_Solicitud.Actualiza(objSolicitud);
                    }
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                Cursor = Cursors.Default;
                XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }