private void Busca_Persona(double rut) { this._persona = new PersonaBC().getpersonabyrut(rut); this._otros = true; if (rut >= 50000000) { this.txt_paterno.Enabled = false; this.txt_materno.Enabled = false; this._otros = false; } this.pnlOtrosDatos.Visible = this._otros; if (this._persona != null) { //this.ib_adquiriente.Visible = true; //this.ib_adquiriente.Attributes.Add("OnClick", "javascript:window.showModalDialog('../administracion/this._personaModal.aspx?idthis._persona=" + FuncionGlobal.FuctionEncriptar(this._persona.Rut.ToString()) + "','#1','dialogHeight: 350px; dialogWidth: 900px;dialogTop: 190px; dialogLeft: 220px; edge: Raised; center: Yes;help: No; resizable: No; status: No;');"); this.txt_rut.Text = this._persona.Rut.ToString(); this.txt_rut.Enabled = false; this.txt_dv.Enabled = false; this.txt_nombre.Text = this._persona.Nombre; this.txt_paterno.Text = this._persona.Apellido_paterno; this.txt_materno.Text = this._persona.Apellido_materno; this.txt_dv.Text = this._persona.Dv; this.giro = this._persona.Giro; this.txt_profesion.Text = this._persona.Profesion; this.txt_nacionalidad.Text = this._persona.Nacionalidad; FuncionGlobal.BuscarValueCombo(this.dl_sexo, this._persona.Sexo); FuncionGlobal.BuscarValueCombo(this.dl_estado_civil, this._persona.Estado_civil); } else { this.txt_dv.Focus(); } }
protected void txtCodigoBarra_TextChanged(object sender, EventArgs e) { if (this.txtCodigoBarra.Text.Trim().Length >= 12) { FuncionGlobal.BuscarValueCombo(this.ddlOficina, Convert.ToInt32(this.txtCodigoBarra.Text.Substring(2, 3)).ToString()); this.txtNroSolicitud.Text = this.txtCodigoBarra.Text.Substring(5, 6); } }
protected void ib_nomina_Click(object sender, ImageClickEventArgs e) { if (this.Filas_Selecionadas()) { FuncionGlobal.BuscarValueCombo(this.dl_nomina, "0"); this.mpe_nominas.Show(); } }
protected void ib_work_Click(object sender, ImageClickEventArgs e) { if (this.Filas_Selecionadas()) { FuncionGlobal.BuscarValueCombo(this.dl_estado, "0"); this.txt_obs.Text = ""; this.mpe_work.Show(); } }
protected void ib_pago_operacion_Click(object sender, ImageClickEventArgs e) { double suma = (from r in this.gr_dato.Rows.OfType <GridViewRow>() where ((CheckBox)r.FindControl("chk")).Checked == true && r.RowType == DataControlRowType.DataRow select Convert.ToDouble(this.gr_dato.DataKeys[r.RowIndex].Values[5])).Sum(); if (suma == 0) { FuncionGlobal.alerta_updatepanel("No hay operaciones seleccionadas o el saldo a pagar es cero", this.Page, this.up_movimiento); return; } FuncionGlobal.BuscarValueCombo(this.dl_financiera, "0"); FuncionGlobal.combocuenta(this.dl_financiera.SelectedValue, this.dl_cuenta); FuncionGlobal.BuscarValueCombo(this.dl_tipo_operacion, "0"); this.txt_fecha_pago.Text = ""; this.txt_especial.Text = ""; this.lbl_total_gastos.Text = string.Format("{0:N0}", suma); this.mpe_movimiento.Show(); }
protected void GetDatosFacturaWS_AG() { if (this.txt_factura.Text.Trim() == "") { return; } System.Net.ServicePointManager.Expect100Continue = false; WSIntegracionAGPSoapClient ws = new WSIntegracionAGPSoapClient(); try { XElement xDoc = XElement.Parse(ws.GetFacturaPorNumero(ConfigurationManager.AppSettings["wsag_user"], ConfigurationManager.AppSettings["wsag_pass"], Convert.ToInt64(this.txt_factura.Text.Replace(ViewState["separadorMiles"].ToString(), "")))); var query = (from f in xDoc.Descendants("factura") select new { datosFactura = new { numeroFactura = (f.Element("datosFactura") != null) ? f.Element("datosFactura").Element("numeroFactura").Value : "", tipoCliente = (f.Element("datosFactura") != null) ? f.Element("datosFactura").Element("tipoCliente").Value : "", codigoSucursal = (f.Element("datosFactura") != null) ? f.Element("datosFactura").Element("codigoSucursal").Value : "", descripSucursal = (f.Element("datosFactura") != null) ? f.Element("datosFactura").Element("descripSucursal").Value : "", fechaFactura = (f.Element("datosFactura") != null) ? f.Element("datosFactura").Element("fechaFactura").Value : "", netoFactura = (f.Element("datosFactura") != null) ? f.Element("datosFactura").Element("netoFactura").Value : "", financiera = (f.Element("datosFactura") != null) ? f.Element("datosFactura").Element("financiera").Value : "" }, datosAdquirente = new { rut = (f.Element("datosAdquiriente") != null) ? f.Element("datosAdquiriente").Element("rut").Value : "", dv = (f.Element("datosAdquiriente") != null) ? f.Element("datosAdquiriente").Element("dv").Value : "", nombre = (f.Element("datosAdquiriente") != null) ? f.Element("datosAdquiriente").Element("nombre").Value : "", paterno = (f.Element("datosAdquiriente") != null) ? f.Element("datosAdquiriente").Element("paterno").Value : "", materno = (f.Element("datosAdquiriente") != null) ? f.Element("datosAdquiriente").Element("materno").Value : "", direccion = (f.Element("datosAdquiriente") != null) ? f.Element("datosAdquiriente").Element("direccion").Value : "", numero = (f.Element("datosAdquiriente") != null) ? f.Element("datosAdquiriente").Element("numero").Value : "", depto = (f.Element("datosAdquiriente") != null) ? f.Element("datosAdquiriente").Element("depto").Value : "", region = (f.Element("datosAdquiriente") != null) ? f.Element("datosAdquiriente").Element("region").Value : "", ciudad = (f.Element("datosAdquiriente") != null) ? f.Element("datosAdquiriente").Element("ciudad").Value : "", comuna = (f.Element("datosAdquiriente") != null) ? f.Element("datosAdquiriente").Element("comuna").Value : "", fono = (f.Element("datosAdquiriente") != null) ? f.Element("datosAdquiriente").Element("fono").Value : "" }, datosVehiculo = new { tipoVehiculo = (f.Element("datosVehiculo") != null) ? f.Element("datosVehiculo").Element("tipoVehiculo").Value : "", marca = (f.Element("datosVehiculo") != null) ? f.Element("datosVehiculo").Element("marca").Value : "", codigoModelo = (f.Element("datosVehiculo") != null) ? f.Element("datosVehiculo").Element("codigoModelo").Value : "", descripModelo = (f.Element("datosVehiculo") != null) ? f.Element("datosVehiculo").Element("descripModelo").Value : "", vin = (f.Element("datosVehiculo") != null) ? f.Element("datosVehiculo").Element("vin").Value : "", chasis = (f.Element("datosVehiculo") != null) ? f.Element("datosVehiculo").Element("vin").Value : "", anio = (f.Element("datosVehiculo") != null) ? f.Element("datosVehiculo").Element("anio").Value : "", motor = (f.Element("datosVehiculo") != null) ? f.Element("datosVehiculo").Element("motor").Value : "", cilindraje = (f.Element("datosVehiculo") != null) ? f.Element("datosVehiculo").Element("cilindraje").Value : "", color = (f.Element("datosVehiculo") != null) ? f.Element("datosVehiculo").Element("color").Value : "", carga = (f.Element("datosVehiculo") != null) ? f.Element("datosVehiculo").Element("carga").Value : "", pesoBruto = (f.Element("datosVehiculo") != null) ? f.Element("datosVehiculo").Element("pesoBruto").Value : "", combustible = (f.Element("datosVehiculo") != null) ? f.Element("datosVehiculo").Element("combustible").Value : "", numeroPuertas = (f.Element("datosVehiculo") != null) ? f.Element("datosVehiculo").Element("numeroPuertas").Value : "", numeroAsientos = (f.Element("datosVehiculo") != null) ? f.Element("datosVehiculo").Element("numeroAsientos").Value : "" } }).FirstOrDefault(); if (query != null) { double num; // Carga datos de la factura string[] aux = query.datosFactura.fechaFactura.Trim().Substring(0, query.datosFactura.fechaFactura.Trim().IndexOf(" ")).Split('/'); this.txt_fecha_factura.Text = string.Format("{0:dd/MM/yyyy}", DateTime.Parse(aux[2] + "-" + aux[0] + "-" + aux[1])); if (double.TryParse(query.datosFactura.netoFactura.Replace(".", ","), out num)) { this.txt_monto_factura.Text = Convert.ToInt64(num).ToString("N0"); } // Carga datos del vehículo this.agp_vehiculo.TipoVehiculo = query.datosVehiculo.tipoVehiculo.Trim(); this.agp_vehiculo.Marca = query.datosVehiculo.marca.Trim(); this.agp_vehiculo.Modelo = query.datosVehiculo.descripModelo.Trim(); this.agp_vehiculo.Anio = query.datosVehiculo.anio.Trim(); this.agp_vehiculo.Cilindrada = query.datosVehiculo.cilindraje.Trim(); this.agp_vehiculo.Puertas = query.datosVehiculo.numeroPuertas.Trim(); this.agp_vehiculo.Asientos = query.datosVehiculo.numeroAsientos.Trim(); this.agp_vehiculo.PesoBruto = query.datosVehiculo.pesoBruto.Trim(); this.agp_vehiculo.PesoCarga = query.datosVehiculo.carga.Trim(); this.agp_vehiculo.Combustible = query.datosVehiculo.combustible.Trim(); this.agp_vehiculo.Color = query.datosVehiculo.color.Trim(); this.agp_vehiculo.Motor = query.datosVehiculo.motor.Trim(); this.agp_vehiculo.Chasis = query.datosVehiculo.chasis.Trim(); this.agp_vehiculo.Serie = ""; //this.agp_vehiculo.setVin(query.datosVehiculo.vin.Trim()); // Carga datos del negocio FuncionGlobal.BuscarValueCombo(this.dl_sucursal, new SucursalclienteBC().getSucursalParidadAG(query.datosFactura.codigoSucursal.Trim()).Id_sucursal.ToString()); // Carga datos del adquirente if (new PersonaBC().getpersonabyrut(Convert.ToDouble(query.datosAdquirente.rut)) == null) { this.agp_adquirente.Rut = Convert.ToDouble(query.datosAdquirente.rut); this.agp_adquirente.DV = query.datosAdquirente.dv.ToUpper().Trim(); this.agp_adquirente.Nombre = query.datosAdquirente.nombre.ToUpper().Trim(); this.agp_adquirente.Paterno = query.datosAdquirente.paterno.ToUpper().Trim(); this.agp_adquirente.Materno = query.datosAdquirente.materno.ToUpper().Trim(); } else { this.agp_adquirente.Mostrar_Form(Convert.ToDouble(query.datosAdquirente.rut)); } } } finally { ws.Close(); } }
private void getDatosvehiculo(string id_solicitud) { DatosVehiculo mdato = new DatosvehiculoBC().getDatovehiculo(Convert.ToInt32(this.id_solicitud)); if (mdato != null) { Operacion moper = new OperacionBC().getoperacion(Convert.ToInt32(this.id_solicitud)); if (moper.Cliente.Id_cliente == 3 && moper.Tipo_operacion.Codigo.Trim() == "CTC" || moper.Cliente.Id_cliente == 4 && moper.Tipo_operacion.Codigo.Trim() == "CTC") { this.dl_impuesto.Visible = true; } if (mdato.Forma_pago != null) { this.txt_forma_pago.Text = mdato.Forma_pago.ToString(); } if (mdato.Precio != 0) { this.txt_precio_venta.Text = FuncionGlobal.NumeroConFormato(mdato.Precio.ToString()); } if (mdato.Kilometraje != 0) { this.txt_kilometraje.Text = FuncionGlobal.NumeroConFormato(mdato.Kilometraje.ToString()); } if (mdato.Fecha_contrato.ToShortDateString() != "01/01/1900") { this.txt_fecha_contrato.Text = mdato.Fecha_contrato.ToShortDateString(); } if (mdato.Prenda != "false") { this.chk_prenda.Checked = Convert.ToBoolean(mdato.Prenda); this.Datosprendedor.Visible = true; this.Datosprendedor.Mostrar_Form(Convert.ToDouble(mdato.Rut_prenda)); } DataTable dt = new DataTable(); dt.Columns.Add("nro_cuota"); dt.Columns.Add("nro_cheque"); dt.Columns.Add("fecha_cheque"); dt.Columns.Add("monto_cheque"); foreach (ChequesFormaPago cheque in new ChequesFormaPagoBC().get_cheques_operacion(mdato.Id_solicitud)) { DataRow dr = dt.NewRow(); dr["nro_cuota"] = cheque.Id_cheque; dr["nro_cheque"] = cheque.Nro_cheque; dr["fecha_cheque"] = cheque.Fecha_cheque.ToShortDateString(); dr["monto_cheque"] = cheque.Monto_cheque; dt.Rows.Add(dr); //this.dl_financiera.SelectedValue = cheque.Codigo_banco; FuncionGlobal.BuscarValueCombo(this.dl_financiera, cheque.Codigo_banco.Trim()); } if (dt.Rows.Count > 0) { this.txt_cheques.Text = dt.Rows.Count.ToString(); this.pnlInfoCheques.Visible = true; this.gr_cheques.DataSource = dt; this.gr_cheques.DataBind(); suma_grilla(); } else { this.txt_cheques.Text = "0"; this.pnlInfoCheques.Visible = false; this.gr_cheques.DataSource = null; this.gr_cheques.DataBind(); } } return; }
private void Busca_Persona(double rut) { Persona persona = new PersonaBC().getpersonabyrut(rut); ViewState["rut"] = rut; ViewState["apellidos"] = true; if (rut >= 50000000) { ViewState["apellidos"] = false; ViewState["otrosDatos"] = false; } this.pnl_apellidos.Visible = Convert.ToBoolean(ViewState["apellidos"] ?? false); this.rfv_paterno.Enabled = Convert.ToBoolean(ViewState["apellidos"] ?? false); this.rfv_paterno2.Enabled = Convert.ToBoolean(ViewState["apellidos"] ?? false); this.rfv_materno.Enabled = Convert.ToBoolean(ViewState["apellidos"] ?? false); this.rfv_materno2.Enabled = Convert.ToBoolean(ViewState["apellidos"] ?? false); if (Convert.ToBoolean(ViewState["apellidos"] ?? false)) { this.lbl_rut.Text = "R.U.N."; this.lbl_nombre.Text = "Nombres"; } else { this.lbl_rut.Text = "R.U.T."; this.lbl_nombre.Text = "Razón Social"; } this.rfv_rut.ErrorMessage = string.Format("{0} ({1})", this.lbl_rut.Text, this.Titulo); this.rfv_nombre.ErrorMessage = string.Format("{0} ({1})", this.lbl_nombre.Text, this.Titulo); this.pnl_otros_datos.Visible = Convert.ToBoolean(ViewState["otrosDatos"]); //if (Convert.ToBoolean(ViewState["otrosDatos"])) //{ // this.rfv_estado_civil.Enabled = Convert.ToBoolean(ViewState["apellidos"] ?? false); // this.rfv_estado_civil2.Enabled = Convert.ToBoolean(ViewState["apellidos"] ?? false); // this.rfv_sexo.Enabled = Convert.ToBoolean(ViewState["apellidos"] ?? false); // this.rfv_sexo2.Enabled = Convert.ToBoolean(ViewState["apellidos"] ?? false); //} if (persona != null && rut != 0) { this.txt_rut.Text = persona.Rut.ToString("N0"); this.txt_rut.Enabled = false; this.txt_dv.Enabled = false; this.txt_nombre.Text = persona.Nombre; this.txt_paterno.Text = persona.Apellido_paterno; this.txt_materno.Text = persona.Apellido_materno; this.txt_dv.Text = persona.Dv; this.txt_profesion.Text = persona.Profesion; this.txt_nacionalidad.Text = persona.Nacionalidad; FuncionGlobal.BuscarValueCombo(dl_sexo, persona.Sexo); FuncionGlobal.BuscarValueCombo(this.dl_estado_civil, persona.Estado_civil); this.Cambio_Persona(new CambioPersonaEventArgs(persona)); } else if (rut == 0) { this.txt_rut.Text = ""; this.txt_dv.Text = ""; this.txt_rut.Enabled = true; this.txt_dv.Enabled = false; this.txt_nombre.Focus(); } else { this.txt_rut.Text = rut.ToString("N0"); this.txt_dv.Text = FuncionGlobal.digitoVerificador(rut.ToString()); this.txt_rut.Enabled = false; this.txt_dv.Enabled = false; this.txt_nombre.Focus(); } }