protected void btnAgregarDocumento_Click(object sender, DirectEventArgs e) { ErrorOper = documento.InsertDocumento(Convert.ToInt32(this.cbDocumentos.SelectedItem.Value), (int)(Session["Id_Sucursal"]), Convert.ToString(Session["No_Socio"]), 1); if (ErrorOper.Valor == true) { X.Msg.Alert("Aviso",ErrorOper.Mensaje).Show(); } List<CotizadorWeb.wsConsultaDatos2.ConsultaDocumentoSocio> agregado = new List<CotizadorWeb.wsConsultaDatos2.ConsultaDocumentoSocio>(cdocumento.ConsultaDocumentos(Convert.ToString(Session["No_Socio"]), Convert.ToString(Session["Id_Sucursal"]))); this.strDocumentosAgregados.DataSource = agregado; this.strDocumentosAgregados.DataBind(); }
public void btnModificarCaptacion_Click(object sender, DirectEventArgs e) { if (this.nmrMonto.Text == "") { X.MessageBox.Alert("Aviso", "Hay algunos campos que no han sido completados y son obligatorios").Show(); } else { if (this.chkDobleIndemnizacion.Checked == true || this.chkAditamentoJuventud.Checked == true) { if (this.chkDobleIndemnizacion.Checked == true) { Session["Plus"] = 4; cuenta = Convert.ToDouble(this.nmrMonto.Text) * 2; cuentaplus = Convert.ToString(cuenta); cuentaDI = this.nmrMonto.Text; cuentaAJuv = "0"; Session["DobleI"] = 1; Session["AditamentoJ"] = 0; } if (this.chkAditamentoJuventud.Checked == true) { Session["Plus"] = 5; cuentaAJ = Convert.ToDouble(this.cbAditamentoPorcentaje.Value); cuenta = (Convert.ToDouble(this.nmrMonto.Text) * cuentaAJ) / 100 + Convert.ToDouble(this.nmrMonto.Text); cuentaAJuv = Convert.ToString(cuenta); cuentaDI = "0"; cuentaplus = Convert.ToString(cuenta); Session["AditamentoJ"] = 1; Session["DobleI"] = 0; analisis.InsertPLusCaptacion((int)(Session["IdRec"]), Convert.ToString(this.cbAditamentoPorcentaje.Value)); } if (this.chkDobleIndemnizacion.Checked == true && this.chkAditamentoJuventud.Checked == true) { Session["Plus"] = 6; cuentaAJ = Convert.ToDouble(this.cbAditamentoPorcentaje.Value); cuenta = (Convert.ToDouble(this.nmrMonto.Text) * cuentaAJ) / 100; cuentaplus = Convert.ToString((cuenta + (Convert.ToDouble(this.nmrMonto.Text) * 2))); cuentaDI = this.nmrMonto.Text; cuentaAJuv = Convert.ToString(((Convert.ToDouble(this.nmrMonto.Text) * cuentaAJ) / 100) + Convert.ToDouble(this.nmrMonto.Text)); Session["AditamentoJ"] = 1; Session["DobleI"] = 1; analisis.InsertPLusCaptacion((int)(Session["IdRec"]), Convert.ToString(this.cbAditamentoPorcentaje.Value)); } } else { Session["Plus"] = 1; cuentaplus = this.nmrMonto.Text; Session["AditamentoJ"] = 0; Session["DobleI"] = 0; cuentaDI = "0"; cuentaAJuv = "0"; analisis.InsertPLusCaptacion((int)(Session["IdRec"]), "0"); } actual = DateTime.Today; fechaMuerte = Convert.ToDateTime(Session["FechaMuerte"]); fechaultcaptacion = Convert.ToDateTime(this.dteFechaUltimoMovimiento.Text); if (DateTime.Compare(fechaultcaptacion, actual) > 0 || DateTime.Compare(fechaMuerte, fechaultcaptacion) < 0) { X.Msg.Alert("Aviso", "La fecha ingresada es mayor a la actual o a la fecha de muerte").Show(); } else { ErrorOp = captacion.InsertCaptacion(this.nmrMonto.Text, fechaultcaptacion.ToString("dd/MM/yyyy"), Convert.ToInt32(this.cbCuentas.SelectedItem.Value), cuentaAJuv, cuentaDI, (int)(Session["IdRec"]), (int)(Session["Plus"]), (int)(Session["IdCaptacion"]), (int)(Session["AditamentoJ"]), (int)(Session["DobleI"]), cuentaplus); if (ErrorOp.Valor == true) { X.Msg.Alert("Aviso", "").Show(); } List<CotizadorWeb.wsConsultaDatos2.ConsultaCaptacion> datcaptacion = new List<CotizadorWeb.wsConsultaDatos2.ConsultaCaptacion>(datoscaptacion.ConsultaCaptacionGeneral(idRec)); this.strCaptacion.DataSource = datcaptacion; this.strCaptacion.DataBind(); Limpia_CamposCaptacion(); this.btnModificarCaptacion.Disabled = true; this.btnAgregarCuentaCaptacion.Disabled = false; Carga_SaldoTotalCaptacion(); } } }
public void btnModificarColocacion_Click(object sender, DirectEventArgs e) { if (this.dteFechaOtorgado.Text != "" && this.nmrMontoColocacion.Text != "" && this.nmrTasaInteres.Text != "" && this.sfPlazo.Text != "" && this.dteFechaUltimoMovimientoCol.Text != "" && this.nmrSaldoPrincipal.Text != "") { Session["PP"] = 2; Session["TipoCuenta"] = 1; fechaprestamo = Convert.ToDateTime(this.dteFechaOtorgado.Text); fechaultcolocacion = Convert.ToDateTime(this.dteFechaUltimoMovimientoCol.Text); TimeSpan dias = Convert.ToDateTime(Session["FechaMuerte"]) - fechaultcolocacion; if (dias.Days > 180) { numerodias = "180"; } else { numerodias = dias.Days.ToString(); } double ic = ((Convert.ToDouble(this.nmrSaldoPrincipal.Text) * (Convert.ToDouble(this.nmrTasaInteres.Text) / 100)) / 30.4) * Convert.ToInt32(numerodias); double total = Convert.ToDouble(this.nmrSaldoPrincipal.Text) + ic; string intereses = Convert.ToString(ic); string totalpagar = total.ToString(); actual = DateTime.Today; fechaMuerte = Convert.ToDateTime(Session["FechaMuerte"]); if (Convert.ToDouble(this.nmrSaldoPrincipal.Text) > Convert.ToDouble(this.nmrMontoColocacion.Text)) { X.Msg.Alert("Aviso", "El saldo principal no puede ser mayor al Monto del préstamo").Show(); } else { if (DateTime.Compare(fechaultcolocacion, actual) > 0 || DateTime.Compare(fechaMuerte, fechaultcolocacion) < 0) { X.Msg.Alert("Aviso", "La fecha ingresada es mayor a la actual o la fecha de muerte").Show(); } else { ErrorOp = colocacion.InsertColocacion(fechaprestamo.ToString("dd/MM/yyyy"), this.nmrTasaInteres.Text, Convert.ToInt32(this.sfPlazo.Text), fechaultcolocacion.ToString("dd/MM/yyyy"), this.nmrSaldoPrincipal.Text, Convert.ToInt32(this.cbTipoPrestamo.SelectedItem.Value), (int)(Session["TipoCuenta"]), Convert.ToInt32(idRec), this.nmrMontoColocacion.Text, (int)(Session["IdColocacion"]), (int)(Session["PP"]), totalpagar, intereses); if (ErrorOp.Valor == true) { X.Msg.Alert("Aviso","").Show(); } List<CotizadorWeb.wsConsultaDatos2.ConsultaColocacion> datcolocacion = new List<CotizadorWeb.wsConsultaDatos2.ConsultaColocacion>(datoscolocacion.ConsultaColocaciones(idRec)); this.strColocacion.DataSource = datcolocacion; this.strColocacion.DataBind(); Limpia_CamposColocacion(); this.btnModificarColocacion.Disabled = true; this.btnAgregarCuentaColocacion.Disabled = false; Carga_SaldoTotalColocacion(); } } } else { X.Msg.Alert("Aviso", "Hay algunos campos que no han sido completados y son obligatorios").Show(); } }
/*Agrega un beneficiaro al Grid Panel*/ public void btnAgregarBeneficiarioGrid_Click(object sender, DirectEventArgs e) { /*Verifica que los campos de nombre, apellido paterno y porcentaje esten completados, de no ser asi envía un mensaje de error*/ if (this.txtNombre.Text != "" && this.txtApellidoPaterno.Text != "" && this.nmrPorcentaje.Text != "") { int Op = 2; this.btnAgregarBeneficiario.Disabled = false; /*Realiza una inserción de datos en la BD en la tabla Beneficiario, si no se logra la inserción devuelve * mensaje de error*/ ErrorOp = beneficiario.InsertBeneficiario(this.txtNombre.Text.ToUpper(), this.txtNombre2.Text.ToUpper(), this.txtApellidoPaterno.Text.ToUpper(), this.txtApellidoMaterno.Text.ToUpper(), this.nmrPorcentaje.Text, (int)(Session["IdRec"]), 0,Op); if (ErrorOp.Valor == true) { X.Msg.Show(new MessageBoxConfig { Title = "Aviso", Message = ErrorOp.Mensaje, Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.WARNING}); } /*Muestra el beneficiario agregado en el Grid Panel y limpia los campos para una nueva inserción*/ List<CotizadorWeb.wsConsultaDatos2.ConsultaBeneficiario> beneficiarioagregado = new List<CotizadorWeb.wsConsultaDatos2.ConsultaBeneficiario>(datosbeneficiario.ConsultaBeneficiarios(idRec)); this.strBeneficiario.DataSource = beneficiarioagregado; this.strBeneficiario.DataBind(); Limpia_CamposBeneficiario(); } else { X.Msg.Alert("Aviso","Hay algunos campos que no se han rellenado y son obligatorios").Show(); } }
public void btGuardarBeneficiario_Click(object sender, DirectEventArgs e) { if (this.txtNombre.Text != "" && this.txtApellidoPaterno.Text != "" && this.nmrPorcentaje.Text != "") { int Op = 1; ErrorOp = beneficiario.InsertBeneficiario(this.txtNombre.Text.ToUpper(), this.txtNombre2.Text.ToUpper(), this.txtApellidoPaterno.Text.ToUpper(), this.txtApellidoMaterno.Text.ToUpper(), this.nmrPorcentaje.Text, (int)(Session["IdRec"]), (int)(Session["IdBeneficiario"]),Op); if (ErrorOp.Valor == true) { X.Msg.Alert("Aviso", ErrorOp.Mensaje).Show(); } List<CotizadorWeb.wsConsultaDatos2.ConsultaBeneficiario> beneficiarioagregado = new List<CotizadorWeb.wsConsultaDatos2.ConsultaBeneficiario>(datosbeneficiario.ConsultaBeneficiarios(idRec)); this.strBeneficiario.DataSource = beneficiarioagregado; this.strBeneficiario.DataBind(); Limpia_CamposBeneficiario(); this.btnAgregarBeneficiario.Disabled = false; this.btGuardar.Disabled = true; } }
/*Guarda los datos del formulario de análisis*/ public void btnGuardarAnalisis_Click(object sender, DirectEventArgs e) { /*Verifica que se hayan llenado los capos de fechas y causas de muerte, de no ser asi manda un mensaje de error*/ if (this.dteFechaLaboro.Text != "" && this.dteFechaMuerte.Text != "" && this.txaCausa.Text != "") { if (this.chkMenorAhorrador.Checked == true) { Session["Menor"] = 1; } else { Session["Menor"] = 0; } this.dteFechaLaboro.MaxDate = DateTime.Today; this.dteFechaLaboro.MinDate = Convert.ToDateTime(datossocio.FechaIng); hoy = DateTime.Now; actual = DateTime.Today; fechaLab = Convert.ToDateTime(this.dteFechaLaboro.Text); fechaMuerte = Convert.ToDateTime(this.dteFechaMuerte.Text); /*Verifica que las fechas ingresadas no sean mayores a la actual y que la ultima fecha en que laboro * tampoco se mayor a la de muerte de ser asi manda un mensaje de error*/ if (DateTime.Compare(fechaLab, actual) > 0 || DateTime.Compare(fechaMuerte, actual) > 0 || DateTime.Compare(fechaMuerte, fechaLab) < 0) { X.Msg.Alert("Error", "La fecha ingresada es mayor a la actual o a la de muerte").Show(); } else { /*Realiza la inserción de datos en la BD si no se logra realizar la inserción manda un mensaje de error*/ ErrorOp = analisis.InsertAnalisis((int)(Session["IdRec"]),hoy.ToString(),fechaLab.ToString("dd/MM/yyyy"), fechaMuerte.ToString("dd/MM/yyyy"), Convert.ToInt32(this.cbCausante.SelectedItem.Value), this.txaCausa.Text.ToUpper(), Convert.ToInt32(this.cbFallecimiento.SelectedItem.Value), (int)(Session["Menor"])); if (ErrorOp.Valor == true) { X.Msg.Alert("Aviso",ErrorOp.Mensaje).Show(); } } /*Se habilitan los campos de beneficiario y se bloquean los botones de Atras, Guardar Analisis * y se colapsa el Panel de Análisis*/ this.lblEdadMuerte.Text = Convert.ToString(datosanalisis.EdadMuerte); this.btnAtras.Disabled = true; this.btnGuardarAnalisis.Disabled = true; this.frmAnalisis.Collapsed = true; Habilita_CamposBeneficiario(); } else { X.MessageBox.Alert("Aviso", "Hay algunos campos que no han sido completados y son obligatorios").Show(); } }
/*Agrega un documento al Grid y si ya se encuentra registrado manda mensaje de error*/ protected void btnAgregarDocumento_Click(object sender, DirectEventArgs e) { /*Realiza una inserción a la BD de los diferentes documentos que pueden envíar las Cooperativas, si el documento ya se encuentra registrado manda un mensaje de error*/ ErrorOper = documento.InsertDocumento(Convert.ToInt32(this.cbDocumentos.SelectedItem.Value), (int)(Session["Id_Sucursal"]), Convert.ToString(Session["No_Socio"]), 1); if (ErrorOper.Valor == true) { X.Msg.Alert("Aviso",ErrorOper.Mensaje).Show(); } /*Muestra en el Grid Panel los documentos que ha sido agregados*/ List<CotizadorWeb.wsConsultaDatos2.ConsultaDocumentoSocio> agregado = new List<CotizadorWeb.wsConsultaDatos2.ConsultaDocumentoSocio>(cdocumento.ConsultaDocumentos(Convert.ToString(Session["No_Socio"]), Convert.ToString(Session["Id_Sucursal"]))); this.strDocumentosAgregados.DataSource = agregado; this.strDocumentosAgregados.DataBind(); }
/*Guarda los datos del socio y de la paqueteria*/ protected void btnAceptarPaqueterias_DirectClick(object sender, Ext.Net.DirectEventArgs e) { if (this.rdoMasculino.Checked == true) { Session["Sexo"] = 1; } else { Session["Sexo"] = 0; } DateTime hoy = new DateTime(); DateTime actual = new DateTime(); hoy = DateTime.Now; actual = DateTime.Today; int ano = DateTime.Now.Year; fechaNac = Convert.ToDateTime(this.dteFechaN.Text); fechaIng = Convert.ToDateTime(this.dteFechaI.Text); /*Compara que la fecha ingresada no se mayo a la actual, de ser así manda un mensaje de error*/ if (DateTime.Compare(fechaIng, actual) > 0 || DateTime.Compare(fechaNac, actual) > 0) { X.Msg.Alert("Error", "La fecha es mayor a la actual").Show(); } else { /*Realiza la inserción de datos del socio a la BD si no se puede realizaar la inserción manda un mensaje de error*/ ErrorOper = socio.InsertSocioBeneficio(this.txtNumSocio.Text.ToUpper(), this.txtNombre.Text.ToUpper(), this.txtNombre2.Text.ToUpper(), this.txtApellidoPat.Text.ToUpper(), this.txtApellidoMat.Text.ToUpper(), fechaNac.ToString("dd/MM/yyyy"), fechaIng.ToString("dd/MM/yyyy"), (int)(Session["Sexo"]), "", "", "", Convert.ToInt32(this.cbOcupacion.SelectedItem.Value), Convert.ToInt32(this.cbEdoCivil.SelectedItem.Value), Convert.ToInt32(this.cbSucursal.SelectedItem.Value), Convert.ToString(ano), hoy.ToString("dd/MM/yyyy"),Convert.ToInt32(this.cbColonia.SelectedItem.Value), this.txtCalle.Text.ToUpper(), this.txtNoExt.Text.ToUpper(), this.txtNoInt.Text.ToUpper(), 1, 1, Convert.ToInt32(this.cbPaqueteria.SelectedItem.Value), this.txtGuia.Text.ToUpper()); if (ErrorOper.Valor == true) { X.Msg.Alert("Aviso","No se pudo ingresar los datos del socio, intentelo nuevamente").Show(); } /*Se guardan el Id_Sucursal y el No_Socio en variables de sesión*/ Session["Id_Sucursal"] = Convert.ToInt32 (this.cbSucursal.SelectedItem.Value); Session["No_Socio"] = Convert.ToString (this.txtNumSocio.Text.ToUpper()); noSocio = Convert.ToString(Session["No_Socio"]); idSucursal = Convert.ToString(Session["Id_Sucursal"]); this.pnlPaqueteria1.Disabled = true; this.pnlPaqueteria2.Disabled = true; this.pnlPaqueteria3.Disabled = true; this.pnlPaqueteria4.Disabled = false; this.pnlAgregarDocumentacion.Disabled = false; this.pnlSocio.Disabled = true; Carga_CamposDocumentos(); } }
public void btnAgregarBeneficiarioGrid_Click(object sender, DirectEventArgs e) { if (this.txtNombre.Text != "" && this.txtApellidoPaterno.Text != "" && this.nmrPorcentaje.Text != "") { int Op = 2; this.btnAgregarBeneficiario.Disabled = false; ErrorOp = beneficiario.InsertBeneficiario(this.txtNombre.Text.ToUpper(), this.txtNombre2.Text.ToUpper(), this.txtApellidoPaterno.Text.ToUpper(), this.txtApellidoMaterno.Text.ToUpper(), this.nmrPorcentaje.Text, (int)(Session["IdRec"]), 0,Op); if (ErrorOp.Valor == true) { X.Msg.Alert("Aviso",ErrorOp.Mensaje,MessageBox.Icon.WARNING).Show(); } List<CotizadorWeb.wsConsultaDatos2.ConsultaBeneficiario> beneficiarioagregado = new List<CotizadorWeb.wsConsultaDatos2.ConsultaBeneficiario>(datosbeneficiario.ConsultaBeneficiarios(idRec)); this.strBeneficiario.DataSource = beneficiarioagregado; this.strBeneficiario.DataBind(); Limpia_CamposBeneficiario(); } else { X.Msg.Alert("Aviso","Hay algunos campos que no se han rellenado y son obligatorios").Show(); } }
//public void btnSiguienteAnalisis_Click(object sender, DirectEventArgs e) //{ // if (this.dteFechaLaboro.Text != "" && this.dteFechaMuerte.Text != "" && this.txaCausa.Text != "") // { // if (this.chkMenorAhorrador.Checked == true) // { // Session["Menor"] = 1; // } // else // { // Session["Menor"] = 0; // } // hoy = DateTime.Now; // actual = DateTime.Today; // fechaLab = Convert.ToDateTime(this.dteFechaLaboro.Text); // fechaMuerte = Convert.ToDateTime(this.dteFechaMuerte.Text); // Session["FechaMuerte"] = fechaMuerte; // if (DateTime.Compare(fechaLab, actual) > 0 || DateTime.Compare(fechaMuerte, actual) > 0 || DateTime.Compare(fechaMuerte, fechaLab) < 0) // { // X.Msg.Alert("Error", "La fecha es mayor a la actual").Show(); // } // else // { // ErrorOp = analisis.InsertAnalisis(Convert.ToInt32(idRec), hoy.ToString("dd/MM/yyyy"), fechaLab.ToString("dd/MM/yyyy"), fechaMuerte.ToString("dd/MM/yyyy"), // Convert.ToInt32(this.cbCausante.SelectedItem.Value), this.txaCausa.Text.ToUpper(), // Convert.ToInt32(this.cbFallecimiento.SelectedItem.Value), (int)(Session["Menor"])); // if (ErrorOp.Valor == true) // { // X.Msg.Alert("Aviso",ErrorOp.Mensaje).Show(); // } // this.btnAtras.Disabled = true; // this.frmBeneficiario.Disabled = false; // this.btnSiguiente.Disabled = true; // estatus.EstatusReclamo(6, (int)(Session["IdRec"])); // } // this.btnAtras.Disabled = true; // this.gplBeneficiario.Disabled = false; // this.lblEdadMuerte.Text = Convert.ToString(Session["EdadMuerte"]); // } // else // { // X.MessageBox.Alert("Aviso", "Hay algunos campos que no han sido completados y son obligatorios").Show(); // } //} public void btnGuardarAnalisis_Click(object sender, DirectEventArgs e) { if (this.dteFechaLaboro.Text != "" && this.dteFechaMuerte.Text != "" && this.txaCausa.Text != "") { if (this.chkMenorAhorrador.Checked == true) { Session["Menor"] = 1; } else { Session["Menor"] = 0; } this.dteFechaLaboro.MaxDate = DateTime.Today; this.dteFechaLaboro.MinDate = Convert.ToDateTime(datossocio.FechaIng); hoy = DateTime.Now; actual = DateTime.Today; fechaLab = Convert.ToDateTime(this.dteFechaLaboro.Text); fechaMuerte = Convert.ToDateTime(this.dteFechaMuerte.Text); if (DateTime.Compare(fechaLab, actual) > 0 || DateTime.Compare(fechaMuerte, actual) > 0 || DateTime.Compare(fechaMuerte, fechaLab) < 0) { X.Msg.Alert("Error", "La fecha es mayor a la actual").Show(); } else { ErrorOp = analisis.InsertAnalisis((int)(Session["IdRec"]),hoy.ToString(),fechaLab.ToString("dd/MM/yyyy"), fechaMuerte.ToString("dd/MM/yyyy"), Convert.ToInt32(this.cbCausante.SelectedItem.Value), this.txaCausa.Text.ToUpper(), Convert.ToInt32(this.cbFallecimiento.SelectedItem.Value), (int)(Session["Menor"])); if (ErrorOp.Valor == true) { X.Msg.Alert("Aviso",ErrorOp.Mensaje).Show(); } } this.lblEdadMuerte.Text = Convert.ToString(datosanalisis.EdadMuerte); this.btnAtras.Disabled = true; this.gplBeneficiario.Disabled = false; this.btnGuardarAnalisis.Disabled = true; this.frmAnalisis.Collapsed = true; Habilita_CamposBeneficiario(); this.frmAnalisis.Collapsed = true; } else { X.MessageBox.Alert("Aviso", "Hay algunos campos que no han sido completados y son obligatorios").Show(); } }