private void CustomerButton_Click(object sender, EventArgs e) { var form = new CustomerForm { MdiParent = this, StartPosition = FormStartPosition.CenterScreen }; form.Show(); }
private void button2_Click(object sender, EventArgs e) { CustomerForm form = CustomerForm.Instance; form.TopLevel = false; this.contentPanel.Controls.Clear(); this.contentPanel.Controls.Add(form); form.Dock = DockStyle.Fill; form.Show(); }
private void btnCustomer_Click(object sender, EventArgs e) { HideOtherForm("FrmCustomer"); if (IsAlreadyOpened("FrmCustomer")) { return; } CustomerForm.MdiParent = this; CustomerForm.Show(); CustomerForm.Location = new Point(200, 20); }
private void customerDataGridView_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { DataGridViewRow dr = customerDataGridView.SelectedRows[0]; this.Hide(); CustomerForm aCustomerForm = new CustomerForm(); aCustomerForm.customerNameTextBox.Text = dr.Cells["Name"].Value.ToString(); aCustomerForm.customerPhoneTextBox.Text = dr.Cells["Phone"].Value.ToString(); aCustomerForm.cutomerIdLabel.Text = dr.Cells["CustomerID"].Value.ToString(); aCustomerForm.Show(); }
private void button1_Click(object sender, EventArgs e) { String username = txtusername.Text; String password = txtpassword.Text; if (username == "c" && password == "c") { CustomerForm form = new CustomerForm(); form.Show(); } else if (username == "g" && password == "g") { GymManagementForm gymForm = new GymManagementForm(); gymForm.Show(); } else if (username == "i" && password == "i") { StockManagement gymForm = new StockManagement(); gymForm.Show(); } else if (username == "k" && password == "k") { KMS gymForm = new KMS(); gymForm.Show(); } else if (username == "h" && password == "h") { HRS_MAIN hallMain = new HRS_MAIN(); hallMain.Show(); } else if (username == "e" && password == "e") { EmployeeMangementSystem ems = new EmployeeMangementSystem(); ems.Show(); } else if (username == "s" && password == "s") { spaForm spa = new spaForm(); spa.Show(); } else if (username == "f" && password == "f") { FinanceForm finance = new FinanceForm(); finance.Show(); } else if (username == "cat" && password == "cat") { ThemeMenu themenu = new ThemeMenu(); themenu.Show(); } }
private void catálogoDeClientesToolStripMenuItem_Click(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; CustomerForm frmCustomer = new CustomerForm(); frmCustomer.Show(); } finally { this.Cursor = Cursors.Default; } }
private void btnSave_Click(object sender, EventArgs e) { if (validateField()) { if (isEdit == false) { var result = MessageBox.Show("¿Desea registrar al cliente?", "Confirmación", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { customer.DNI = txtDni.Text; customer.Name = txtNombre.Text; customer.LastName = txtApellido.Text; customer.Address = txtDireccion.Text; customer.Phone = txtTelefono.Text; WorkCustomer.addCustomer(customer); MessageBox.Show("DNI: " + customer.DNI + " Apellido: " + customer.LastName + " Nombre: " + customer.Name + " Direccion: " + customer.Address + " Telefono: " + customer.Phone, "Datos del Cliente Cargados", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } } //update if (isEdit == true) { var result = MessageBox.Show("¿Desea guardar los cambios?", "Confirmación", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { customer.Id = Convert.ToInt32(idCustomer); customer.DNI = txtDni.Text; customer.Name = txtNombre.Text; customer.LastName = txtApellido.Text; customer.Address = txtDireccion.Text; customer.Phone = txtTelefono.Text; WorkCustomer.updateCustomer(customer); MessageBox.Show("Se actualizo correctamente", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information); isEdit = false; } } customerForm.loadCostumers(); customerForm.Show(); cleanFields(); this.Hide(); } else { MessageBox.Show("Campos en Blancos", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void saleItemToolStripMenuItem_Click(object sender, EventArgs e) { bool isOpen = false; foreach (Form f in Application.OpenForms) { if (f is CustomerForm) { isOpen = true; break; } } if (!isOpen) { CustomerForm ApplicationPreferences = new CustomerForm(); ApplicationPreferences.Show(); } else { MessageBox.Show("Customer Update Form is already open"); } }
private void customrFormButton_Click(object sender, EventArgs e) { CustomerForm aCustomerForm = new CustomerForm(); aCustomerForm.Show(); }
private void loginButton_MouseClick(object sender, MouseEventArgs e) { try { using (DataBaseIM db = new DataBaseIM()) { UsersLogin user = db.UsersLogins.FirstOrDefault(u => (u.Login == loginName.Text || u.Mail == loginName.Text) && u.Password == loginPassword.Text); if (user != null) { CustomerInformation cInfo = db.CustomersInformations.FirstOrDefault(cI => cI.UserLoginId == user.Id); if (cInfo != null) { if (checkBoxUserSave.Checked) { try { SaveSettings(); } catch (Exception exd) { MessageBox.Show("Error Server: " + exd); } } this.Hide(); CustomerForm cF = new CustomerForm(cInfo); cF.Show(); } else { MenedjerInformation mInfo = db.MenedjersInformations.FirstOrDefault(mI => mI.UserLoginId == user.Id); if (mInfo != null) { if (checkBoxUserSave.Checked) { try { SaveSettings(); } catch (Exception exd) { MessageBox.Show("Error Server: " + exd); } } this.Hide(); AdminForm aF = new AdminForm(); aF.Show(); } else { MessageBox.Show("NOT found"); } } } else { MessageBox.Show("No such user found"); } } } catch (Exception ex) { MessageBox.Show("Error Server: " + ex); } }