private void PrintServicesUltrasound(ServicesControls servicesControls) { try { OleDbCommand command = new OleDbCommand("SELECT * FROM [ServicesUltrasound]", myConnection); myConnection.Open(); OleDbDataReader reader = command.ExecuteReader(); while (reader.Read()) { ServicesEl Item = new ServicesEl(); if (UserName.ToLower() == "admin" && UserPass.ToLower() == "admin") { Item.btnDelete3.Visible = true; Item.btnDelete3.Location = new Point(627, 6); } Item.gunaLabel1.Text = reader[0].ToString(); Item.gunaLabel2.Text = reader[1].ToString(); servicesControls.flowLayoutPanel3.Controls.Add(Item); } reader.Close(); myConnection.Close(); } catch { myConnection.Close(); } }
private void btnServices_Click(object sender, EventArgs e) { HomePanel.Controls.RemoveAt(0); ServicesControls servicesControls = new ServicesControls(); if (UserName.ToLower() == "admin" && UserPass.ToLower() == "admin") { servicesControls.AddBox1.Visible = true; servicesControls.AddBox2.Visible = true; servicesControls.AddBox3.Visible = true; } HomePanel.Controls.Add(servicesControls); servicesControls.Show(); servicesControls.Dock = DockStyle.Fill; servicesControls.BringToFront(); PrintServices(servicesControls); PrintServicesStudy(servicesControls); PrintServicesUltrasound(servicesControls); }