public FormCtrl(FormHome home) { InitializeComponent(); homeTmp = home; /* 初始化窗口 */ }
private void ButtonEnter_Click(object sender, EventArgs e) { formHome = new FormHome(); this.Hide(); formHome.ShowDialog(); this.Close(); }
private Form CreateForm(string pFormName) { Form newForm = null; switch (pFormName) { case DIGITAL_AUDIO: newForm = new FormDigitalAudio(); break; case HOME: newForm = new FormHome(); break; case NAVIGATION: newForm = new FormNavigation(); break; case OPTIONS: newForm = new FormOptions(); break; default: throw new Exception("Attempt to create an invalid form: " + pFormName); } newForm.StartPosition = FormStartPosition.Manual; newForm.Location = new Point(0, 0); _loadedForms.Add(pFormName, newForm); return(newForm); }
private void botaoEntrar_Click(object sender, EventArgs e) { string login = textoLogin.Text; string senha = textoSenha.Text; Usuario usuario = new Usuario(login, senha); //verifica se o usuario existe no banco de dados if (usuario.VerificarUsuario()) { MessageBox.Show("Logado com sucesso!", "Sucesso", MessageBoxButtons.OK, MessageBoxIcon.Information); FormHome formHome = new FormHome(usuario); //esconde a tela de login this.Hide(); formHome.Show(); } else { /* Se a mensagem de erro está vazia, siginifica que * não houve erros de banco de dados. * Então os dados que o usuario digitou * que estavam errados. */ if (usuario.MensagemErro == "") { MessageBox.Show("Usuario ou senha errados", "Dados incorretos", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { MessageBox.Show("Um erro ocorreu: " + usuario.MensagemErro); } } }
public FormVigneto(FormHome home) { InitializeComponent(); this.home = home; DbVigneto w = new DbVigneto(); // dichiarazione e definizione di variabili ( list<string> e array[int]) List <string> NomiVigneti = new List <string>(); NomiVigneti = w.Select("nome"); List <string> NrVitiMorte = new List <string>(); NrVitiMorte = w.Select("nrvitimorte"); List <string> Id = new List <string>(); Id = w.Select("id"); // ciclo per aggiungere tutti gli item e i subitem alla listview for (int i = 0; i < Id.Count; i++) { ListViewItem entryListItem = listViewDettagli.Items.Add(NomiVigneti[i]); entryListItem.UseItemStyleForSubItems = true; ListViewItem.ListViewSubItem nrvitmorteItem = entryListItem.SubItems.Add(NrVitiMorte[i]); ListViewItem.ListViewSubItem id = entryListItem.SubItems.Add(Id[i]); } }// end form
public FormUpdate(FormHome home) { InitializeComponent(); homeTmp = home; comboBoxSwVer.SelectedIndex = 0; progBarUpdate.Step = 1;/*设置每次进度条增长多少*/ }
public FormFPGA(FormHome home) { InitializeComponent(); homeTmp = home; progBarUpdate.Step = 1;/*设置每次进度条增长多少*/ comboBoxWRRD.SelectedIndex = 0; }
public FormRd(FormHome home) { InitializeComponent(); homeTmp = home; groupControlLocal.Dock = DockStyle.Fill; groupControlLocal.Visible = true; this.splitContainerControl2.Panel2.Controls.Add(groupControlLocal); }
private void btnCancelar_Click(object sender, EventArgs e) { consumo.CancelarInsercao(); FormHome.Enabled = true; FormHome.Focus(); Dispose(); }
public FormShakespeare(FormHome formHome) { this.formHome = formHome; InitializeComponent(); progressBar1.Minimum = 0; progressBar1.Maximum = 100; textBox1.Text = "Insira sua frase aqui!"; textBox2.Text = "200"; textBox3.Text = "5"; textBox4.Text = "1"; }
private void timer2_Tick(object sender, EventArgs e) { ProgressBar1.Value += 1; ProgressBar1.Text = ProgressBar1.Value.ToString() + "%"; if (ProgressBar1.Value == 100) { timer2.Enabled = false; FormHome objdesktop = new FormHome(); this.Hide(); objdesktop.Show(); } }
public FormAggiungiVino(FormVino formvino, FormHome home) { InitializeComponent(); this.formvino = formvino; this.home = home; DbVino v = new DbVino(); DbVigneto w = new DbVigneto(); // liste di stringhe per inserire nei vari combobox valori già esistenti List <string> NomiVini = new List <string>(); NomiVini = v.SelectDistinct("nome"); List <string> TipologiaVini = new List <string>(); TipologiaVini = v.SelectDistinct("tipologia"); List <string> VignetoVini = new List <string>(); VignetoVini = w.SelectDistinct("nome"); List <string> NrBottiglieVini = new List <string>(); NrBottiglieVini = v.SelectDistinct("nrbottiglie"); // ciclo che aggiunge i nomi già presenti nel db nel combobox nome for (int i = 0; i < NomiVini.Count; i++) { comboBoxNome.Items.Add(NomiVini[i]); } // ciclo che aggiunge le tipologie già presenti nel db nel combobox tipologia for (int i = 0; i < TipologiaVini.Count; i++) { comboBoxTipologia.Items.Add(TipologiaVini[i]); } // ciclo che aggiunge i vari vigneti presenti nel db nel combobox vigneti for (int i = 0; i < VignetoVini.Count; i++) { comboBoxVigneto.Items.Add(VignetoVini[i]); } // ciclo che aggiunge i vari numeri di bottiglie al combobox // anche se numerico viene utilizzato un combobox perchè spesso si produce lo stesso quantitativo // di bottiglie per vini diversi e il numeric updown non permette di selezionare quantità già presenti for (int i = 0; i < NrBottiglieVini.Count; i++) { comboBoxBottiglie.Items.Add(NrBottiglieVini[i]); } }// end FormAggiungiVino
public FormAcc(FormHome home) { InitializeComponent(); homeTmp = home; homeTmp.navGgaMsg.ggaCount = 0;/*清除*/ textBoxLat.Text = "3957.2638"; textBoxLon.Text = "11622.5904"; textBoxAlt.Text = "61.8759"; axisLat = new DrawingCurve(); }
public FormModificaVigneto(ListViewItem.ListViewSubItem id, FormVigneto formvigneto, FormHome home) { InitializeComponent(); this.id = id; this.formvigneto = formvigneto; this.home = home; DbVigneto w = new DbVigneto(); // lettura dal db dei dati necessari // stampa dei dati tramite textbox textBox1.Text = w.SelectElement(id, "nome"); textBox2.Text = w.SelectElement(id, "nrvitimorte"); }// end form
public FormOut(FormHome home) { InitializeComponent(); homeTmp = home; toolStripStatusLabelRxLen.Text = "0"; /* 初始化线程 */ pThUartOut = new Thread(thShowUart) { IsBackground = true, Name = "uart_out_thread", Priority = ThreadPriority.Normal }; pThUartOut.Start(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // |==============================PREVIO==============================| ManagerFiles.Instance.Init(); ManagerDatabase.Instance.Init(); // |==============================COMIENZA==============================| FormHome form = new FormHome(); ManagerForms.Instance.Init(form); Application.Run(form); }
private void buttonLogin_Click(object sender, EventArgs e) { string accessKey = callGetAccessKey(); if ("false".Equals(accessKey)) { MessageBox.Show("Wrong username or password", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { string roleString = callRole(); int role = 0; FormHome home = new FormHome(accessKey, 0);//0-admin, 1-employee this.Hide(); home.Closed += (s, args) => this.Close(); home.Show(); } }
public FormVino(FormHome home) { InitializeComponent(); this.home = home; DbVino v = new DbVino(); // creo delle liste di stringhe e attribuisco a ciascuna le varie informazioni contenute nel database List <string> NomiVini = new List <string>(); NomiVini = v.Select("nome"); List <string> AnnoVini = new List <string>(); AnnoVini = v.Select("anno"); List <string> TipologiaVini = new List <string>(); TipologiaVini = v.Select("tipologia"); List <string> VignetoVini = new List <string>(); VignetoVini = v.Select("vigneto"); List <string> NrBottiglieVini = new List <string>(); NrBottiglieVini = v.Select("nrbottiglie"); List <string> Id = new List <string>(); Id = v.Select("id"); // ciclo per aggiungere tutti gli item e i subitem alla listview for (int i = 0; i < Id.Count; i++) { ListViewItem entryListItem = listViewDettagli.Items.Add(NomiVini[i]); entryListItem.UseItemStyleForSubItems = true; ListViewItem.ListViewSubItem annoItem = entryListItem.SubItems.Add(AnnoVini[i]); ListViewItem.ListViewSubItem tipologiaItem = entryListItem.SubItems.Add(TipologiaVini[i]); ListViewItem.ListViewSubItem vignetoItem = entryListItem.SubItems.Add(VignetoVini[i]); ListViewItem.ListViewSubItem nrBottiglieItem = entryListItem.SubItems.Add(NrBottiglieVini[i]); ListViewItem.ListViewSubItem id = entryListItem.SubItems.Add(Id[i]); } }// end form
private void buttonLogin_Click(object sender, EventArgs e) { m.username = textBoxUsername.Text; m.password = textBoxPassword.Text; bool isSuccess = d.loginCheck(m); if (isSuccess) { MessageBox.Show("Login Successful"); FormHome h = new FormHome(m.username); h.Show(); this.Hide(); } else { MessageBox.Show("Invalid Login Credentials"); } }
public FormModificaMarmellata(ListViewItem.ListViewSubItem id, FormMarmellata formmarmellata, FormHome home) { InitializeComponent(); this.id = id; this.formmarmellata = formmarmellata; this.home = home; DbMarmellata m = new DbMarmellata(); // lettura dal databese dei dati necessari e passaggio ai vari textbox che li stamperanno a video textBox1.Text = m.SelectElement(id, "frutto"); textBox2.Text = m.SelectElement(id, "anno"); textBox4.Text = m.SelectElement(id, "dimensione"); textBox7.Text = m.SelectElement(id, "nrbarattoli"); }// end form
private void button1_Click(object sender, EventArgs e) { string sql = "select * from Login_User where UserName='******' and Password='******'"; SqlDataAdapter sda = new SqlDataAdapter(sql, Connectionstring); DataTable dt1 = new DataTable(); sda.Fill(dt1); string combovalue = comboBoxLLoginUserType.Text.ToString(); if (dt1.Rows.Count > 0) { for (int i = 0; i < dt1.Rows.Count; i++) { if (dt1.Rows[i]["UserType"].ToString() == combovalue) { MessageBox.Show("YOU ARE LOGIN AS " + dt1.Rows[i][2]); if (comboBoxLLoginUserType.SelectedIndex == 0) { FormHome a1 = new FormHome(); a1.Show(); this.Hide(); } else { FormManager i1 = new FormManager(); i1.Show(); this.Hide(); } } if (dt1.Rows[i]["UserType"].ToString() != combovalue) { MessageBox.Show("SELECT CORRECT USER TYPE"); } } } else { MessageBox.Show("LOGIN FAILED"); } }
private void btnVoltar_Click(object sender, EventArgs e) { DataTable semConsumo = consumo.VerificaProdutoSemConsumo(); DataTable consumoVazio = consumo.VerificaConsumoVazio(); int intSemConsumo = (int)semConsumo.Rows[0][0]; int intConsumoVazio = (int)consumoVazio.Rows[0][0]; if (intSemConsumo != 0) { Home.mensagemDeErro("Consta no sistema que existem Produtos sem Insumos registrados para consumo.\n\nCertifique-se de que todos os Produtos tem pelo menos um Insumo associado para poder seguir para o próximo menu.", "Integridade no banco de dados"); return; } if (intConsumoVazio != 0) { Home.mensagemDeErro("Consta no sistema que existem registros de Consumo com campos vazios.\n\nCertifique-se de que todos os Produtos tem pelo menos um Insumo associado para poder seguir para o próximo menu.", "Integridade nos registros"); return; } if (Produtos.sequenciaCadastro) { Categorias categoria = new Categorias(); categoria.Show(); categoria.FormHome = this.FormHome; } else { FormHome.Enabled = true; FormHome.Show(); FormHome.Focus(); } //TODO: Corrigir volta da tela de Consumo pra Home. Ela tá se mantendo disabled. Dispose(); }
public FormModificaVino(ListViewItem.ListViewSubItem id, FormVino formvino, FormHome home) { InitializeComponent(); this.id = id; this.formvino = formvino; this.home = home; DbVino v = new DbVino(); // lettura dal databese dei dati necessari e passaggio ai vari textbox che li stamperanno a video textBox1.Text = v.SelectElement(id, "nome"); textBox2.Text = v.SelectElement(id, "anno"); textBox3.Text = v.SelectElement(id, "tipologia"); textBox4.Text = v.SelectElement(id, "vigneto"); textBox5.Text = v.SelectElement(id, "nrbottiglie"); }// end form
private void btnDangNhap_Click(object sender, EventArgs e) { if (txtTaiKhoan.Text.TrimEnd().Length != 0 && txtMatKhau.Text.TrimEnd().Length != 0) { string username = txtTaiKhoan.Text.TrimEnd(); string password = txtMatKhau.Text.TrimEnd(); bool check = database.Check(password, "Select MatKhau from TAIKHOAN where TenDangNhap = N'" + username + "'"); if (check == true) { useracc = username; FormHome m = new FormHome(); m.Show(); this.Hide(); //this.Close(); //th = new Thread(OpenFormHome); //th.SetApartmentState(ApartmentState.STA); //th.Start(); } else { MessageBox.Show("Username hoặc password không chính xác!", "", MessageBoxButtons.OK, MessageBoxIcon.Stop); txtTaiKhoan.Text = ""; txtMatKhau.Text = ""; checkBox1.Checked = false; this.ActiveControl = txtTaiKhoan; } } else { MessageBox.Show("Vui lòng nhập đầy đủ username và password!", "", MessageBoxButtons.OK, MessageBoxIcon.Stop); txtTaiKhoan.Text = ""; txtMatKhau.Text = ""; checkBox1.Checked = false; this.ActiveControl = txtTaiKhoan; } }
public Form1() { InitializeComponent(); /*init serial*/ userSerial = new UserSerial(btnConnectPort, cbxCOMPort.combobox, cbxBaudRate.combobox, cbxDataBits.combobox, cbxParity.combobox, cbxStopBits.combobox); userSerial.Terminal.LogTextBox = txtTerminal; userSerial.Console.LogTextBox = txtConsole; userSerial.OnChangeOpen += UserSerial_OnChangeOpen; userSerial.ProcessDeviceCommand += ProcessDeviceCommand; userSerial.setSignal(pannelTX, pannelRX); /*set form config*/ formConfig = new FormConfig(userSerial); formConfig.TopLevel = false; splitContainer1.Panel1.Controls.Add(formConfig); formConfig.Dock = DockStyle.Fill; formConfig.Show(); formConfig.Visible = false; /*set form Home*/ formHome = new FormHome(userSerial); formHome.TopLevel = false; splitContainer1.Panel1.Controls.Add(formHome); formHome.Dock = DockStyle.Fill; formHome.Show(); formHome.Visible = false; formHome.ButtonConnectClick += FormHome_ButtonConnectClick; formHome.ResetClick += FormHome_ResetClick; /*set form Console*/ formConsole = new FormConsole(userSerial, connectTime); formConsole.TopLevel = false; splitContainer1.Panel1.Controls.Add(formConsole); formConsole.Dock = DockStyle.Fill; formConsole.Show(); formConsole.Visible = false; panel7.SendToBack(); }
public FormAggiungiMarmellata(FormMarmellata formmarmellata, FormHome home) { InitializeComponent(); this.formmarmellata = formmarmellata; this.home = home; DbMarmellata m = new DbMarmellata(); // liste di stringhe per inserire i vari valori nei vari form List <string> Frutti = new List <string>(); Frutti = m.SelectDistinct("frutto"); List <string> DimensioniBarattoli = new List <string>(); DimensioniBarattoli = m.SelectDistinct("dimensione"); List <string> NrBarattoli = new List <string>(); NrBarattoli = m.SelectDistinct("nrbarattoli"); // ciclo che aggiunge i frutti già presenti nel db nel combobox frutta for (int i = 0; i < Frutti.Count; i++) { comboBoxFrutto.Items.Add(Frutti[i]); } // ciclo che aggiunge le dimensioni dei barattoli già presenti nel db nel combobox dimensioni for (int i = 0; i < DimensioniBarattoli.Count; i++) { comboBoxDimensioni.Items.Add(DimensioniBarattoli[i]); } // ciclo che aggiunge i numeri dei barattoli già presenti nel db nel combobox nrbarattoli for (int i = 0; i < NrBarattoli.Count; i++) { comboBoxNrBarattoli.Items.Add(NrBarattoli[i]); } }// end form aggiungi marmellata
public FormMarmellata(FormHome home) { InitializeComponent(); this.home = home; DbMarmellata m = new DbMarmellata(); // creo delle liste di stringhe e attribuisco a ciascuna le varie informazioni contenute nel database List <string> FruttoMarmellata = new List <string>(); FruttoMarmellata = m.Select("frutto"); List <string> AnnoMarmellate = new List <string>(); AnnoMarmellate = m.Select("anno"); List <string> DimensioneBarattoli = new List <string>(); DimensioneBarattoli = m.Select("dimensione"); List <string> NrBarattoli = new List <string>(); NrBarattoli = m.Select("nrbarattoli"); List <string> Id = new List <string>(); Id = m.Select("id"); // ciclo per aggiungere tutti gli item e i subitem alla listview for (int i = 0; i < Id.Count; i++) { ListViewItem entryListItem = listViewDettagli.Items.Add(FruttoMarmellata[i]); entryListItem.UseItemStyleForSubItems = true; ListViewItem.ListViewSubItem annoItem = entryListItem.SubItems.Add(AnnoMarmellate[i]); ListViewItem.ListViewSubItem tipologiaItem = entryListItem.SubItems.Add(DimensioneBarattoli[i]); ListViewItem.ListViewSubItem vignetoItem = entryListItem.SubItems.Add(NrBarattoli[i]); ListViewItem.ListViewSubItem id = entryListItem.SubItems.Add(Id[i]); } }// end form
public static void Verification(string username, string password, FormHome home) { string trueFalseValue = firstStepOfVerification(username, password); if (trueFalseValue == "1") { //--------------successfull Log In MessageBox.Show("Successfull Log In", "Message"); //-----------------close Home Form and Open Admin Form home.Hide(); FormAdminPanel fap = new FormAdminPanel(ref username); fap.ShowDialog(); } else { //--------------Failed Log In MessageBox.Show("Log In Failed", "Message"); } }
public static void employeeVerification(string username, string password, FormHome home, FormPharmasy pharmasyForm) { string trueFalseValue = firstStepOfVerification(username, password); if (trueFalseValue == "1") { //--------------successfull Log In MessageBox.Show("Successfull Log In", "Message"); //-----------------close pharmasy Form and Open Sell Form home.Hide(); pharmasyForm.Hide(); FormDrugSell ds = new FormDrugSell(username); ds.ShowDialog(); } else { //--------------Failed Log In MessageBox.Show("Log In Failed", "Message"); } }
public FormAggiungiVigneto(FormVigneto formvigneto, FormHome formhome) { InitializeComponent(); this.formvigneto = formvigneto; this.formhome = formhome; DbVigneto w = new DbVigneto(); // dichiarazione e definizione di variabili ( list<string> e array[int]) List <string> NomiVigneti = new List <string>(); NomiVigneti = w.SelectDistinct("nome"); List <string> NrVitiMorte = new List <string>(); NrVitiMorte = w.SelectDistinct("nrvitimorte"); // ciclo che aggiunge al combobox i vari nomi dei vigneti for (int i = 0; i < NomiVigneti.Count; i++) { comboBoxNome.Items.Add(NomiVigneti[i]); } }// end form