//DUGME ZA LOGOVANJE, VALIDACIJA private void btnLogin_Click(object sender, EventArgs e) { if (Admin.AdminLoged) { SavePrices.SaveData(SavePrices.selectedPrinter); } if (tbName.Text != "" && tbName.Text == Admin.AdminName) { if (tbPass.Text != "" && tbPass.Text == Admin.AdminPass) { LoginPanel.Visible = false; label9.Text = "Loged as " + Admin.AdminName; label9.Visible = true; Admin.AdminLoged = true; btnEdit.Text = "Save"; nudBA3.Enabled = true; nudBA4.Enabled = true; nudCA3.Enabled = true; nudCA4.Enabled = true; } else { ValidationMessages.Text = "Not valid password!"; } } else { ValidationMessages.Text = "Not valid name!"; } }
private void dgvPrinterStatus_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (!File.Exists(AppDomain.CurrentDomain.BaseDirectory + "prices.xml")) { SavePrices.CreateXML(); } int rowindex = dgvPrinterStatus.CurrentCell.RowIndex; string selectedPrinter = dgvPrinterStatus.Rows[rowindex].Cells["Printer"].Value.ToString(); SavePrices.selectedPrinter = selectedPrinter; if (!SavePrices.FindPrinter(selectedPrinter)) { SavePrices.AppendPrinter(selectedPrinter); } else { SavePrices.LoadData(selectedPrinter); } ChangePrices changePricesForm = new ChangePrices(); changePricesForm.Show(); }