private void Buscar_viaje_Load(object sender, EventArgs e) { Formularios dataCiudad = new Formularios(); //LLeno combobox Ciudad Origen DataSet ds_origen = dataCiudad.llenaComboboxCiudad(); comboBox1.DataSource = ds_origen.Tables[0].DefaultView; //se especifica el campo de la tabla comboBox1.DisplayMember = "ciud_nombre"; comboBox1.ValueMember = "ciud_id"; // LLeno combobox de ciudad destino DataSet ds_destino = dataCiudad.llenaComboboxCiudad(); comboBox2.DataSource = ds_destino.Tables[0].DefaultView; //se especifica el campo de la tabla comboBox2.DisplayMember = "ciud_nombre"; comboBox2.ValueMember = "ciud_id"; funciones func = new funciones(); this.dateTimePicker1.Value = func.Ahora(); }
private void button1_Click(object sender, EventArgs e) { funciones func = new funciones(); if (this.dateTimePicker1.Value >= func.Ahora()) { if (Convert.ToInt32(comboBox1.SelectedValue) != Convert.ToInt32(comboBox2.SelectedValue)) { Select_viaje form_viaje = new Select_viaje(); form_viaje.ciud_origen = Convert.ToInt32(comboBox1.SelectedValue); form_viaje.ciud_destino = Convert.ToInt32(comboBox2.SelectedValue); form_viaje.fecha = Convert.ToString(dateTimePicker1.Value); form_viaje.admin = this.admin; form_viaje.Show(); } else { MessageBox.Show("Las cidades de origen y destino no pueden ser iguales", "Error Destinos"); } } else { MessageBox.Show("Debe seleccionar una fecha mayor al dia de hoy", "Error Fecha"); } }
private void button3_Click(object sender, EventArgs e) { funciones pasajes = new funciones(); Int32 microAlterno = 0; microAlterno = pasajes.buscarMicroAlternativo(MicroFormBaja.f1.inicio.Value, MicroFormBaja.f1.fin.Value, modificacion.f1.TextBox1.Text); if (microAlterno == 0) { Abm_Micro.nuevoMicro MicroNuevo = new Abm_Micro.nuevoMicro(); MicroNuevo.Show(); this.Close(); } else { bool result = pasajes.reemplazarViajes(microAlterno, modificacion.f1.TextBox1.Text, MicroFormBaja.f1.tipo_baja, MicroFormBaja.f1.inicio.Value, MicroFormBaja.f1.fin.Value); if (result) { MessageBox.Show("Proceso completado correctamente"); this.Close(); } else { MessageBox.Show("Ocurrió un error al reemplazar los viajes"); } } }
public Login() { InitializeComponent(); UserLookAndFeel.Default.SetSkinStyle(SkinStyle.Caramel); f = new funciones(); }
private void actualizarPuntos() { //aca deberia actualizar los puntos de la gente !!!! y validar los que se vencieron funciones actualiza_y_valida = new funciones(); actualiza_y_valida.actualizar_y_validar_puntos(Form1.f1.viaje); }
private void button1_Click_1(object sender, EventArgs e) { funciones patente = new funciones(); if (!patente.noExistePatente(textBox1.Text)) { MessageBox.Show("La patente ingresada ya existe!"); } else { funciones pasajes = new funciones(); Int32 microAlterno = 0; microAlterno = pasajes.cargameMicro(modificacion.f1.TextBox1.Text, textBox1.Text); //microAlterno = pasajes.buscarMicro(patenteNueva.nueva.text.Text); if (microAlterno.Equals(null)) { MessageBox.Show("Hubo un error, no se pudo dar de alta el micro"); } else { MessageBox.Show("Micro dado de alta correctamente"); pasajes.reemplazarViajes(microAlterno, modificacion.f1.TextBox1.Text, MicroFormBaja.f1.tipo_baja, Abm_Micro.MicroFormBaja.f1.inicio.Value, Abm_Micro.MicroFormBaja.f1.fin.Value); } this.Close(); } }
private void button1_Click(object sender, EventArgs e) { if (this.textBox1.Text != string.Empty) { Formularios puntos = new Formularios(); funciones func = new funciones(); func.vencerPuntos(); ListadoPuntos listadopuntos = new ListadoPuntos(); listadopuntos.puntoslista = puntos.dataPuntosFrecuente(Convert.ToInt32(this.textBox1.Text)); if (listadopuntos.puntoslista.Tables[0].Rows.Count > 0) { listadopuntos.premiolista = puntos.datapremiosFrecuente(Convert.ToInt32(this.textBox1.Text)); listadopuntos.clie_dni = Convert.ToInt32(this.textBox1.Text); listadopuntos.admin = this.admin; this.Hide(); listadopuntos.Show(); } else { MessageBox.Show("No existen datos para el DNI ingresado", "Puntos"); } } else { MessageBox.Show("El DNI no puede estar vacio", "Error"); } }
private void button3_Click(object sender, EventArgs e) { funciones pasajes = new funciones(); Int32 microAlterno = 0; microAlterno = pasajes.buscarMicroAlternativo(MicroFormBaja.f1.inicio.Value, MicroFormBaja.f1.fin.Value, modificacion.f1.TextBox1.Text); if (microAlterno == 0) { Abm_Micro.nuevoMicro MicroNuevo = new Abm_Micro.nuevoMicro(); MicroNuevo.Show(); this.Close(); }else { bool result = pasajes.reemplazarViajes(microAlterno, modificacion.f1.TextBox1.Text, MicroFormBaja.f1.tipo_baja, MicroFormBaja.f1.inicio.Value, MicroFormBaja.f1.fin.Value); if (result) { MessageBox.Show("Proceso completado correctamente"); this.Close(); } else { MessageBox.Show("Ocurrió un error al reemplazar los viajes"); } } }
private void button1_Click(object sender, EventArgs e) { funciones pasajes = new funciones(); /*VER BIEN DONDE ENGANCHA EN EL PROCESO DE DEVOLVER LOS PASAJES*/ pasajes.devolverPasajes(modificacion.f1.TextBox1.Text, MicroFormBaja.f1.tipo_baja, MicroFormBaja.f1.inicio.Value, MicroFormBaja.f1.fin.Value); }
private void list_funcionalidades_Load(object sender, EventArgs e) { if (this.rol_nomb_mod != null) //evaluamos si esta seteada la var rol_nombre { //esta seteada si ya se selecciono un rol a modificar this.rol_select_tbox.Text = this.rol_nomb_mod; //this.rol_select_tbox.ReadOnly = true; this.select_boton.Enabled = false; //cargamos lista segun corresponde string query = "SELECT func_id, func_nombre FROM DATACENTER.Funcionalidad"; connection connect = new connection(); DataTable tabla_todas_func = connect.execute_query(query); list_funcionalidades.DataSource = tabla_todas_func; list_funcionalidades.DisplayMember = "func_nombre"; list_funcionalidades.ValueMember = "func_id"; //tildamos las funciones que ya tiene el rol int i; funciones func = new funciones(); for (i = 0; i < (this.list_funcionalidades.Items.Count); i++) { this.list_funcionalidades.SelectedIndex = i; if (func.check_func_activa(this.id_rol_a_mod, this.list_funcionalidades.SelectedValue.ToString())) { this.list_funcionalidades.SetItemChecked(i, true); } } } else { this.rol_select_tbox.Enabled = false; } }
public void ShowData() { //INSTANCIA D LA CLASE Y ENVIAMOS UN OBJETO funciones Accionar = new funciones(TheClienttt); //LLAMAMOS AL METODO PARA MOSTRAR LOS DATOS Accionar.MostrarDatos(myVar); }
private void MicroFormModificacion_Load(object sender, EventArgs e) { llenacombobox(); funciones empresa = new funciones(); this.textBox1.Text = modificacion.f1.TextBox1.Text; this.textBox2.Text = empresa.buscaEmpresaActual(this.textBox1.Text); }
public Top5Clientes(string anio, string semestre) { InitializeComponent(); this.funciones = new funciones(); this.anio = anio; this.semestre = semestre; this.mensaje = new Cargando(); this.mensaje.Show(); }
private void button1_Click(object sender, EventArgs e) { if (this.admin) { funciones user_func = new funciones(); user_func.canjearProducto(Convert.ToInt32(dataGridView1.CurrentRow.Cells["prem_id"].Value.ToString()), this.clie_dni); } this.Close(); }
public MicrosDiasFueraServicio(string anio, string semestre) { InitializeComponent(); this.funciones = new funciones(); this.anio = anio; this.semestre = semestre; this.mensaje = new Cargando(); this.mensaje.Show(); }
public MasPasajesCancelados(string anio, string semestre) { InitializeComponent(); this.funciones = new funciones(); this.anio = anio; this.semestre = semestre; this.mensaje = new Cargando(); this.mensaje.Show(); }
public MicrosMasButacasVacias(string anio, string semestre) { InitializeComponent(); this.funciones = new funciones(); this.anio = anio; this.semestre = semestre; this.mensaje = new Cargando(); this.mensaje.Show(); }
public VPreparacion() { InitializeComponent(); f = new funciones(); llenarTabla(); //Asignar estilo de ventana UserLookAndFeel.Default.SetSkinStyle(SkinStyle.Caramel); }
private void button1_Click(object sender, EventArgs e) { funciones insertar = new funciones(); if (insertar.insertarViaje(Convert.ToInt32(comboBox2.SelectedValue), Convert.ToInt32(comboBox1.SelectedValue),dateTimePicker1.Value, dateTimePicker2.Value)) { MessageBox.Show("Viaje dado de alta correctamente"); this.Close(); } else { MessageBox.Show("El micro ya tiene viajes asignados en esas fechas"); } }
private void button1_Click(object sender, EventArgs e) { funciones modificacion = new funciones(); if (modificacion.modificar_micro(this.textBox1.Text, comboBox1.Text)) { MessageBox.Show("Micro modificado correctamente"); this.Close(); } else { MessageBox.Show("Ocurrió un error al modificar el micro, intente mas tarde"); } }
private void button1_Click(object sender, EventArgs e) { funciones pasajes = new funciones(); bool ok; ok = pasajes.devolucionPersonal(Convert.ToInt32(textBox2.Text), Convert.ToInt32(textBox1.Text), richTextBox1.Text); if (ok) { MessageBox.Show("Devolucion completada correctamente"); this.Close(); }else { MessageBox.Show("Ocurrió un error, revise los datos ingresados"); } }
private void button1_Click(object sender, EventArgs e) { funciones insertar = new funciones(); if (insertar.insertarViaje(Convert.ToInt32(comboBox2.SelectedValue), Convert.ToInt32(comboBox1.SelectedValue), dateTimePicker1.Value, dateTimePicker2.Value)) { MessageBox.Show("Viaje dado de alta correctamente"); this.Close(); } else { MessageBox.Show("El micro ya tiene viajes asignados en esas fechas"); } }
protected void btn_revisado_Click(object sender, EventArgs e) { pentagSQL bd = new pentagSQL(); funciones funcMail = new funciones(); DataTable dtUsers = new DataTable(); string inspectID = Request.QueryString["inspectID"]; string planID = Request.QueryString["actPlanID"]; string areaID = bd.getSingleValueByID("area_id", inspectID, "tbl_inspect", "inspect_id", ConnectionString); dtUsers = bd.getUsersByArea(areaID, ConnectionString); string userCreate = bd.getSingleValueByID("usr_username", inspectID, "tbl_inspect", "inspect_id", ConnectionString); string userCreateMail = bd.getEmailByUserName(userCreate, ConnectionString); string supervisor = bd.getSingleValueByID("sup_username", userCreate, "tbl_inspect", "usr_username", ConnectionString); string correoSupervisor = bd.getEmailByUserName(supervisor, ConnectionString); string[] correos = new string[dtUsers.Rows.Count + 1]; string[] cc = { correoSupervisor }; string bodytext = ""; string horaFecha = DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss"); int i = 0; foreach (DataRow row in dtUsers.Rows) { //tomamos los correos de todos los encargados del area correos[i] = row["usrInfo_email"].ToString(); i++; } //actualizar el estatus bd.updateStatus("12", Request.QueryString["inspectID"], ConnectionString); //cuerpoCorreo bodytext = "Esitmad@: <br /><br />"; bodytext = bodytext + "<br />Por medio del presente se le notifica que la inspección con Folio:" + inspectID + " fue revizada!<br /><br />"; bodytext = bodytext + "Por favor, se le solicita su revisión y visto bueno para la misma<br />"; bodytext = bodytext + "<br />"; bodytext = bodytext + "\nPara más información, haga clic en el siguiente enlace. <a href='http://10.240.151.139/pentagono/inspectRes.aspx?inspectID=" + inspectID + "&actPlanID=" + planID + "'>Clic aqui</a>"; btn_revisado.Enabled = false; //Aqui manda el correo electrónico para avisar que se terminó de documentar funcMail.enviarCorreo("Aspen App Web", correos, cc, "Supervisor", bodytext, "Inspección revisada"); //Agregar código para la bitacora de seguimiento bd.insertBitacora(horaFecha, "Inspección revisada", "Inspección revisada por: " + Session["userName"], "inspects", inspectID, planID, Session["userName"].ToString(), "1", ConnectionString); Response.Redirect("dash-inspect.aspx"); }
private void button1_Click(object sender, EventArgs e) { funciones pasajes = new funciones(); bool baja_ok = false; if (comboBox1.Text == "Fin vida útil") { baja_ok = pasajes.bajaServicioMicro(dateTimePicker1.Value, this.textBox1.Text); if (baja_ok) { MessageBox.Show("Micro dado de baja correctamente"); } else { MessageBox.Show("Ocurrió un error al modificar el micro, intente mas tarde"); } } else { baja_ok = pasajes.bajaTecnicaMicro(dateTimePicker1.Value, dateTimePicker2.Value, this.textBox1.Text); if (baja_ok) { MessageBox.Show("Micro dado de baja correctamente"); } else { MessageBox.Show("Ocurrió un error al modificar el micro, intente mas tarde"); } } if (baja_ok) { if (pasajes.contarPasajesVendidos(dateTimePicker1.Value, dateTimePicker2.Value, this.textBox1.Text) == 0) /*el micro no tiene pasajes vendidos asique todo ok*/ { MessageBox.Show("Micro sin viajes asignados"); } else /*preguntar si se cancelan los viajes existentes o se busca un micro sustituto*/ { Abm_Micro.buscaMicro buscarMicro = new Abm_Micro.buscaMicro(); buscarMicro.Show(); this.Close(); } } this.Close(); }
private void button1_Click(object sender, EventArgs e) { funciones pasajes = new funciones(); /*VER BIEN DONDE ENGANCHA EN EL PROCESO DE DEVOLVER LOS PASAJES*/ bool result = pasajes.devolverPasajes(modificacion.f1.TextBox1.Text, MicroFormBaja.f1.tipo_baja, MicroFormBaja.f1.inicio.Value, MicroFormBaja.f1.fin.Value); if (result) { MessageBox.Show("Devolución de pasajes completa"); this.Close(); } else { MessageBox.Show("Ocurrió un error al devolver los pasajes"); } }
private void button1_Click(object sender, EventArgs e) { funciones analisis = new funciones(); if (analisis.registrar_micro(Form1.f1.viaje, Form1.f1.llegada)) { actualizarPuntos(); Registrar_LLegada_Micro.Nueva_carga nueva = new Registrar_LLegada_Micro.Nueva_carga(); nueva.Show(); this.Close(); } else { MessageBox.Show("Ocurrió un error al registrar el micro, intente mas tarde"); } }
private void button1_Click(object sender, EventArgs e) { funciones pasajes = new funciones(); bool ok; ok = pasajes.devolucionPersonal(Convert.ToInt32(textBox2.Text), Convert.ToInt32(textBox1.Text), richTextBox1.Text); if (ok) { MessageBox.Show("Devolucion completada correctamente"); this.Close(); } else { MessageBox.Show("Ocurrió un error, revise los datos ingresados"); } }
private void button1_Click(object sender, EventArgs e) { funciones analisis = new funciones(); if (analisis.registrar_micro( Form1.f1.viaje, Form1.f1.llegada )) { actualizarPuntos(); Registrar_LLegada_Micro.Nueva_carga nueva = new Registrar_LLegada_Micro.Nueva_carga(); nueva.Show(); this.Close(); } else { MessageBox.Show("Ocurrió un error al registrar el micro, intente mas tarde"); } }
private void aplicar_boton_Click(object sender, EventArgs e) { int i; funciones func = new funciones(); stored_procedures stored_proc = new stored_procedures(); //this.Visible = false; for (i = 0; i < (this.list_funcionalidades.Items.Count); i++) { this.list_funcionalidades.SelectedIndex = i; if (this.list_funcionalidades.GetItemChecked(i)) { //consulto si la func la tnia ya el Rol //si la tnia la dejo sino la agrego if (!func.check_func_activa(this.id_rol_a_mod, this.list_funcionalidades.SelectedValue.ToString())) { stored_proc.insert_funcxrol(this.rol_nomb_mod, Convert.ToInt16(this.list_funcionalidades.SelectedValue.ToString())); } } else { //consulto si la func la tnia ya el usuario //si la tnia la elimino if (func.check_func_activa(this.id_rol_a_mod, this.list_funcionalidades.SelectedValue.ToString())) { stored_proc.delete_funcxrol(this.id_rol_a_mod, this.list_funcionalidades.SelectedValue.ToString()); } } } if(this.estado_comboBox.SelectedIndex ==-1) //Devuelve -1 si no se ha seleccionado ninguna opcion del combo { estado_actual_rol = func.get_estado_BD(id_rol_a_mod); } //this.Visible = true; //devuelve true si se realizaron cambios en el nombre o estado if (func.check_cambio_nomb_est_rol(id_rol_a_mod, this.estado_actual_rol, this.rol_select_tbox.Text, this.rol_nomb_mod)) stored_proc.update_rol(this.id_rol_a_mod, this.rol_select_tbox.Text, estado_actual_rol); MessageBox.Show("Actualización Exitosa", "Modificación Rol", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); }
private void button1_Click(object sender, EventArgs e) { funciones patente = new funciones(); if (!patente.noExistePatente(patenteBox.Text)) { MessageBox.Show("La patente ingresada ya existe!"); } else { bool res = patente.insertar_micro(servicioCombo.Text, Convert.ToInt32(butacaCombo.Value), Convert.ToInt32(kgText.Text), marcaCombo.Text, modeloBox.Text, patenteBox.Text, Convert.ToInt32(textBox1.Text)); if (res) this.mensaje = "Datos correctos"; else this.mensaje = "Mmmm Lo siento, no se pudo crear el micro"; MessageBox.Show(mensaje); } }
protected void Button1_Click(object sender, EventArgs e) { /***** * Aqui hace falta agregar una condición en caso de que todo sea correcto, no hace falta acciones ******/ //if(grv_actions.Rows.Count>0) //{ funciones funcMail = new funciones(); pentagSQL bd = new pentagSQL(); DataTable dtUsers = new DataTable(); string inspectID = Request.QueryString["inspectID"]; string planID = Request.QueryString["actPlanID"]; string horaFecha = DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss"); //string supervisor = bd.getSingleValueByID("sup_username", Session["userName"].ToString(), "tbl_inspect", "usr_username", ConnectionString); string supervisor = bd.getSingleValueByID("sup_username", inspectID, "tbl_inspect", "inspect_id", ConnectionString); string correoSupervisor = bd.getEmailByUserName(supervisor, ConnectionString); string[] correos = { correoSupervisor }; string[] cc = { Session["email"].ToString() }; string bodytext = ""; int i = 0; //cuerpoCorreo bodytext = "Esitmad@: <br /><br />"; bodytext = bodytext + "<br />Por medio del presente se le notifica que la inspección con Folio:" + inspectID + " fue realizada!<br /><br />"; bodytext = bodytext + "Por favor, se le solicita su revisión y visto bueno para la misma<br />"; bodytext = bodytext + "<br />"; bodytext = bodytext + "\nPara más información, haga clic en el siguiente enlace. <a href='http://10.240.151.139/pentagono/inspectRes.aspx?inspectID=" + inspectID + "&actPlanID=" + planID + "'>Clic aqui</a>"; btn_guardar.Enabled = false; //Aqui manda el correo electrónico para avisar que se terminó de documentar funcMail.enviarCorreo("Aspen App Web", correos, cc, "Supervisor", bodytext, "Inspección realizada"); //Agregar código para la bitacora de seguimiento bd.insertBitacora(horaFecha, "Inspección actualizada", "Inspección realizada por: " + Session["userName"], "inspects", inspectID, planID, Session["userName"].ToString(), "1", ConnectionString); Response.Redirect("dash-inspect.aspx"); //} /*else * { * lbl_err.Text = "Es necesario que defina por lo menos una acción"; * }*/ }
private void ingresar_pasaje(Int32 voucher_id) { funciones func = new funciones(); double precio_butaca = func.getPasjasjePrecio(this.viaje_id); double precio_encomienda = func.getEncomiendaPrecio(this.viaje_id); for (Int32 i = 0; i < butaca_cli_id.Count; i++) { if (this.pasaje_65.Contains(Convert.ToInt32(this.pasaje_cli_id[i]))) { func.crear_pasaje(this.viaje_id, voucher_id, this.butaca_cli_id[i], Convert.ToInt32(this.pasaje_cli_id[i]), 0, 1, precio_butaca / 2); } else { func.crear_pasaje(this.viaje_id, voucher_id, this.butaca_cli_id[i], Convert.ToInt32(this.pasaje_cli_id[i]), 0, 0, precio_butaca); } } }
private void button1_Click(object sender, EventArgs e) { funciones ModCiti = new funciones(); /*if (this.textBox1.Text != CiudNombre) { citiExist = ModCiti.CheckCity(this.textBox1.Text); }*/ if (this.checkBox1.Checked) { ModCiti.ModifyReco(Reco_id, 1, this.maskedTextBox2.Text, this.maskedTextBox1.Text); MessageBox.Show("Ciudad dada de baja correctamente", "Modicar ciudad"); this.Close(); } else { ModCiti.ModifyReco(Reco_id, 0, this.maskedTextBox2.Text, this.maskedTextBox1.Text); MessageBox.Show("Ciudad modificada correctamente", "Modicar ciudad"); this.Close(); } }
private void Usuario_datos_Load() { funciones func = new funciones(); this.maskedTextBox1.Text = string.Empty; this.textBox1.Text = string.Empty; this.textBox2.Text = string.Empty; this.textBox3.Text = string.Empty; this.maskedTextBox2.Text = string.Empty; this.textBox4.Text = string.Empty; this.dateTimePicker1.Value = func.Ahora(); if (this.discapacitado || this.has_kg) { this.checkBox1.Visible = false; } else { this.checkBox1.Visible = true; } this.is_client = false; }
private void button2_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(textBox1.Text)) { MessageBox.Show("Error, debe ingresar una patente"); } else { funciones existe = new funciones(); if (existe.noExistePatente(textBox1.Text)) { MessageBox.Show("Error, no existen micros con esa patente"); } else { Abm_Micro.MicroFormBaja microBaja = new Abm_Micro.MicroFormBaja(); microBaja.Show(); this.Hide(); } } }
private void button1_Click(object sender, EventArgs e) { bool result; bool citiExist = true; funciones dataCiudad = new funciones(); citiExist = dataCiudad.CheckCity(this.textBox1.Text); if (citiExist) { MessageBox.Show("Ciudad Duplicada", "Error"); } else { result = dataCiudad.insertarCiudad(this.textBox1.Text); if (result == true) { MessageBox.Show("Ciudad Creada correctamente"); this.Close(); } } }
private void button1_Click_1(object sender, EventArgs e) { funciones analisis = new funciones(); //int id_viaje = 0; id_viaje = analisis.validar_terminal_arribo(textBox1.Text, comboBox2.Text, comboBox1.Text, dateTimePicker1.Value); if (id_viaje != 0) { //mostrar datos del micro if (analisis.validar_fecha_salida(id_viaje)) { Registrar_LLegada_Micro.Datos_Micro datos = new Registrar_LLegada_Micro.Datos_Micro(); datos.Show(); } else { MessageBox.Show("Error. El micro indicado aún no comenzo el viaje"); } } else { MessageBox.Show("Error. El micro arribó a una ciudad incorrecta"); } }
private void button1_Click(object sender, EventArgs e) { bool result; funciones dataCiudad = new funciones(); if (Convert.ToInt32(comboBox1.SelectedValue) != Convert.ToInt32(comboBox2.SelectedValue) && this.textBox1.Text != string.Empty && this.textBox2.Text != string.Empty) { if (dataCiudad.CheckRecorrido(Convert.ToInt32(comboBox1.SelectedValue), Convert.ToInt32(comboBox2.SelectedValue), Convert.ToInt32(comboBox3.SelectedValue))) { MessageBox.Show("El recorrido que trata de crear ya existe", "Error"); } else { result = dataCiudad.insertarRecorrido(Convert.ToInt32(comboBox1.SelectedValue), Convert.ToInt32(comboBox2.SelectedValue), Convert.ToInt32(comboBox3.SelectedValue), Convert.ToInt32(this.textBox1.Text), Convert.ToInt32(this.textBox2.Text)); if (result == true) { MessageBox.Show("Recorrido creado correctamente", "Crear Recorrido"); this.Close(); } } } else if (Convert.ToInt32(comboBox1.SelectedValue) == Convert.ToInt32(comboBox2.SelectedValue)) { MessageBox.Show("Existe un error en los destinos ","Error"); } else if (this.textBox1.Text == string.Empty) { MessageBox.Show("El precio base de encomienda no puede ser 0 ", "Error"); } else if (this.textBox2.Text == string.Empty) { MessageBox.Show("El precio base de pasaje no puede ser 0 ", "Error"); } }
public override void validarSemantica() { //FALTA #region Validar Existe Variable funciones func = new funciones(); func.parametros = new T_Campos(); func.retorno = Retorno; Tipo Var = null; if (InfSemantica.getInstance().tblFunciones.ContainsKey(this.Var)) { throw new Exception("Error Semantico - La funcion " + this.Var + " ya existe"); } if (InfSemantica.getInstance().tblSimbolos.ContainsKey(this.Var)) { throw new Exception("Error Semantico - La variable " + this.Var + " ya existe declarada en una funcion"); } if (Var == null) { //Campo.validarSemantica(); Declaracion tmp = Campo; while (tmp != null) { Variable v = tmp.Var; if (func.parametros.ContainsKey(v.id)) { throw new Exception("Error Semantico - La variable " + v.id + " ya existe"); } func.parametros.Add(v.id, tmp.Tip); InfSemantica.getInstance().tblSimbolos.Add(v.id, tmp.Tip); //InfSemantica.getInstance().tblSimbolos.Add(v.id, tmp.Tip); tmp = tmp.Sig; } } else { throw new Exception("Error Semantico - La variable " + this.Var + " ya existe"); } #endregion if (Retorno != null) { #region Valida Valor de Retorno Sentencia tmp = S; bool flag = (tmp is S_Return); while (tmp != null && flag == false) { tmp.SentValSemantica(); tmp = tmp.sig; flag = (tmp is S_Return); } if (!(Retorno is Voids)) { if (tmp is S_Return) { S_Return ret = ((S_Return)tmp); Tipo T = ret.Expr.validarSemantica(); if (!Retorno.esEquivalente(T)) { throw new Exception("Error Semantico - Expresion de retorno no es el mismo que el retorno de la funcion"); } } else { throw new Exception("Error Semantico - Se esperaba el valor de retorno que tiene que ser " + Retorno.ToString()); } } else { if (tmp is S_Return) { throw new Exception("Error Semantico - La funcion es tipo void no tiene que retornar nada."); } } InfSemantica.getInstance().tblFunciones.Add(this.Var, func); #endregion } }
private void button1_Click(object sender, EventArgs e) { funciones func_user = new funciones(); Formularios datos = new Formularios(); Formularios datos_new = new Formularios(); SqlDataReader lectura_new; string cliente; if (this.textBox1.Text != string.Empty || this.textBox2.Text != string.Empty || this.textBox3.Text != string.Empty || this.textBox4.Text != string.Empty || this.maskedTextBox1.Text != string.Empty || this.maskedTextBox2.Text != string.Empty ) { if (is_client) { if (this.textBox1.Text != this.lectura["Cli_Nombre"].ToString() || this.textBox2.Text != this.lectura["Cli_Apellido"].ToString() || this.textBox3.Text != this.lectura["Cli_Dir"].ToString() || this.maskedTextBox2.Text != this.lectura["Cli_Telefono"].ToString() || this.textBox4.Text != this.lectura["Cli_Mail"].ToString() || this.dateTimePicker1.Value != Convert.ToDateTime(this.lectura["Cli_Fecha_Nac"].ToString())) { func_user.modClient(Convert.ToInt32(this.lectura["Cli_id"].ToString()), Convert.ToInt32(this.maskedTextBox1.Text), this.textBox1.Text, this.textBox2.Text, this.textBox3.Text, Convert.ToInt32(this.maskedTextBox2.Text), this.textBox4.Text, this.dateTimePicker1.Value); } cliente = this.lectura["Cli_id"].ToString(); } else { this.lectura = datos.datos_user(Convert.ToInt32(maskedTextBox1.Text)); if (this.lectura == null) { func_user.newClient(Convert.ToInt32(this.maskedTextBox1.Text), this.textBox1.Text, this.textBox2.Text, this.textBox3.Text, Convert.ToInt32(this.maskedTextBox2.Text), this.textBox4.Text, this.dateTimePicker1.Value); lectura_new = datos_new.datos_user(Convert.ToInt32(maskedTextBox1.Text)); lectura_new.Read(); cliente = lectura_new["Cli_id"].ToString(); } else { complete_textbox(); cliente = this.lectura["Cli_id"].ToString(); } } if (func_user.check_viaje_dup(Convert.ToInt32(cliente), this.viaje_id) && func_user.check_is_traveling(Convert.ToInt32(cliente), this.viaje_id)) { this.pasaje_cli_id.Add(cliente); if (checkBox1.Checked) { this.discapacitado = true; this.has_discapacitado = Convert.ToInt32(cliente); } if (has_kg) { this.has_kg = false; MessageBox.Show("Ya ha ingresado la encomienda", "Ingreso de Encomienda"); } else { this.add_psj = this.add_psj + 1; if ((func_user.Ahora() - this.dateTimePicker1.Value).TotalDays > 23360) this.pasaje_65.Add(Convert.ToInt32(cliente)); MessageBox.Show("Gracias, ya ha ingresado un nuevo pasaje", "Ingreso de pasajeros"); } if (this.cant_pasj == this.add_psj && this.has_kg == false) { BuscarButaca busq = new BuscarButaca(); busq.cantidad = add_psj; busq.kg = cant_kg; busq.pasaje_cli_id = this.pasaje_cli_id; busq.viaje_id = this.viaje_id; busq.admin = this.admin; busq.discapacitado = this.discapacitado; busq.pasaje_65 = this.pasaje_65; busq.has_discapacitado = this.has_discapacitado; busq.Show(); this.Close(); } else { Usuario_datos_Load(); } } else { MessageBox.Show("El usuario ya posee pasajes o esta en viaje en esa fecha", "Error operacion"); Usuario_datos_Load(); } } else { MessageBox.Show("No estan todos los campos completos", "Error operacion"); } }
private void button1_Click(object sender, EventArgs e) { funciones func_user = new funciones(); Formularios datos = new Formularios(); Formularios datos_new = new Formularios(); SqlDataReader lectura_new; string cliente; Int32 voucher_id; double precio_butaca = func_user.getPasjasjePrecio(this.viaje_id); double precio_encomienda = func_user.getEncomiendaPrecio(this.viaje_id); if (this.textBox1.Text != string.Empty && this.textBox2.Text != string.Empty && this.textBox3.Text != string.Empty && this.textBox4.Text != string.Empty && this.maskedTextBox1.Text != string.Empty && this.maskedTextBox2.Text != string.Empty ) { if (this.maskedTextBox3.Text != string.Empty && this.maskedTextBox4.Text != string.Empty && this.maskedTextBox5.Text != string.Empty && this.maskedTextBox6.Text != string.Empty || this.opcion == "Efectivo") { if (this.is_client) { if (this.textBox1.Text != this.lectura["Cli_Nombre"].ToString() || this.textBox2.Text != this.lectura["Cli_Apellido"].ToString() || this.textBox3.Text != this.lectura["Cli_Dir"].ToString() || this.maskedTextBox2.Text != this.lectura["Cli_Telefono"].ToString() || this.textBox4.Text != this.lectura["Cli_Mail"].ToString() || this.dateTimePicker1.Value != Convert.ToDateTime(this.lectura["Cli_Fecha_Nac"].ToString())) { func_user.modClient(Convert.ToInt32(this.lectura["Cli_id"].ToString()), Convert.ToInt32(this.maskedTextBox1.Text), this.textBox1.Text, this.textBox2.Text, this.textBox3.Text, Convert.ToInt32(this.maskedTextBox2.Text), this.textBox4.Text, this.dateTimePicker1.Value); } cliente = this.lectura["Cli_id"].ToString(); } else { this.lectura = datos.datos_user(Convert.ToInt32(maskedTextBox1.Text)); if (this.lectura == null) { func_user.newClient(Convert.ToInt32(this.maskedTextBox1.Text), this.textBox1.Text, this.textBox2.Text, this.textBox3.Text, Convert.ToInt32(this.maskedTextBox2.Text), this.textBox4.Text, this.dateTimePicker1.Value); lectura_new = datos_new.datos_user(Convert.ToInt32(maskedTextBox1.Text)); lectura_new.Read(); cliente = lectura_new["Cli_id"].ToString(); } else { complete_textbox(); cliente = this.lectura["Cli_id"].ToString(); } } if (this.discapacitado) { if (this.cant_psj > 2) { if ((this.pasaje_65.Count - 2) > 0) { this.discount = 4 + (this.pasaje_65.Count - 2); } } else { this.discount = 4; } } else { this.discount = this.pasaje_65.Count; } voucher_id = func_user.realizar_compra(Convert.ToInt32(cliente), this.kg, this.viaje_id, this.cant_psj, this.discount); if (this.kg > 0) { func_user.crear_pasaje(this.viaje_id, voucher_id, this.butaca_cli_id[0], Convert.ToInt32(this.pasaje_cli_id[0]), this.kg, 0, precio_encomienda); this.butaca_cli_id.Remove(butaca_cli_id[0]); this.pasaje_cli_id.Remove(pasaje_cli_id[0]); foreach (string cliente_id in this.pasaje_cli_id) { if (Convert.ToInt32(cliente_id) == has_discapacitado) { func_user.crear_pasaje(this.viaje_id, voucher_id, this.butaca_cli_id[this.pasaje_cli_id.IndexOf(cliente_id)], Convert.ToInt32(cliente), 0, 1, 0); this.butaca_cli_id.Remove(butaca_cli_id[this.pasaje_cli_id.IndexOf(cliente_id)]); this.pasaje_cli_id.Remove(cliente_id); if (this.butaca_cli_id.Count > 0) { func_user.crear_pasaje(this.viaje_id, voucher_id, butaca_cli_id[0], Convert.ToInt32(this.pasaje_cli_id[0]), 0, 1, 0); this.butaca_cli_id.Remove(butaca_cli_id[0]); this.pasaje_cli_id.Remove(pasaje_cli_id[0]); break; } else { break; } } } ingresar_pasaje(voucher_id); this.Close(); } else { ingresar_pasaje(voucher_id); this.Close(); } } else { MessageBox.Show("No estan todos los campos de tarjeta completos", "Error operacion"); } } else { MessageBox.Show("No estan todos los campos completos", "Error operacion"); } }