protected void grOperacionParticipe_RowCommand(Object sender, GridViewCommandEventArgs e) { if (e.CommandName != "Eliminar") { return; } var index = Convert.ToInt32(e.CommandArgument); var idSolicitud = Convert.ToInt32(this.grOperacionParticipe.DataKeys[index]["id_solicitud"]); var rut = Convert.ToInt32(this.grOperacionParticipe.DataKeys[index]["rut"]); var tipo = this.grOperacionParticipe.DataKeys[index]["tipo"].ToString(); var busqueda = this.grOperacionParticipe.DataKeys[index]["busqueda"].ToString(); new ParticipeOperacionBC().Delparticipebytipo(idSolicitud, tipo, rut); switch (busqueda) { case "Por tipo": this.GetParticipantes(idSolicitud, tipo); break; case "Por operacion": this.GetParticipantes(idSolicitud); break; } FuncionGlobal.alerta_updatepanel("Participante Eliminado Correctamente", Page, update1); }
protected void ib_habilitar_Click(object sender, ImageClickEventArgs e) { GridViewRow row; //HyperLink but; Int32 add = 0; int a = 0; for (int i = 0; i < gr_dato.Rows.Count; i++) { row = gr_dato.Rows[i]; CheckBox chk = (CheckBox)gr_dato.Rows[i].FindControl("chk"); //but = (HyperLink)row.Cells[0].Controls[0]; //string id_solicitud = but.Text.Trim(); string id_solicitud = this.gr_dato.Rows[i].Cells[0].Text; if (chk.Checked == true) { add = new OperacionBC().add_operacion_habilitar(Convert.ToInt32(id_solicitud)); a++; } } if (a > 0) { FuncionGlobal.alerta_updatepanel("Operacion Realizada con Exito", this.Page, this.UpdatePanel2); busca_operacion(); } else { FuncionGlobal.alerta_updatepanel("Para 3º a 3º, debe seleccionar una operacion", this.Page, this.UpdatePanel2); return; } }
protected void btn_baja_tag_Click(object sender, EventArgs e) { if (this.txt_solicitud.Text != "" && this.txt_patente.Text != "") { string add = new Codigo_TAGBC().add_Control_TAG(this.txt_patente.Text, Convert.ToInt32(this.txt_solicitud.Text), "0",(string)(Session["usrname"])); if (add != "OK") { FuncionGlobal.alerta_updatepanel(add, Page, up_grilla); return; } else { FuncionGlobal.alerta_updatepanel("Devolucion de TAG cargado con exito", this.Page, this.up_grilla); } } if (this.txt_solicitud.Text == "" && this.txt_patente.Text != "") { TipoOperacion tip = new TipooperacionBC().getTipooperacion("DTAG"); this.btn_baja_tag.Attributes.Add("onclick", "javascript:window.showModalDialog('" + tip.Url_operacion + "fDded4a93u2d" + "&id_cliente=" + FuncionGlobal.FuctionEncriptar(usu.Cliente.Id_cliente.ToString()) + "&ventatipo=" + "" + "&patente=" + this.txt_patente.Text + "','_blank','" + tip.Tamano + "')"); } }
private void Finalizar() { txtComentario.Text = string.Empty; btnAsignar.Visible = false; btnNoAsignar.Visible = false; FuncionGlobal.alerta_updatepanel("Incidencia asignada correctamente", Page, udp_wuc_incidencia_inicio); }
protected void gr_dato_RowDeleting(object sender, GridViewDeleteEventArgs e) { if (new UsuarioBC().GetUsuario(Session["usrname"].ToString()).Permite_eliminar) { int id_solicitud = Convert.ToInt32(ViewState["id_solicitud"]); int id_nomina = Convert.ToInt32(this.gr_dato.DataKeys[e.RowIndex].Values[0].ToString()); HyperLink folio_x = (HyperLink)gr_dato.Rows[e.RowIndex].Cells[2].Controls[0]; int folio = Convert.ToInt32(folio_x.Text.Trim().Replace(".", "")); //int folio = Convert.ToInt32(gr_dato.Rows[e.RowIndex].Cells[2].Controls[0].ToString()); //EstadoOperacion mesta = new EstadooperacionBC().getEstadobyorden(id_solicitud, 97); //if (mesta.Permite_estado == false) //{ this.Borrar_Operacion(id_solicitud, id_nomina, folio); //} //else //{ // e.Cancel = true; // FuncionGlobal.alerta_updatepanel("No se puede eliminar una Operacion que tiene Despacho a cobranza", this.Page, this.up_grilla); //} } else { e.Cancel = true; FuncionGlobal.alerta_updatepanel("Ud. no tiene los permisos suficientes para eliminar esta operación de la Nomina", this.Page, this.up_grilla); } }
private void actualiza_producto() { Usuario usu = new UsuarioBC().GetUsuario((string)(Session["usrname"])); if (usu.Permite_eliminar == true && usu.Permite_pagar == true) { var query = from r in this.gr_dato.Rows.OfType <GridViewRow>() where ((CheckBox)r.FindControl("chk")).Checked == true && r.RowType == DataControlRowType.DataRow select r.RowIndex; Int32 add; foreach (int i in query) { add = new OperacionBC().actualiza_producto((Convert.ToInt32(this.gr_dato.DataKeys[i].Values[3].ToString())), this.dl_producto_cambio.SelectedValue, Session["usrname"].ToString(), ""); } FuncionGlobal.alerta_updatepanel("DATOS ACTUALIZADOS", this.Page, this.up_movimiento); this.Busca_Operacion(); } else { FuncionGlobal.alerta_updatepanel("NO TIENE LOS PERMISOS NECESARIOS PARA REALIZAR UN CAMBIO DE PRODUCTO", this.Page, this.up_movimiento); } }
protected void Borrar_Operacion(int id_solicitud) { string del = new OperacionBC().del_operacion(id_solicitud, (string)(Session["usrname"])); FuncionGlobal.alerta_updatepanel(string.Format("Operacion nro. {0} eliminada correctamente", id_solicitud), this.Page, this.up_grilla); this.Busca_Operacion(); }
protected void btnAnalisisMasivo_Click(object sender, EventArgs e) { if (Convert.ToInt32(dlCliente.SelectedValue) != (int)Cliente.Scotiabank && Convert.ToInt32(dlCliente.SelectedValue) != (int)Cliente.Bice && Convert.ToInt32(dlCliente.SelectedValue) != (int)Cliente.Bk) { FuncionGlobal.alerta_updatepanel("CLIENTE NO TIENE INGRESO PRETICKET HABILITADO", Page, upd); return; } try { //ImportarExcel(@"E:\prueba\14-11-2016 (2).xlsx"); ImportarExcel(carga_archivo()); FuncionGlobal.alerta_updatepanel("Análisis Terminado", this.Page, upd); } catch (Exception ex) { FuncionGlobal.alerta_updatepanel( $"ERROR: SE HA PRODUCIDO EL SIGUIENTE ERROR EN EL PROCESO DE ANALISIS: {ex.Message}", this.Page, upd ); } }
public void carga_contratos() { List <Contratos> lInforme = new ContratosBC().getcontratosbycliente(Convert.ToInt32(id_solicitud)); UpdatePanel up = (UpdatePanel)this.Master.FindControl("UpdatePanel1"); if (lInforme.Count == 0) { FuncionGlobal.alerta_updatepanel("NO HAY CONTRATOS ASOCIADOS AL CLIENTE", Page, up); } else { DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("id_contrato")); dt.Columns.Add(new DataColumn("descripcion")); dt.Columns.Add(new DataColumn("nombre")); foreach (Contratos inf in lInforme) { DataRow dr = dt.NewRow(); dr["id_contrato"] = inf.Id_contrato; dr["descripcion"] = inf.Descripcion; dr["nombre"] = inf.Nombre; dt.Rows.Add(dr); } this.gr_dato.DataSource = lInforme; this.gr_dato.DataBind(); } }
protected void bt_cambio_estado_Click(object sender, EventArgs e) { var comentario = txtComentarioEstado.Value; if (comentario.Trim() == string.Empty) { FuncionGlobal.alerta_updatepanel("Ingrese un comentario", Page, this.udpForm); return; } if (dlEstadoCambios.SelectedValue == "0") { FuncionGlobal.alerta_updatepanel("Seleccione un Estado", Page, this.udpForm); return; } var filasGrid = from r in this.gr_dato.Rows.OfType <GridViewRow>() where ((CheckBox)r.FindControl("chk")).Checked && r.RowType == DataControlRowType.DataRow select r.RowIndex; if (filasGrid.Count() > 0) { foreach (int i in filasGrid) { var estado = Convert.ToInt32(dlEstadoCambios.SelectedValue); int idIncidencia = Convert.ToInt32(this.gr_dato.DataKeys[i].Values[0]); var usuarioResponsable = Convert.ToString(this.gr_dato.DataKeys[i].Values["cuenta_usuario_responsable"]); new IncidenciaBC().CambioEstado(idIncidencia, estado, Convert.ToString(Session["usrname"]), usuarioResponsable, comentario, dlEstadoCambios.SelectedItem.Text); } GetIncidencias(Convert.ToString(Session["usrname"])); FuncionGlobal.alerta_updatepanel("Tickets asignados correctamente", Page, this.udpForm); } else { FuncionGlobal.alerta_updatepanel("No seleccionó ningún ticket de incidencia", Page, this.udpForm); } }
private void add_pago_completo() { GridViewRow row; HyperLink but; if (this.lbl_total_gastos.Text == "0") { FuncionGlobal.alerta_updatepanel("IMPOSIBLE REALIZAR PAGO, SUMA DE GASTOS SELECCIONADOS ESTA EN CERO", this.Page, this.panel_movimiento); return; } if (this.dl_financiera.SelectedValue.ToString() == "0" || this.dl_cuenta.SelectedValue.ToString() == "0" || this.dl_tipo_operacion.SelectedValue.ToString() == "0" || this.txt_fecha_pago.Text.Trim() == "" || this.txt_especial.Text == "") { FuncionGlobal.alerta_updatepanel("INGREASE LOS DATOS CORRESPONDIENTES PARA GENERAR MOVIMIENTO CONTABLE", this.Page, this.panel_movimiento); return; } for (int i = 0; i < gr_dato.Rows.Count; i++) { row = gr_dato.Rows[i]; CheckBox chk = (CheckBox)gr_dato.Rows[i].FindControl("chk"); but = (HyperLink)row.Cells[0].Controls[0]; string id_solicitud = but.Text.Trim(); if (chk.Checked == true) { string add = new MovimientoCuentaPeruBC().add_movimiento_cuentaPagoCompleto(Convert.ToInt32(id_solicitud), Convert.ToInt16(this.dl_cuenta.SelectedValue), (string)(Session["usrname"]), this.txt_fecha_pago.Text.Trim(), this.dl_tipo_operacion.SelectedValue, this.txt_especial.Text); } } FuncionGlobal.alerta_updatepanel("MOVIMIENTO CONTABLE INGRESADO CON EXITO", this.Page, this.panel_movimiento); this.Panel1.Visible = false; this.busca_operacion(); }
private void Add_Pago_Completo() { bool permite = new UsuarioBC().GetUsuario((string)(Session["usrname"])).Permite_pagar; if (permite == true) { var query = from r in this.gr_dato.Rows.OfType <GridViewRow>() where ((CheckBox)r.FindControl("chk")).Checked == true && r.RowType == DataControlRowType.DataRow && Convert.ToDouble(Convert.ToDouble(this.gr_dato.DataKeys[r.RowIndex].Values[5])) > 0 select r.RowIndex; string add; string x = "Operaciones rebajadas con exito"; foreach (int i in query) { EstadoOperacion mesta = new EstadooperacionBC().getEstadobyorden(Convert.ToInt32(this.gr_dato.DataKeys[i].Values[3].ToString().Trim()), 88); if (mesta.Permite_estado == true) { add = new MovimientocuentaBC().add_movimiento_cuentaPagoCompleto(Convert.ToInt32(this.gr_dato.DataKeys[i].Values[3].ToString()), Convert.ToInt16(this.dl_cuenta.SelectedValue), (string)(Session["usrname"]), this.txt_fecha_pago.Text.Trim(), this.dl_tipo_operacion.SelectedValue, this.txt_especial.Text); } else { x = "HAY OPERACIONES CON PROBLEMAS"; } } FuncionGlobal.alerta_updatepanel(x, this.Page, this.up_movimiento); this.Busca_Operacion(); } else { FuncionGlobal.alerta_updatepanel("Su usuario no tiene los pemisos para Pagar Operaciones", this.Page, this.up_movimiento); } }
protected void del_operacion(int id_solicitud) { string del = new OperacionBC().del_operacion(id_solicitud, (string)(Session["username"])); FuncionGlobal.alerta_updatepanel(string.Format("Operacion nro. {0} eliminada correctamente", id_solicitud), Page, this.UpdatePanel2); busca_operacion(); }
private void add_datosvehiculo() { string dv = FuncionGlobal.digitoVerificadorPatente(patente); Marcavehiculo marca = new MarcavehiculoBC().getmarcavehiculo(Convert.ToInt16(this.dl_marca.SelectedValue)); Tipovehiculo vehi = new TipovehiculoBC().getTipoVehiculo(this.dl_tipo_vehiculo.SelectedValue); DatosVehiculo mdato = new DatosvehiculoBC().getDatovehiculobyPatente_id_solicitud(this.patente, Convert.ToInt32(id_solicitud)); string add = new DatosvehiculoBC().add_Datosvehiculo(Convert.ToInt32(this.id_solicitud), marca, vehi, this.patente, dv, this.txt_modelo.Text, this.txt_chasis.Text, this.txt_motor.Text, this.txt_vin.Text, this.txt_serie.Text, Convert.ToInt32(this.txt_ano.Text), "", this.txt_color.Text, 0, 0, "", 0, 0, mdato.Kilometraje, mdato.Tasacion, mdato.Codigo_SII, mdato.Precio, mdato.Id_dato_vehiculo, mdato.Fecha_contrato, mdato.Forma_pago, mdato.Prenda, this.dl_estado_vehiculo.SelectedValue.ToString(), mdato.Rut_prenda, mdato.Financiamiento_amicar, mdato.Transmision, mdato.Equipamiento); UpdatePanel up = (UpdatePanel)this.Master.FindControl("UpdatePanel1"); FuncionGlobal.alerta_updatepanel("DATOS DEL VEHICULO INGRESADA CON EXITO", this.Page, up); this.ClientScript.RegisterClientScriptBlock(Page.GetType(), "CloseWnd", "<script type=\"text/javascript\">window.close();</script>"); return; }
protected void ib_word_Click(object sender, ImageClickEventArgs e) { UpdatePanel up = (UpdatePanel)this.Page.FindControl("up_grilla"); Int32 tipo = Convert.ToInt32(this.dl_doc.SelectedValue); if (tipo > 0) { GridViewRow row; HyperLink but; for (int i = 0; i < gr_dato.Rows.Count; i++) { row = gr_dato.Rows[i]; CheckBox chk = (CheckBox)gr_dato.Rows[i].FindControl("chk"); but = (HyperLink)row.Cells[0].Controls[0]; string id_solicitud = but.Text.Trim(); if (chk.Checked == true) { crearescritura(Convert.ToInt32(id_solicitud), tipo); } } //Para darle tiempo al demonio para generar las escrituras FuncionGlobal.Sleep(10); FuncionGlobal.alerta_updatepanel("Documento(s) de Garantia generado(s) con exito", this.Page, this.up_grilla); } else { FuncionGlobal.alerta_updatepanel("Debe selecionar una opcion en los *", this.Page, this.up_grilla); } busca_operacion(); return; }
protected void Page_Load(object sender, EventArgs e) { IdSolicitud = Convert.ToInt32(FuncionGlobal.FuctionDesEncriptar(Request.QueryString["id_solicitud"])); IdIncidencia = Request.QueryString["id_incidencia"]; //no se pueden subir ni eliminar documentos de la incidencia fuera cuando esta ya es operación wucDocumento.VerPanelAcciones = false; if (IdIncidencia != null) { //lleno la incidencia wucDocumento.Inicio(Convert.ToInt32(IdIncidencia)); ExisteIncidencia = true; } if (Session["usrname"] == null) { FuncionGlobal.alerta_updatepanel("Ha perdido la sesión", this.Page, updateP); return; } Usuario = (Session["usrname"]).ToString().Trim(); var usuario = new UsuarioBC().GetUsuario(Usuario); //Busco si por numero de operación encuentro una incidencia var dtNuevaSolicitud = new IncidenciaBC().GetIncidenciaFromNuevaSolicitud(IdSolicitud); if (dtNuevaSolicitud.Rows.Count > 0) { gr_documentos_origen.DataSource = GetDocs(Convert.ToInt32(dtNuevaSolicitud.Rows[0]["id_solicitud"]), usuario); gr_documentos_origen.DataBind(); //si no recibio idIncidencia como parametro pero si exite desde la busqueda por operacion if (IdIncidencia == null) { wucDocumento.Inicio(Convert.ToInt32(dtNuevaSolicitud.Rows[0]["id_incidencia"])); } ExisteIncidencia = true; } if (!ExisteIncidencia) { tab_opciones.Tabs[1].Visible = false; tab_opciones.Tabs[2].Visible = false; } //lleno la grilla de la operacion TipoOperacion = Request.QueryString["tipo"]; if (IsPostBack) { return; } InicializarComponentes(usuario); GetTitulosDoc(); gr_documentos.DataSource = GetDocs(IdSolicitud, usuario); gr_documentos.DataBind(); }
protected void Button1_Click(object sender, EventArgs e) { add_documento_producto(); //FuncionGlobal.alerta("INFORME AGREGADO CON EXITO", Page); UpdatePanel up = (UpdatePanel)this.Master.FindControl("UpdatePanel1"); FuncionGlobal.alerta_updatepanel("DOCUMENTOS AGREGADOS CON EXITO", Page, up); }
protected void Button1_Click(object sender, EventArgs e) { add_participante_sucursal(); //FuncionGlobal.alerta("SUCURSALES ACTUALIZADAS CON EXITO", Page); UpdatePanel pnl = (UpdatePanel)this.Master.FindControl("UpdatePanel1"); FuncionGlobal.alerta_updatepanel("SUCURSALES ACTUALIZADAS CON EXITO", this.Page, pnl); getsucursales(); }
protected bool validar_busqueda(int id_solicitud) { if (this.dl_familia.SelectedValue == "0" || this.dl_tiponomina.SelectedValue == "0") { FuncionGlobal.alerta_updatepanel("Debe seleccionar todos los Filtros", this.Page, this.up_filtros); return(false); } return(true); }
protected void btnGuardar_Click(object sender, EventArgs e) { DateTime fecha = Convert.ToDateTime(this.txtFechaSolicitud.Text); string add = new SolicitudRCBC().add_SolicitudRC(0, Convert.ToInt32(this.lblOperacion.Text), Convert.ToInt32(this.ddlTipoSolicitud.SelectedValue), Convert.ToInt32(this.ddlOficina.SelectedValue), Convert.ToInt32(this.txtNroSolicitud.Text), fecha.Year, "INGRESADA", "", fecha); UpdatePanel up = (UpdatePanel)this.Master.FindControl("UpdatePanel1"); FuncionGlobal.alerta_updatepanel("Solicitud guardada con exito", Page, up); getSolicitudes(); }
protected void Button1_Click(object sender, EventArgs e) { add_usuario_modulo(); //FuncionGlobal.alerta("MODULOS ACTUALIZADOS CON EXITO", Page); UpdatePanel pnl = (UpdatePanel)this.Master.FindControl("UpdatePanel1"); FuncionGlobal.alerta_updatepanel("MODULOS ACTUALIZADOS CON EXITO", this.Page, pnl); getmodulos(); }
protected void Button1_Click(object sender, EventArgs e) { add_Tipooperacion(); //FuncionGlobal.alerta("OPERACIONES ACTUALIZADAS CON EXITO", Page); UpdatePanel pnl = (UpdatePanel)this.Master.FindControl("UpdatePanel1"); FuncionGlobal.alerta_updatepanel("OPERACIONES ACTUALIZADAS CON EXITO", this.Page, pnl); getallTipooperacion(); }
private void add_persona() { //string persona = new PersonaBC().add_persona(Convert.ToDouble(this.txt_rut.Text), // this.txt_dv.Text, // Convert.ToInt16(this.dl_comuna.SelectedValue), // "", // this.txt_nombre.Text, // this.txt_paterno.Text, // this.txt_materno.Text, // "0", // "0", // "", // "", // "0", // this.txt_telefono.Text, // "", // "", // this.txt_direccion.Text, // this.txt_numero.Text, // this.txt_depto.Text, // "0"); string rupart = ""; DateTime direccion = Convert.ToDateTime("1991/01/01"); if (this.DatosParticipante.Guardar_Form()) { if (this.DatosParticipante.InfoPersona != null) { rupart = this.DatosParticipante.InfoPersona.Rut.ToString(); } } Direcciones mdirec = new DireccionesBC().getDireccionPorDefecto(Convert.ToInt32(rupart)); UpdatePanel up = (UpdatePanel)this.Master.FindControl("UpdatePanel1"); if (mdirec == null) { FuncionGlobal.alerta_updatepanel("Debe ingresar la direccion", Page, up); return; } if (this.txt_fecha.Text != "") { direccion = Convert.ToDateTime(this.txt_fecha.Text); } if (rupart != "") { string participe = new ParticipanteBC().add_participe(Convert.ToDouble(rut_persona), Convert.ToDouble(rupart), this.dl_tipo.SelectedValue, this.chk_firma.Checked, this.txt_ciudad_n.Text, this.txt_notario.Text, direccion); } }
private Boolean valida_ingreso() { UpdatePanel up = (UpdatePanel)this.Master.FindControl("UpdatePanel1"); if (this.txt_rut_deudor.Text == "" || this.dl_producto_Cliente.SelectedValue.ToString() == "0" || this.dl_forma_pago.SelectedValue.ToString() == "0") { FuncionGlobal.alerta_updatepanel("INGRESE LOS DATOS CORRESPONDIENTES", Page, up); return(false); } return(true); }
protected void bt_graba_movimiento_Click(object sender, EventArgs e) { if (this.txt_especial.Text != "") { this.Add_Pago_Completo(); } else { FuncionGlobal.alerta_updatepanel("Es requerido el Documento Especial para realizar el Pago Masivo", this.Page, this.up_movimiento); } }
protected void ib_repertorio_Click(object sender, ImageClickEventArgs e) { if (this.Filas_Selecionadas()) { this.Generar_Archivo_Solicitud_Repertorio(); } else { FuncionGlobal.alerta_updatepanel("Debe seleccionar al menos una operación", this, this.up_movimiento); } }
protected void bt_generar_Click(object sender, ImageClickEventArgs e) { if (!this.ValidarAntesDeGenerar()) { FuncionGlobal.alerta_updatepanel("No hay filas seleccionadas para la generación de la nómina", this, this.up_filtros); } else { this.GenerarNomina(); } }
protected void ib_buscar_Click(object sender, ImageClickEventArgs e) { try { busca_operacion(); } catch (Exception ex) { FuncionGlobal.alerta_updatepanel("Existe el siguiente Error: " + ex.Message, Page, UpdatePanel2); } }
protected void btnAceptar_Click(object sender, EventArgs e) { try { var correctas = Add(); GetAll(); FuncionGlobal.alerta_updatepanel("Se guardaron " + correctas + " firmas.", this.Page, upd); } catch (Exception ex) { FuncionGlobal.alerta_updatepanel(ex.Message, this.Page, upd); } }
protected void btnSubir_Click(object sender, EventArgs e) { try { var subidos = subir_archivos(); GetDocs(Convert.ToInt32(hdIdSolicitud.Value)); FuncionGlobal.alerta_updatepanel("Se subieron correctamente " + subidos + " Archivos.", Page, upd); } catch (Exception ex) { FuncionGlobal.alerta_updatepanel(ex.Message, Page, upd); } }