public void CargarCartasInformativas() { try { string CMD = string.Format("SELECT COUNT(fac.ID_FACTURA_COD) as TotalServicios from facturas fac "); DataSet ds = Mysqlcon.EjecutarConDT(CMD); lblTotalServicios.Text = ds.Tables[0].Rows[0]["TotalServicios"].ToString().Trim(); } catch { MessageBox.Show("Usuario o contraseña incorrecta "); } }
public void CargarCartasInformativas() { try { string CMD = string.Format("SELECT COUNT(cli.ID_CLIENTE) as TotalCli from clientes cli"); DataSet ds = Mysqlcon.EjecutarConDT(CMD); TotalClientes = ds.Tables[0].Rows[0]["TotalCli"].ToString().Trim(); lblTotalClientes.Text = TotalClientes; } catch { MessageBox.Show("Usuario o contraseña incorrecta "); } }
public void CargarCartasInformativas() { try { string CMD = string.Format("SELECT COUNT(tec.ID_TECNICO) as TotalTec from tecnicos tec"); DataSet ds = Mysqlcon.EjecutarConDT(CMD); TotalTecnicos = ds.Tables[0].Rows[0]["TotalTec"].ToString().Trim(); lblTotalTecnicos.Text = TotalTecnicos; } catch { MessageBox.Show("Usuario o contraseña incorrecta "); } }
public static DataSet LLenarTablaXCliente(string NombreCli) { DataSet DS; string cmd = string.Format("SELECT fac.ID_FACTURA_COD as Codigo, fac.FAC_FECHA_FACTURA as Fecha," + "CONCAT(cli.CLI_NOMBRES_CLIENTE,' ',cli.CLI_APELLIDOS_CLIENTE) as Cliente," + "det.DET_DESCRIPCION_SERVICIOS as 'Descripcion'," + " ser.SER_TIPO_SERVICIO as 'Tipo de Servicio', " + "concat(tec.TEC_NOMBRES_TECNICO,' ',tec.TEC_APELLIDOS_TECNICO) AS Tecnico," + " det.DET_CANTIDAD_SERVICIO as 'Cantidad', det.DET_PRECIO_SERVICIOS as 'Precio', " + " (det.DET_CANTIDAD_SERVICIO * det.DET_PRECIO_SERVICIOS) AS 'Total Servicio'" + " FROM facturas fac inner join detalle_facturas det on fac.ID_FACTURA_COD = det.FACTURAS_ID_FACTURA_COD" + " inner join servicios ser on ser.ID_SERVICIO = det.SERVICIOS_ID_SERVICIO" + " inner join clientes cli on fac.CLIENTE_ID_CLIENTE = cli.ID_CLIENTE" + " inner join tecnicos tec on fac.TECNICOS_ID_TECNICO = tec.ID_TECNICO" + " WHERE cli.CLI_NOMBRES_CLIENTE LIKE '%" + NombreCli + "%'" + " order by fac.ID_FACTURA_COD"); DS = Mysqlcon.EjecutarConDT(cmd); return(DS); }
private void btnIngresar_Click(object sender, EventArgs e) { try { string CMD = string.Format("Select * FROM tecnicos WHERE USER_ACCOUNT='{0}' AND TEC_PASSWORD_TECNICO='{1}'", txtUsername.Text.Trim(), txtPasswordReal.Text.Trim()); DataSet ds = Mysqlcon.EjecutarConDT(CMD); idTecnico = ds.Tables[0].Rows[0]["ID_TECNICO"].ToString().Trim(); NombresTecnico = ds.Tables[0].Rows[0]["TEC_NOMBRES_TECNICO"].ToString().Trim() + " " + ds.Tables[0].Rows[0]["TEC_APELLIDOS_TECNICO"].ToString().Trim(); string cuenta = ds.Tables[0].Rows[0]["USER_ACCOUNT"].ToString().Trim(); string contra = ds.Tables[0].Rows[0]["TEC_PASSWORD_TECNICO"].ToString().Trim(); if (cuenta == txtUsername.Text.Trim() && contra == txtPasswordReal.Text.Trim()) { VentanaPrincipal Wprincipal = new VentanaPrincipal(); this.Hide(); Wprincipal.Show(); } } catch (Exception error) { MessageBox.Show("Usuario o contraseña incorrecta "); } }