private void button1_Click(object sender, EventArgs e) { this.Hide(); dashboard dashhhh = new dashboard(); dashhhh.Show(); }
private void button1_Click(object sender, EventArgs e) { dashboard dash = new dashboard(); //go to login form dash.Show(); //show login form this.Hide(); //hide app form }
private void bunifuThinButton21_Click(object sender, EventArgs e) { try { string con = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Database\DB.mdf;Integrated Security=True"; SqlConnection sqlConn = new SqlConnection(con); String query = "SELECT * FROM dbo.[User] WHERE Username ='******' AND Password ='******'"; SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(query, sqlConn); DataTable data = new DataTable(); sqlDataAdapter.Fill(data); if (data.Rows.Count == 1) { dashboard dash = new dashboard(); dash.Show(); this.Hide(); } else { MessageBox.Show("Wrong username/ password !!"); } } catch (Exception ex) { MessageBox.Show("Please Connect To The database"); } }
private void button1_Click(object sender, EventArgs e) { dashboard dash = new dashboard(); //next to app form dash = new dashboard(); dash.Show(); //show app form this.Hide(); //login form hide }
private void Button2_Click(object sender, EventArgs e) { if (dash.IsDisposed == true) { dash = new dashboard(); } dash.Show(); }
private void button1_Click(object sender, EventArgs e) { //Application.Exit(); // this is not good for this dashboard dash = new dashboard(); //next to app form dash = new dashboard(); dash.Show(); //show app form this.Hide(); //login form hide }
private void loginloginlogin() { try { if (bunifuMaterialTextbox1.Text == string.Empty && bunifuMaterialTextbox2.Text == string.Empty) { bunifuCustomLabel8.Visible = true; bunifuCustomLabel6.Visible = true; bunifuCustomLabel7.Visible = true; timer1.Start(); } else { //bunifuCircleProgressbar1.Visible = true; string stringcon = System.Configuration.ConfigurationManager.ConnectionStrings["residenceBDcon"].ConnectionString; SqlConnection con = new SqlConnection(stringcon); SqlCommand cmd = new SqlCommand("select * from echipa where email=@LEMAIL and parola=@LPAROLA", con); cmd.Parameters.AddWithValue("@LEMAIL", bunifuMaterialTextbox1.Text); cmd.Parameters.AddWithValue("@LPAROLA", bunifuMaterialTextbox2.Text); Email = bunifuMaterialTextbox1.Text; SqlDataAdapter dt = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); dt.Fill(ds); int count = ds.Tables[0].Rows.Count; if (count == 1) { bunifuCircleProgressbar1.Visible = true; dashboard dash = new dashboard(); //next to app form dash = new dashboard(); dash.Show(); //show app form this.Hide(); //login form hide //bunifuCircleProgressbar1.Visible = false; } else { bunifuCustomLabel8.Visible = true; bunifuCustomLabel6.Visible = true; bunifuCustomLabel7.Visible = true; bunifuCircleProgressbar1.Visible = false; timer1.Start(); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button1_Click(object sender, EventArgs e) { if (User.contains(textBox1.Text, textBox2.Text)) { dash.Show(); } else { MessageBox.Show("invalid"); } }
private void button_Click(object sender, RoutedEventArgs e) { SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\muhammad\Documents\data.mdf;Integrated Security=True;Connect Timeout=30"); SqlDataAdapter sda = new SqlDataAdapter("select count(*) from logic where username= "******"and password" + textBox1.Text + "'", con); this.Hide(); dashboard ss = new dashboard(); ss.Show(); }
private void editbutton_Click(object sender, EventArgs e) { dashboard dh = new dashboard(); SqlConnection con = new SqlConnection(stringcon); if (pictureBox1.Image != null) { MemoryStream ms = new MemoryStream(); pictureBox1.Image.Save(ms, pictureBox1.Image.RawFormat); byte[] a = ms.GetBuffer(); ms.Close(); MemoryStream ms1 = new MemoryStream(); pictureBox2.Image.Save(ms1, pictureBox2.Image.RawFormat); byte[] a2 = ms1.GetBuffer(); ms1.Close(); MemoryStream ms2 = new MemoryStream(); pictureBox3.Image.Save(ms2, pictureBox3.Image.RawFormat); byte[] a3 = ms2.GetBuffer(); ms2.Close(); MemoryStream ms3 = new MemoryStream(); pictureBox4.Image.Save(ms3, pictureBox4.Image.RawFormat); byte[] a4 = ms3.GetBuffer(); ms3.Close(); cmd.Parameters.Clear(); cmd.Connection = con; cmd.CommandText = "Insert into proiecte(numeproiect,judet,oras,strada,data_ora,numaretajeimobil,clasaenergetica,parcare,mezanin,demisol,mansarda ,descriereproiect ,img1,img2,img3,img4,id_echipa,numeagent) values(@numeproiect , @judet , @oras , @strada , @data_ora , @numaretajeimobil, @clasaenergetica, @parcare , @mezanin , @demisol , @mansarda , @descriereproiect , @img1 , @img2 , @img3 , @img4,(select id_echipa from echipa where email=@email),(select CONCAT(nume,' ',prenume) from echipa where email=@email))"; cmd.Parameters.AddWithValue("@numeproiect", nameofproject.Text); cmd.Parameters.AddWithValue("@judet", district_text.Text); cmd.Parameters.AddWithValue("@oras", city_text.Text); cmd.Parameters.AddWithValue("@strada", street_text.Text); cmd.Parameters.AddWithValue("@data_ora", DateTime.Now.ToString("yyyy-MM-dd HH: mm:ss")); cmd.Parameters.AddWithValue("@numaretajeimobil", bunifuDropdown2.selectedValue); cmd.Parameters.AddWithValue("@clasaenergetica", bunifuMaterialTextbox1.Text); cmd.Parameters.AddWithValue("@parcare", bunifuMaterialTextbox1.Text); cmd.Parameters.AddWithValue("@mezanin", mezanine); cmd.Parameters.AddWithValue("@demisol", semibasement); cmd.Parameters.AddWithValue("@mansarda", mansard); cmd.Parameters.AddWithValue("@descriereproiect", richTextBox1.Text); cmd.Parameters.AddWithValue("@img1", a); cmd.Parameters.AddWithValue("@img2", a2); cmd.Parameters.AddWithValue("@img3", a3); cmd.Parameters.AddWithValue("@img4", a4); cmd.Parameters.AddWithValue("@EMAIL", loginform.Email); con.Open(); cmd.ExecuteNonQuery(); con.Close(); } //Application.Exit(); // this is not good for this dashboard dash = new dashboard(); //next to app form dash = new dashboard(); dash.Show(); //show app form this.Hide(); //login form hide dash.bunifuCustomLabel6.Visible = true; dash.popupsuccesdatainsert.Start(); }
private void editbutton_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(stringcon); MemoryStream ms = new MemoryStream(); pictureBox2.Image.Save(ms, pictureBox2.Image.RawFormat); byte[] a = ms.GetBuffer(); ms.Close(); MemoryStream ms1 = new MemoryStream(); pictureBox3.Image.Save(ms1, pictureBox3.Image.RawFormat); byte[] a2 = ms1.GetBuffer(); ms1.Close(); MemoryStream ms2 = new MemoryStream(); pictureBox4.Image.Save(ms2, pictureBox4.Image.RawFormat); byte[] a3 = ms2.GetBuffer(); ms2.Close(); cmd.Parameters.Clear(); cmd.Connection = con; cmd.CommandText = "Insert into proprietati(numeproiect,numeproprietate,pretlista,moneda,data_ora,suprafatatotala,clasaenergetica,tipproprietate,numarbai,suprafataconstruita,suprafatautila,suprafatabalcon ,numarapartament,etaj,finisaje,compartimente,parcare,utilitati,descriere,img1,img2,img3,numeagent,id_proiecte) values(@numeproiect,@numeproprietate,@pretlista,@moneda,@data_ora,@suprafatatotala,@clasaenergetica,@tipproprietate,@numarbai,@suprafataconstruita,@suprafatautila,@suprafatabalcon,@numarapartament,@etaj,@finisaje,@compartimente,@parcare,@utilitati,@descriere, @img1, @img2, @img3,(select CONCAT(nume,' ',prenume) from echipa where email=@EMAIL),(select proiecte.id_proiecte from proiecte inner join proprietati on proiecte.numeproiect = proprietati.numeproiect where proprietati.numeproiect = @b group by proiecte.id_proiecte))"; cmd.Parameters.AddWithValue("@numeproiect", bunifuDropdown2.selectedValue); cmd.Parameters.AddWithValue("@numeproprietate", nameofproject.Text); cmd.Parameters.AddWithValue("@pretlista", bunifuMaterialTextbox1.Text); cmd.Parameters.AddWithValue("@suprafatatotala", bunifuMaterialTextbox2.Text); cmd.Parameters.AddWithValue("@clasaenergetica", bunifuMaterialTextbox3.Text); cmd.Parameters.AddWithValue("@tipproprietate", bunifuDropdown1.selectedValue); cmd.Parameters.AddWithValue("@numarbai", bunifuDropdown3.selectedValue); cmd.Parameters.AddWithValue("@suprafataconstruita", bunifuMaterialTextbox6.Text); cmd.Parameters.AddWithValue("@suprafatautila", bunifuMaterialTextbox5.Text); cmd.Parameters.AddWithValue("@suprafatabalcon", bunifuMaterialTextbox4.Text); cmd.Parameters.AddWithValue("@etaj", bunifuDropdown5.selectedValue); cmd.Parameters.AddWithValue("@finisaje", bunifuDropdown4.selectedValue); cmd.Parameters.AddWithValue("@compartimente", bunifuDropdown6.selectedValue); cmd.Parameters.AddWithValue("@parcare", bunifuDropdown7.selectedValue); cmd.Parameters.AddWithValue("@utilitati", bunifuDropdown8.selectedValue); cmd.Parameters.AddWithValue("@descriere", richTextBox2.Text); cmd.Parameters.AddWithValue("@data_ora", DateTime.Now.ToString("yyyy-MM-dd HH: mm:ss")); cmd.Parameters.AddWithValue("@numarapartament", bunifuMaterialTextbox7.Text); cmd.Parameters.AddWithValue("@EMAIL", loginform.Email); cmd.Parameters.AddWithValue("@b", bunifuDropdown2.selectedValue); cmd.Parameters.AddWithValue("@moneda", bunifuDropdown9.selectedValue); cmd.Parameters.AddWithValue("@img1", a); cmd.Parameters.AddWithValue("@img2", a2); cmd.Parameters.AddWithValue("@img3", a3); con.Open(); cmd.ExecuteNonQuery(); con.Close(); //Application.Exit(); // this is not good for this dashboard dash = new dashboard(); //next to app form dash = new dashboard(); dash.Show(); //show app form this.Hide(); //login form hide dash.bunifuCustomLabel6.Visible = true; dash.popupsuccesdatainsert.Start(); }
private void editbutton_Click(object sender, EventArgs e) { //Application.Exit(); // this is not good for this dashboard dash = new dashboard(); //next to app form dash = new dashboard(); dash.Show(); //show app form this.Hide(); //login form hide SqlConnection con = new SqlConnection(stringcon); Image img = Image.FromFile(@"C:\Users\IULIAN-DANIELGLAVAN\Desktop\Calculator\app_1\bd\verde.png"); byte[] arr; using (MemoryStream ms = new MemoryStream()) { img.Save(ms, System.Drawing.Imaging.ImageFormat.Png); arr = ms.ToArray(); } // string select = "select CONCAT(nume,' ',prenume) from echipa where email=@EMAIL"; cmd.Connection = con; if (bunifuCheckbox1.Checked == true) { con.Open(); //cmd.CommandText = "Insert into clienti_fizici(nume,prenume,email,telefon,adresa,data_nasterii,data_ora,CNP,sex,judetprovenienta,temperamentclient,provenientaclient,descriere,numeagent)values('" + bunifuMaterialTextbox1.Text + "','" + bunifuMaterialTextbox2.Text + "','" + bunifuMaterialTextbox4.Text + "','" + bunifuMaterialTextbox8.Text + "','" + bunifuMaterialTextbox3.Text + "','" + DateTime.Now.ToString("yyyy-MM-dd HH: mm:ss") + "','" + bunifuDatepicker1.Value.Date + "','" + bunifuMaterialTextbox11.Text + "','" + gender + "','" + bunifuMaterialTextbox12.Text + "','" + bunifuDropdown1.selectedValue + "','" + bunifuDropdown2.selectedValue + "','" + richTextBox1.Text + "','" + select + "')"; cmd.CommandText = "Insert into clienti_fizici(nume,prenume,email,telefon,adresa,data_nasterii,data_ora,CNP,sex,judetprovenienta,temperamentclient,provenientaclient,statut,descriere,numeagent)values(@nume,@prenume,@email,@telefon,@adresa,@data_nasterii,@data_ora,@CNP,@sex,@judetprovenienta,@temperamentclient,@provenientaclient,@statut,@descriere,(select CONCAT(nume,' ',prenume) from echipa where email=@EMAIL2))"; cmd.Parameters.AddWithValue("@nume", bunifuMaterialTextbox1.Text); cmd.Parameters.AddWithValue("@prenume", bunifuMaterialTextbox2.Text); cmd.Parameters.AddWithValue("@email", bunifuMaterialTextbox4.Text); cmd.Parameters.AddWithValue("@telefon", bunifuMaterialTextbox8.Text); cmd.Parameters.AddWithValue("@adresa", bunifuMaterialTextbox3.Text); cmd.Parameters.AddWithValue("@data_nasterii", bunifuDatepicker1.Value.Date); cmd.Parameters.AddWithValue("@data_ora", DateTime.Now.ToString("yyyy-MM-dd HH: mm:ss")); cmd.Parameters.AddWithValue("@CNP", bunifuMaterialTextbox11.Text); cmd.Parameters.AddWithValue("@sex", gender); cmd.Parameters.AddWithValue("@judetprovenienta", bunifuMaterialTextbox12.Text); cmd.Parameters.AddWithValue("@temperamentclient", bunifuDropdown1.selectedValue); cmd.Parameters.AddWithValue("@provenientaclient", bunifuDropdown2.selectedValue); cmd.Parameters.AddWithValue("@descriere", richTextBox1.Text); cmd.Parameters.AddWithValue("@statut", arr); cmd.Parameters.AddWithValue("@EMAIL2", loginform.Email); cmd.ExecuteNonQuery(); con.Close(); dash.bunifuCustomLabel6.Visible = true; dash.popupsuccesdatainsert.Start(); } if (bunifuCheckbox2.Checked == true) { con.Open(); cmd.CommandText = "Insert into clienti_juridici(numecompanie,CUI,replegal,telefoncompanie,emailcompanie,adresa,data_nasterii,data_ora,CNP,sex,judetprovenienta,statut,temperamentclient,provenientaclient,descriere,numeagent)values(@numecompanie,@CUI,@replegal,@telefoncompanie,@emailcompanie,@adresa,@data_nasterii,@data_ora,@CNP,@sex,@judetprovenienta,@statut,@temperamentclient,@provenientaclient,@descriere,(select CONCAT(nume,' ',prenume) from echipa where email=@EMAIL2))"; cmd.Parameters.AddWithValue("@numecompanie", bunifuMaterialTextbox5.Text); cmd.Parameters.AddWithValue("@CUI", bunifuMaterialTextbox6.Text); cmd.Parameters.AddWithValue("@replegal", bunifuMaterialTextbox7.Text); cmd.Parameters.AddWithValue("@telefoncompanie", bunifuMaterialTextbox9.Text); cmd.Parameters.AddWithValue("@emailcompanie", bunifuMaterialTextbox10.Text); cmd.Parameters.AddWithValue("@adresa", bunifuMaterialTextbox3.Text); cmd.Parameters.AddWithValue("@data_nasterii", bunifuDatepicker1.Value.Date); cmd.Parameters.AddWithValue("@data_ora", DateTime.Now.ToString("yyyy-MM-dd HH: mm:ss")); cmd.Parameters.AddWithValue("@CNP", bunifuMaterialTextbox11.Text); cmd.Parameters.AddWithValue("@sex", gender); cmd.Parameters.AddWithValue("@judetprovenienta", bunifuMaterialTextbox12.Text); cmd.Parameters.AddWithValue("@temperamentclient", bunifuDropdown1.selectedValue); cmd.Parameters.AddWithValue("@provenientaclient", bunifuDropdown2.selectedValue); cmd.Parameters.AddWithValue("@descriere", richTextBox1.Text); cmd.Parameters.AddWithValue("@statut", arr); cmd.Parameters.AddWithValue("@EMAIL2", loginform.Email); cmd.ExecuteNonQuery(); con.Close(); dash.bunifuCustomLabel6.Visible = true; dash.popupsuccesdatainsert.Start(); } }