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; }
private void add_Marcavehiculo() { string add = new MarcavehiculoBC().add_Marcavehiculo(0, this.txt_nombre.Text); FuncionGlobal.alerta("MARCA DE VEHICULO INGRESADO CON EXITO", this.Page); limpiar(); return; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { List <Marcavehiculo> lMarcavehiculo = new MarcavehiculoBC().getallMarcavehiculo(); this.gr_dato.DataSource = lMarcavehiculo; this.gr_dato.DataBind(); } }
public void Button1_Click(object sender, EventArgs e) { if (valida_ingreso()) { add_Marcavehiculo(); List <Marcavehiculo> lMarcavehiculo = new MarcavehiculoBC().getallMarcavehiculo(); this.gr_dato.DataSource = lMarcavehiculo; this.gr_dato.DataBind(); limpiar(); } }
protected void add() { Marcavehiculo marca = new MarcavehiculoBC().getmarcavehiculo(Convert.ToInt16(this.dl_marca_vehiculo.SelectedValue)); Tipovehiculo vehi = new TipovehiculoBC().getTipoVehiculo(this.dl_tipo_vehiculo.SelectedValue); string codigo = new TasacionSIIBC().add_tasacionSII(vehi, marca, this.txt_modelo.Text, Convert.ToInt16(this.txt_ano.Text), this.txt_cilindrada.Text, Convert.ToInt16(this.txt_puerta.Text), this.dl_combustible.SelectedValue, this.dl_transmicion.SelectedValue, this.dl_equipo.SelectedValue, Convert.ToInt32(this.txt_tasacion.Text), 0); this.lbl_codigo.Text = codigo; }
protected void Page_Load(object sender, EventArgs e) { id_marca_vehiculo = FuncionGlobal.FuctionDesEncriptar(Request.QueryString["id_marca"].ToString()); Marcavehiculo mmarca = new MarcavehiculoBC().getmarcavehiculo(Convert.ToInt16(id_marca_vehiculo)); this.lbl_marca.Text = mmarca.Nombre; if (!IsPostBack) { FuncionGlobal.combotipovehiculo(this.dl_tipo); } }
protected void bt_guardar_Click(object sender, EventArgs e) { UpdatePanel up = (UpdatePanel)Master.FindControl("UpdatePanel1"); string rutcomp = "0"; string rutvend = "0"; //if(txtNumFactura.Text == "") //{ // tdMensaje.Visible = true; // lblMensaje.Text = "Favor agregar número de factura."; // return; //} //DateTime result; //bool validafecha = DateTime.TryParse(txt_fecha_documento.Text, out result.ToShortDateString("DD/MM/YYYY")); if (txt_patente.Text == "" || txt_patente.Text == "0") { FuncionGlobal.alerta_updatepanel("Debe ingresar la Fecha de Documento correcta", Page, up); return; } if (txt_patente.Text == "" || txt_patente.Text == "0") { FuncionGlobal.alerta_updatepanel("Debe ingresar la Patente", Page, up); return; } if (txt_fecha_documento.Text == "" || txt_fecha_documento.Text == "0") { FuncionGlobal.alerta_updatepanel("Debe ingresar la Fecha de Documento", Page, up); return; } if (id_cliente == 15) { if (txt_interno.Text == "") { //Response.Write("<script language=javascript>alert('Debe ingresar el número de operación banco');</script>"); //return; FuncionGlobal.alerta_updatepanel("Debe ingresar el número de operación banco", Page, up); return; } if (Convert.ToInt32(txt_interno.Text) <= 0) { FuncionGlobal.alerta_updatepanel("El número de operación banco no corresponde", Page, up); return; //Response.Write("<script language=javascript>alert('El número de operación banco no corresponde');</script>"); //return; } if (txtNumFactura.Text == "") { FuncionGlobal.alerta_updatepanel("Debe ingresar el número de factura", Page, up); return; //Response.Write("<script language=javascript>alert('Debe ingresar el número de factura');</script>"); //return; } var validaNumOperacionBanco = new OperacionBC().validaNumOperacionBanco(Convert.ToInt32(txt_interno.Text), Convert.ToInt32(txtNumFactura.Text)); if (validaNumOperacionBanco.Numero_cliente != txt_interno.Text) { FuncionGlobal.alerta_updatepanel("Por favor revise número de operacion o factura.", Page, up); return; //Response.Write("<script language=javascript>alert('Por favor revise número de operacion o factura.');</script>"); //return; } } if (Datoscomprador.Guardar_Form()) { if (Datoscomprador.InfoPersona != null) { rutcomp = Datoscomprador.InfoPersona.Rut.ToString(); } } if (Datosvendedor.Guardar_Form()) { if (Datosvendedor.InfoPersona != null) { rutvend = Datosvendedor.InfoPersona.Rut.ToString(); } } Int32 add = new OperacionBC().add_operacion(Convert.ToInt32(lbl_numero.Text), Convert.ToInt16(dl_cliente.SelectedValue), tipo_operacion, (string)(Session["usrname"]), 0, (txt_interno.Text.Trim()), Convert.ToInt32(dl_sucursal_origen.SelectedValue), Convert.ToInt32(txtNumFactura.Text)); //PARA ORDEN DE TRABAJO if (IdOrdenTrabajo != 0) { FuncionGlobal.UpdateTipoOperacionOrdenTrabajo(tipo_operacion, IdOrdenTrabajo, add); } string addparcom = new ParticipeOperacionBC().add_participe(add, Convert.ToInt32(Datoscomprador.InfoPersona.Rut), "COMPR"); string addparven = new ParticipeOperacionBC().add_participe(add, Convert.ToInt32(Datosvendedor.InfoPersona.Rut), "VENDE"); Meratenencia mera = new Meratenencia(); mera.Anno_causa = Convert.ToInt32(txt_anno_causa.Text); mera.Autorizacion = txt_autorizacion_doc.Text; mera.Calidad_mero = dl_calidad_mero.SelectedValue; mera.Fecha_doc = Convert.ToDateTime(txt_fecha_documento.Text); mera.Id_solicitud = Convert.ToInt32(add); mera.Lugar_doc = txt_lugar_doc.Text; mera.N_doc = txt_n_doc.Text; mera.Naturaleza_doc = dl_naturaleza_doc.SelectedValue; mera.Rut_comprador = Convert.ToInt32(Datoscomprador.InfoPersona.Rut); mera.Rut_vendedor = Convert.ToInt32(Datosvendedor.InfoPersona.Rut); mera.Tipo_doc = dl_tipo_doc.SelectedValue; mera.Titulo_mera = dl_titulo_mera.SelectedValue; mera.Tribunal = txt_tribunal.Text; mera.N_bien = dl_bien.SelectedValue; string addmera = new MeratenenciaBC().add_meratenencia(mera); DatosVehiculo mdato2 = new DatosvehiculoBC().getDatovehiculobyPatente_id_solicitud(txt_patente.Text, add); Marcavehiculo marca = new Marcavehiculo(); Tipovehiculo tipvehi = new Tipovehiculo(); string mar = dl_marca.SelectedValue; string tip = dl_tipo_vehiculo.SelectedValue; if (mar != "0") { marca = new MarcavehiculoBC().getmarcavehiculo(Convert.ToInt16(mar)); } else { marca = new MarcavehiculoBC().getmarcavehiculo(69); } if (tip != "0") { tipvehi = new TipovehiculoBC().getTipoVehiculo(tip); } else { tipvehi = new TipovehiculoBC().getTipoVehiculo("PDF"); } //Int32 id_dato_vehiculo = 0; if (mdato2 != null) { string datovehi = new DatosvehiculoBC().add_Datosvehiculo(add, mdato2.Marca, mdato2.Tipo_vehiculo, txt_patente.Text, FuncionGlobal.digitoVerificadorPatente(txt_patente.Text), mdato2.Modelo, mdato2.Chassis, "", mdato2.Vin, mdato2.Serie, Convert.ToInt32(0), "", mdato2.Color, 0, 0, "", 0, 0, Convert.ToInt32(0), Convert.ToInt32(0), "", Convert.ToInt32(0), Convert.ToInt32(mdato2.Id_dato_vehiculo), DateTime.Now, "", "false", "", 0, "false", mdato2.Transmision, mdato2.Equipamiento, "0"); } else { string datovehi = new DatosvehiculoBC().add_Datosvehiculo(add, marca, tipvehi, txt_patente.Text, FuncionGlobal.digitoVerificadorPatente(txt_patente.Text), txt_modelo.Text, "", "", "", "", Convert.ToInt32(0), "", "", 0, 0, "", 0, 0, Convert.ToInt32(0), Convert.ToInt32(0), "", Convert.ToInt32(0), 0, DateTime.Now, "", "false", "", 0, "0", "0", "0", "0"); } string add_or = new EstadooperacionBC().add_estado_orden(Convert.ToInt32(add), 1, tipo_operacion, "", (string)(Session["usrname"])); lbl_operacion.Visible = true; lbl_numero.Visible = true; lbl_operacion.Text = "Operación de Meratenencia Numero:"; lbl_numero.Text = Convert.ToString(add); int bien; if (dl_bien.SelectedValue == "0" || dl_bien.SelectedValue == null || dl_bien.SelectedValue == "") { bien = Convert.ToInt32(txt_bien.Text); } else { bien = Convert.ToInt32(dl_bien.SelectedValue); } if (id_cliente == 15) { new BienesNumeroClienteBC().add_integracion_leasing(add, bien, Convert.ToInt32(txt_interno.Text), tipo_operacion); } FuncionGlobal.alerta(lbl_titulo.Text + ", INGRESADO CON EXITO", Page); }
protected void add_operacion() { string rutvend = "0"; int operacion = 0; if (this.Datosvendedor.Guardar_Form()) { if (this.Datosvendedor.InfoPersona != null) { rutvend = this.Datosvendedor.InfoPersona.Rut.ToString(); } } if (this.lbl_numero.Text != "") { operacion = Convert.ToInt32(this.lbl_numero.Text); } string interno = ""; if (tipo_operacion.Trim() == "ctag" || tipo_operacion.Trim() == "dtag") { interno = this.dl_Codigo_TAG.SelectedValue; } else { interno = this.txt_interno.Text.Trim(); } int fac = 0; if (txt_factura.Text.Trim() != "") { fac = Convert.ToInt32(txt_factura.Text.Trim()); } Int32 add = new OperacionBC().add_operacion(operacion, Convert.ToInt16(this.dl_cliente.SelectedValue), tipo_operacion, (string)(Session["usrname"]), 0, interno, Convert.ToInt32(this.dl_sucursal_origen.SelectedValue), fac, this.txt_observacion.Text); string addparven = new ParticipeOperacionBC().add_participe(Convert.ToInt32(add), Convert.ToInt32(this.Datosvendedor.InfoPersona.Rut), "COMPR"); DatosVehiculo mdato2 = new DatosVehiculo(); Int32 id_dato_vehiculo = 0; mdato2 = new DatosvehiculoBC().getDatovehiculo(operacion); Marcavehiculo marca = new Marcavehiculo(); Tipovehiculo tipvehi = new Tipovehiculo(); string mar = this.dl_marca.SelectedValue; string tip = this.dl_tipo_vehiculo.SelectedValue; string anno = "0"; string kilometraje = "0"; if (this.txt_ano.Text != "") { anno = this.txt_ano.Text; } if (this.txt_kilometraje.Text != "") { kilometraje = this.txt_kilometraje.Text; } if (mar != "0") { marca = new MarcavehiculoBC().getmarcavehiculo(Convert.ToInt16(mar)); } else { marca = new MarcavehiculoBC().getmarcavehiculo(69); } if (tip != "0") { tipvehi = new TipovehiculoBC().getTipoVehiculo(tip); } else { tipvehi = new TipovehiculoBC().getTipoVehiculo("PDF"); } if (mdato2 != null) { if (mdato2.Id_solicitud == add) { id_dato_vehiculo = mdato2.Id_dato_vehiculo; } string datovehi = new DatosvehiculoBC().add_Datosvehiculo(add, marca, tipvehi, txt_patente.Text, FuncionGlobal.digitoVerificadorPatente(txt_patente.Text), mdato2.Modelo, mdato2.Chassis, this.txt_motor.Text, mdato2.Vin, mdato2.Serie, Convert.ToInt32(anno), "", mdato2.Color, 0, 0, "", 0, 0, Convert.ToInt32(FuncionGlobal.NumeroSinFormato(kilometraje)), Convert.ToInt32(0), "", Convert.ToInt32(0), id_dato_vehiculo, DateTime.Now, "", "false", "", 0, "false", mdato2.Transmision, mdato2.Equipamiento, "0"); } else { string datovehi = new DatosvehiculoBC().add_Datosvehiculo(add, marca, tipvehi, this.txt_patente.Text, FuncionGlobal.digitoVerificadorPatente(txt_patente.Text), "", "", this.txt_motor.Text, "", "", Convert.ToInt32(anno), "", "", 0, 0, "", 0, 0, Convert.ToInt32(FuncionGlobal.NumeroSinFormato(kilometraje)), Convert.ToInt32(0), "", Convert.ToInt32(0), id_dato_vehiculo, DateTime.Now, "", "false", "", 0, "0", "0", "0", "0"); } string add_or = new EstadooperacionBC().add_estado_orden(Convert.ToInt32(add), 1, tipo_operacion, "", (string)(Session["usrname"])); this.lbl_operacion.Visible = true; this.lbl_numero.Visible = true; this.lbl_operacion.Text = "Operación Numero:"; this.lbl_numero.Text = Convert.ToString(add); FuncionGlobal.alerta(this.lbl_titulo.Text + ", INGRESADO CON EXITO", Page); }
private void add_datosvehiculo() { DateTime fecha = Convert.ToDateTime("01/01/1900"); Int32 precio = 0; Int32 kilometraje = 0; Int32 cantidad = 0; Int32 valor_cesion = 0; Int32 valor_opcion = 0; Int32 contrato = 0; Int32 impuesto = 0; string forma_pago = ""; impuesto = Convert.ToInt32(this.dl_impuesto.SelectedValue); string mstock = new StockVentasBC().act_stockventaImp(Convert.ToInt32(id_solicitud), impuesto); string dv = FuncionGlobal.digitoVerificadorPatente(patente); DatosVehiculo mdato = new DatosvehiculoBC().getDatovehiculobyPatente_id_solicitud(patente, Convert.ToInt32(this.id_solicitud)); if (this.txt_fecha_contrato.Text != "") { fecha = Convert.ToDateTime(this.txt_fecha_contrato.Text); } if (this.txt_forma_pago.Text != "") { forma_pago = this.txt_forma_pago.Text; } if (this.txt_precio_venta.Text != "") { precio = Convert.ToInt32(FuncionGlobal.NumeroSinFormato(this.txt_precio_venta.Text)); } if (this.txt_kilometraje.Text != "") { kilometraje = Convert.ToInt32(FuncionGlobal.NumeroSinFormato(this.txt_kilometraje.Text)); } Int32 rut_prenda = 0; if (this.chk_prenda.Checked == true) { if (this.Datosprendedor.Guardar_Form()) { if (this.Datosprendedor.InfoPersona != null) { rut_prenda = Convert.ToInt32(this.Datosprendedor.InfoPersona.Rut.ToString()); } } } else { precio = Convert.ToInt32(FuncionGlobal.NumeroSinFormato(this.txt_precio_venta.Text)); } Marcavehiculo marca = new MarcavehiculoBC().getmarcavehiculo(Convert.ToInt16(mdato.Marca.Id_marca)); Tipovehiculo vehi = new TipovehiculoBC().getTipoVehiculo(mdato.Tipo_vehiculo.Codigo); string add = new DatosvehiculoBC().add_Datosvehiculo(Convert.ToInt32(this.id_solicitud), marca, vehi, this.patente, dv, mdato.Modelo, mdato.Chassis , mdato.Motor, mdato.Vin, mdato.Serie, mdato.Ano, mdato.Cilindraje, mdato.Color, mdato.Carga, mdato.Pesobruto, mdato.Combustible, mdato.Npuerta, mdato.Nasiento, kilometraje, mdato.Tasacion, mdato.Codigo_SII, precio, mdato.Id_dato_vehiculo, fecha, forma_pago, chk_prenda.Checked.ToString().Trim(), mdato.Estado_vehiculo, rut_prenda, mdato.Financiamiento_amicar, mdato.Transmision, mdato.Equipamiento); int n_cheques = 0; if (int.TryParse(this.txt_cheques.Text, out n_cheques)) { ChequesFormaPagoBC cheques = new ChequesFormaPagoBC(); cheques.del_cheques_operacion(Convert.ToInt32(this.id_solicitud)); for (int i = 0; i < this.gr_cheques.Rows.Count; i++) { int id_cheque = Convert.ToInt32(this.gr_cheques.Rows[i].Cells[0].Text); int nro_cheque = Convert.ToInt32(((TextBox)this.gr_cheques.Rows[i].FindControl("txt_nro_cheque")).Text); DateTime fecha_cheque = Convert.ToDateTime(((TextBox)this.gr_cheques.Rows[i].FindControl("txt_fecha_cheque")).Text); int monto_cheque = Convert.ToInt32(((TextBox)this.gr_cheques.Rows[i].FindControl("txt_monto_cheque")).Text); cheques.add_cheques_operacion(id_cheque, Convert.ToInt32(this.id_solicitud), nro_cheque, fecha_cheque, monto_cheque, this.dl_financiera.SelectedValue, ""); } cheques = null; } if (Panel2.Visible == true) { DateTime fecha_cesion = Convert.ToDateTime(this.txt_fecha_cesion.Text); if (this.txt_cantidad.Text != "" && Convert.ToInt16(this.txt_cantidad.Text) > 0) { cantidad = Convert.ToInt16(FuncionGlobal.NumeroSinFormato(this.txt_cantidad.Text)); } if (this.txt_valor_cesion.Text != "") //if (this.txt_valor_cesion.Text != ""&& Convert.ToUInt16(this.txt_valor_cesion.Text) > 0) { valor_cesion = Convert.ToInt32(FuncionGlobal.NumeroSinFormato(this.txt_valor_cesion.Text)); } if (this.txt_valor_opcion.Text != "") //if (this.txt_valor_opcion.Text != "" && Convert.ToInt32(this.txt_valor_opcion.Text) > 0) { valor_opcion = Convert.ToInt32(FuncionGlobal.NumeroSinFormato(this.txt_valor_opcion.Text)); } if (this.txt_contrato.Text != "") //if (this.txt_contrato.Text != "" && Convert.ToInt32(this.txt_contrato.Text) >0) { contrato = Convert.ToInt32(FuncionGlobal.NumeroSinFormato(this.txt_contrato.Text)); } string addleasing = new Leasing_transferenciaBC().add_leasing(Convert.ToInt32(this.id_solicitud), patente, contrato, fecha_cesion, valor_opcion, valor_cesion, cantidad); } UpdatePanel up = (UpdatePanel)this.Master.FindControl("UpdatePanel1"); FuncionGlobal.alerta_updatepanel("DATOS DEL VEHICULO ACTUALIZADOS CON EXITO", this.Page, up); this.ClientScript.RegisterClientScriptBlock(Page.GetType(), "CloseWnd", "<script type=\"text/javascript\">window.close();</script>"); return; }
private void add() { string rutcomp = "0"; string rutvend = "0"; string rutcompp = "0"; string financiamiento = "0"; UpdatePanel up = (UpdatePanel)this.Master.FindControl("UpdatePanel1"); double rut2 = this.Datoscomprador.getRut(); List <Direcciones> ldireccion = new DireccionesBC().getdirecciones(Convert.ToInt32(rut2)); if (this.dl_forma_pago.SelectedValue == "2" & this.dl_financiera.SelectedValue == "0") { FuncionGlobal.alerta_updatepanel("Debe seleccionar un banco o financiera", Page, up); return; } if (id_cliente == 3 || id_cliente == 4) { if (tipo_operacion == "CVT") { if (this.dl_forma_pago.SelectedValue == "0") { FuncionGlobal.alerta_updatepanel("Debe seleccionar forma de pago", Page, up); return; } } } if (vent == "CTC" || vent == "CTMAG") { Cliente mcliente = new ClienteBC().getclienteusuario(this.Datoscomprador.getRut(), (string)(Session["usrname"])); if (vent == "CTC" && mcliente.Check == true || vent == "CTMAG" && mcliente.Check == true) { tipo_operacion = "CTM"; } else { if (vent == "CTC") { tipo_operacion = "CCV"; } else { tipo_operacion = "CVEN"; } if (ldireccion.Count == 0) { FuncionGlobal.alerta_updatepanel("El comprador no tiene direccion", Page, up); return; } } } if (tipo_operacion != "CTC" || tipo_operacion != "CTMAG") { if (this.Datoscomprador.Guardar_Form()) { if (this.Datoscomprador.InfoPersona != null) { rutcomp = this.Datoscomprador.InfoPersona.Rut.ToString(); } } } if (this.Datosvendedor.Guardar_Form()) { if (this.Datosvendedor.InfoPersona != null) { rutvend = this.Datosvendedor.InfoPersona.Rut.ToString(); } } if (this.agpCompraPara.Guardar_Form()) { if (this.agpCompraPara.InfoPersona != null) { rutcompp = this.agpCompraPara.InfoPersona.Rut.ToString(); } } int factura = 0; if (this.txtNumFactura.Text != "") { factura = Convert.ToInt32(txtNumFactura.Text); } Int32 add = new OperacionBC().add_operacion(Convert.ToInt32(this.lbl_numero.Text), Convert.ToInt16(this.dl_cliente.SelectedValue), tipo_operacion, (string)(Session["usrname"]), 0, this.txt_numero_emisor.Text.Trim(), Convert.ToInt32(this.dl_sucursal_origen.SelectedValue), factura); if (tipo_operacion != "CVT") { this.id_solicitud = Convert.ToInt32(this.lbl_numero.Text); } else { if (this.lbl_numero.Visible == true) { this.id_solicitud = Convert.ToInt32(this.lbl_numero.Text); } } if (chk_leasing.Checked == true) { string leasing = new Leasing_transferenciaBC().add_leasing(add, this.txt_patente.Text.Trim(), Convert.ToInt32(this.txt_n_contrato.Text), Convert.ToDateTime(this.txt_fecha_contrato.Text), Convert.ToInt32(FuncionGlobal.NumeroSinFormato(txt_valor_opcion.Text)), Convert.ToInt32(FuncionGlobal.NumeroSinFormato(txt_valor_cesion.Text)), Convert.ToInt32(this.txt_n_vehiculos.Text)); } DatosVehiculo mdato = new DatosvehiculoBC().getDatovehiculobyPatente_id_solicitud(this.txt_patente.Text.Trim(), id_solicitud); //DatosVehiculo mdato = new DatosvehiculoBC().getDatovehiculobypatente(this.txt_patente.Text); Marcavehiculo marca = new MarcavehiculoBC().getmarcavehiculo(69); Tipovehiculo tipvehi = new TipovehiculoBC().getTipoVehiculo("PDF"); Int32 id_dato_vehiculo = 0; Int32 rut_prenda = 0; if (mdato != null && id_solicitud != 0) { if (vent == "CTM") { marca = mdato.Marca; tipvehi = mdato.Tipo_vehiculo; id_dato_vehiculo = 0; } else { rut_prenda = mdato.Rut_prenda; id_dato_vehiculo = mdato.Id_dato_vehiculo; marca = mdato.Marca; tipvehi = mdato.Tipo_vehiculo; } } DatosVehiculo mdato2; if (id_dato_vehiculo != 0) { mdato2 = new DatosvehiculoBC().getDatovehiculobyPatente_id_solicitud(this.txt_patente.Text.Trim(), id_solicitud); } else { mdato2 = new DatosvehiculoBC().getDatovehiculobypatente(this.txt_patente.Text); } if (mdato2 != null) { string datovehi = new DatosvehiculoBC().add_Datosvehiculo(add, mdato2.Marca, mdato2.Tipo_vehiculo, txt_patente.Text, FuncionGlobal.digitoVerificadorPatente(txt_patente.Text), mdato2.Modelo, mdato2.Chassis, mdato2.Motor, mdato2.Vin, mdato2.Serie, Convert.ToInt32(mdato2.Ano), "", mdato2.Color, 0, 0, "", 0, 0, Convert.ToInt32(FuncionGlobal.NumeroSinFormato(txt_kilometraje.Text)), Convert.ToInt32(FuncionGlobal.NumeroSinFormato(txt_tasacion.Text)), lbl_codigo.Text, Convert.ToInt32(FuncionGlobal.NumeroSinFormato(txt_precio.Text)), Convert.ToInt32(id_dato_vehiculo), DateTime.Now, "", "false", "", 0, financiamiento, mdato2.Transmision, mdato2.Equipamiento); } else { if (this.dl_marca_vehiculo.SelectedValue != "0") { marca = new MarcavehiculoBC().getmarcavehiculo(Convert.ToInt16(this.dl_marca_vehiculo.SelectedValue)); } if (this.dl_tipo_vehiculo.SelectedValue != "0") { tipvehi = new TipovehiculoBC().getTipoVehiculo(this.dl_tipo_vehiculo.SelectedValue); } string datovehi = new DatosvehiculoBC().add_Datosvehiculo(add, marca, tipvehi, txt_patente.Text, FuncionGlobal.digitoVerificadorPatente(txt_patente.Text), this.txt_modelo.Text, this.txt_chassis.Text, this.txt_motor.Text, "", "", Convert.ToInt32(this.txt_anno.Text), "", this.txt_color.Text, 0, Convert.ToInt32(this.txt_p_bruto.Text), this.dl_combustible.SelectedValue, 0, 0, Convert.ToInt32(FuncionGlobal.NumeroSinFormato(txt_kilometraje.Text)), Convert.ToInt32(FuncionGlobal.NumeroSinFormato(txt_tasacion.Text)), lbl_codigo.Text, Convert.ToInt32(FuncionGlobal.NumeroSinFormato(txt_precio.Text)), id_dato_vehiculo, DateTime.Now, "", "false", "", 0, financiamiento.Trim(), this.dl_financiera.SelectedValue, "0", "0"); } if (vent == "") { DatosVehiculo vehicu = new DatosvehiculoBC().getDatovehiculobyPatente_id_solicitud(this.txt_patente.Text, add); if (tipo_operacion == "CTMAG") { string add_stock = new StockVentasBC().add_sotckventas(add, 0, "false", vehicu.Id_dato_vehiculo, false); } else { string add_stock = new StockVentasBC().add_sotckventas(add, 0, "false", vehicu.Id_dato_vehiculo, true); } } else { DatosVehiculo vehicu = new DatosvehiculoBC().getDatovehiculo(id_solicitud); if (vent == "CTC" || vent == "CTMAG") { Cliente mcliente = new ClienteBC().getclienteusuario(this.Datoscomprador.InfoPersona.Rut, (string)(Session["usrname"])); if (vent == "CTC" && mcliente.Check == true || vent == "CTMAG") { string add_stock = new StockVentasBC().add_sotckventas(id_solicitud, add, "false", vehicu.Id_dato_vehiculo, true); } else { string add_stock = new StockVentasBC().add_sotckventas(id_solicitud, add, "true", vehicu.Id_dato_vehiculo, true); } } else { string add_stock = new StockVentasBC().add_sotckventas(id_solicitud, add, "true", vehicu.Id_dato_vehiculo, true); } } if (add != 0) { string add_TR = new TransferenciaBC().add_Transferencia(add, Convert.ToDouble(rutvend), Convert.ToDouble(rutcomp), Convert.ToDouble(rutcompp), Convert.ToInt32(this.dl_sucursal_origen.SelectedValue), this.dl_tag.SelectedValue, this.dl_financiera.SelectedValue, this.dl_forma_pago.SelectedValue ); if (add_TR == "" && vent != "CTC" || vent != "CTMAG") { string add_or = new EstadooperacionBC().add_estado_orden(Convert.ToInt32(add), 1, tipo_operacion, "", (string)(Session["usrname"])); } } this.lbl_operacion.Visible = true; this.lbl_numero.Visible = true; this.lbl_operacion.Text = "Operación de Transferencia Numero:"; this.lbl_numero.Text = Convert.ToString(add); FuncionGlobal.alerta("CONTRATO DE TRANSFERENCIA, INGRESADO CON EXITO", Page); }