private void btn_Cerrar_Click(object sender, EventArgs e) { if (txt_direccion.Text != "" && txt_nombre.Text != "" && mtx_apertura.Text != "" && mtx_cierre.Text != "" && mtx_Telefono.Text != "" && mtx_Cajones.Text != "") { Sucursal_BO sucursal = new Sucursal_BO(); sucursal.Nombre = txt_nombre.Text; sucursal.Direccion = txt_direccion.Text; sucursal.Horario_apaertura = mtx_apertura.Text; sucursal.Horario_cierre = mtx_cierre.Text; sucursal.Numerotelefonico = mtx_Telefono.Text; sucursal.Cantidad_Cajones = int.Parse(mtx_Cajones.Text); Sucursal_DAO sucursal_nube = new Sucursal_DAO(); int respuesta = sucursal_nube.Guardar_Datos(sucursal); if (respuesta == 0) { frm_ERROR_DIALOG ERROR = new frm_ERROR_DIALOG("Intente de nuevo en un momento"); ERROR.ShowDialog(); } else { frm_pruebaDialog EXITO = new frm_pruebaDialog(); EXITO.ShowDialog(); } } else { frm_ERROR_DIALOG ERROR = new frm_ERROR_DIALOG("Verifique llenar los campos"); ERROR.ShowDialog(); } }
private void btn_Eliminar_Click_1(object sender, EventArgs e) { if (txt_nombre_puesto.Text == "") { frm_ERROR_DIALOG error = new frm_ERROR_DIALOG("Seleccione un puesto"); error.ShowDialog(); } else { objPuestoBO.Nombre_puestoempleado = txt_nombre_puesto.Text; if (objPuestoDAO.Eliminar_Puesto(objPuestoBO) == 0) { frm_ERROR_DIALOG error1 = new frm_ERROR_DIALOG("No se ha logrado eliminar"); error1.ShowDialog(); } else { frm_pruebaDialog exito = new frm_pruebaDialog(); exito.ShowDialog(); LimpiarCampos(); dgv_puestos_empleados.DataSource = objPuestoDAO.MostrarPuestos(); } } }
private void btn_actualizar_Click(object sender, EventArgs e) { if (txt_nombre_tip_estado.Text == "") { frm_ERROR_DIALOG error = new frm_ERROR_DIALOG("Seleccione un tipo de registro"); error.ShowDialog(); } else { objBO.Estado = txt_nombre_tip_estado.Text; if (objDAO.Actualizar_tipoRecibo(objBO) == 0) { frm_ERROR_DIALOG error = new frm_ERROR_DIALOG("No se ha logrado actualizar el registro"); error.ShowDialog(); } else { frm_pruebaDialog exito = new frm_pruebaDialog(); exito.ShowDialog(); LimpiarCampos(); dgv_tipos_estados.DataSource = objDAO.Mostrar_tiposEstado(); } } }
private void btn_actualizar_Click(object sender, EventArgs e) { if (mtx_Sueldo.Text != "" && txt_apellido1.Text != "" && txt_apellido2.Text != "" && txt_nombre.Text != "" && cbx_Cargo.Text != "Seleccione" && txt_correo.Text != "" && txt_contraseña.Text != "") { Empleado_DAO crear = new Empleado_DAO(); Sucursal_DAO verificar = new Sucursal_DAO(); Empleado_BO nuevo = new Empleado_BO(); nuevo.Nombre = txt_nombre.Text; nuevo.Apellido_11 = txt_apellido1.Text; nuevo.Apellido_21 = txt_apellido2.Text; nuevo.Salario_Base = int.Parse(mtx_Sueldo.Text); nuevo.Id_Empleado = id_empleado; nuevo.Id_sucursal = idsucu; try { byte[] imgbytes = Convertir_Imagen_Bytes(user); nuevo.Imagen = Convert.ToBase64String(imgbytes); } catch { } if (rbx_Matutino.Checked) { nuevo.Horario_Trabajo1 = rbx_Matutino.Text; } else { nuevo.Horario_Trabajo1 = rbx_Vespertino.Text; } nuevo.Correo_Electronico1 = txt_correo.Text; nuevo.Clave_Sesion1 = txt_contraseña.Text; try { nuevo.Puesto = verificar.Asignar_Puesto(cbx_Cargo.Text); } catch (Exception ex) { frm_ERROR_DIALOG ERROR = new frm_ERROR_DIALOG("Intente nuevamente"); ERROR.ShowDialog(); } int guardar = crear.Actualizar_Datos(nuevo); if (guardar == 0) { frm_ERROR_DIALOG ERROR = new frm_ERROR_DIALOG("Intente nuevamente"); ERROR.ShowDialog(); } else { frm_pruebaDialog exito = new frm_pruebaDialog(); exito.ShowDialog(); Limpiar_campos(); dgv_Empleados.DataSource = ejecutar.tabla_empleado(); } } else { frm_ERROR_DIALOG ERROR = new frm_ERROR_DIALOG("llene todos los campos"); ERROR.ShowDialog(); } }
private void btn_actualizar_Click(object sender, EventArgs e) { if (txt_nombre_tip_vehiculo.Text == "") { frm_ERROR_DIALOG error = new frm_ERROR_DIALOG("Seleccione un tipo de registro"); error.ShowDialog(); } else { ObjtipVeBO.Tipo_vehiculo = txt_nombre_tip_vehiculo.Text; if (ObjtipveDAO.Actualizar_tipoRecibo(ObjtipVeBO) == 0) { frm_ERROR_DIALOG error = new frm_ERROR_DIALOG("No se ha logrado actualizar el registro"); error.ShowDialog(); } else { frm_pruebaDialog exito = new frm_pruebaDialog(); exito.ShowDialog(); LimpiarCampos(); dgv_tipos_vehiculo.DataSource = ObjtipveDAO.Mostrar_tiposVehiculo(); } } }
private void btn_eliminar_Click(object sender, EventArgs e) { if (datos.Id_Empleado == 0) { string texto = "No se ha seleccionado a un empleado"; frm_ERROR_DIALOG error = new frm_ERROR_DIALOG(texto); error.ShowDialog(); } else { ejecutar.Eliminar_Datos(datos); frm_pruebaDialog exto = new frm_pruebaDialog(); exto.ShowDialog(); dgv_Empleados.DataSource = ejecutar.tabla_empleado(); Cargar(); Limpiar_campos(); } }
private void btn_Agregar_Click_1(object sender, EventArgs e) { if (txt_nombre_puesto.Text != "") { objPuestoBO.Nombre_puestoempleado = txt_nombre_puesto.Text; if (objPuestoDAO.Agregar_Puesto(objPuestoBO) == 0) { frm_ERROR_DIALOG error = new frm_ERROR_DIALOG("Error al guardar"); error.ShowDialog(); } else { frm_pruebaDialog exito = new frm_pruebaDialog(); exito.ShowDialog(); LimpiarCampos(); dgv_puestos_empleados.DataSource = objPuestoDAO.MostrarPuestos(); } } }
private void btn_Agregar_Click(object sender, EventArgs e) { if (txt_nombre_tip_estado.Text != "") { objBO.Estado = txt_nombre_tip_estado.Text; if (objDAO.Agregar_tipoEstado(objBO) == 0) { frm_ERROR_DIALOG error = new frm_ERROR_DIALOG("Error al guardar"); error.ShowDialog(); } else { frm_pruebaDialog exito = new frm_pruebaDialog(); exito.ShowDialog(); LimpiarCampos(); dgv_tipos_estados.DataSource = objDAO.Mostrar_tiposEstado(); } } }
private void btn_Agregar_Click(object sender, EventArgs e) { if (txt_nombre_tip_vehiculo.Text != "") { ObjtipVeBO.Tipo_vehiculo = txt_nombre_tip_vehiculo.Text; if (ObjtipveDAO.Agregar_tipoVehiculo(ObjtipVeBO) == 0) { frm_ERROR_DIALOG error = new frm_ERROR_DIALOG("Error al guardar"); error.ShowDialog(); } else { frm_pruebaDialog exito = new frm_pruebaDialog(); exito.ShowDialog(); LimpiarCampos(); dgv_tipos_vehiculo.DataSource = ObjtipveDAO.Mostrar_tiposVehiculo(); } } }
private void btn_actualizar_Click(object sender, EventArgs e) { if (txt_nombre_puesto.Text == "") { frm_ERROR_DIALOG error = new frm_ERROR_DIALOG("Campos vacios"); error.ShowDialog(); } else { objPuestoBO.Nombre_puestoempleado = txt_nombre_puesto.Text; if (objPuestoDAO.Actualizar_Puesto(objPuestoBO) == 0) { frm_ERROR_DIALOG errorr = new frm_ERROR_DIALOG("No se ha logrado actualizar el registro"); errorr.ShowDialog(); } else { frm_pruebaDialog exito = new frm_pruebaDialog(); exito.ShowDialog(); dgv_puestos_empleados.DataSource = objPuestoDAO.MostrarPuestos(); LimpiarCampos(); } } }
private void btn_Cerrar_Click(object sender, EventArgs e) { if (txt_costo.Text != "" && txt_motivo.Text != "" && id_mot != 0 && id_sucu != 0) { nuevo.Motivo = txt_motivo.Text; nuevo.Id_sucu = id_sucu; nuevo.Id_tipo = id_mot; nuevo.Costo = int.Parse(txt_costo.Text); nuevo.Descripcion = txt_descripcion.Text; nuevo.Fecha_creacion = dtp_fecha.Value.Date; try { recibo.Agregar_Recibo(nuevo); frm_pruebaDialog exito = new frm_pruebaDialog(); txt_motivo.Text = ""; txt_descripcion.Text = ""; txt_costo.Text = ""; exito.ShowDialog(); } catch { frm_ERROR_DIALOG error = new frm_ERROR_DIALOG("intente nuevamente "); error.ShowDialog(); } } else { frm_ERROR_DIALOG error = new frm_ERROR_DIALOG("llene todos los campos"); error.ShowDialog(); } if (dialogo) { this.Close(); } }
private void btn_Eliminar_Click(object sender, EventArgs e) { if (txt_nombre_tip_recibo.Text == "") { frm_ERROR_DIALOG error = new frm_ERROR_DIALOG("Seleccione un registro"); error.ShowDialog(); } else { objReciboBO.Nombre_tipRecibo = txt_nombre_tip_recibo.Text; if (objReciboDAO.Eliminar_tipoRecibo(objReciboBO) == 0) { frm_ERROR_DIALOG error1 = new frm_ERROR_DIALOG("No se ha logrado eliminar el registro"); error1.ShowDialog(); } else { frm_pruebaDialog exito = new frm_pruebaDialog(); exito.ShowDialog(); LimpiarCampos(); dgv_tipos_recibos.DataSource = objReciboDAO.Mostrar_tiposRecibo(); } } }