private void KORSN_btnDeleteUser_Click(object sender, EventArgs e) { if (KORSN_dgvUsers.SelectedRows.Count == 0) { MUtility.ShowWarrning("Odaberite korisnika"); return; } User u = KORSN_dgvUsers.SelectedRows[0].DataBoundItem as User; DialogResult dr = MessageBox.Show( string.Format("Da li ste sigurni da zelite da obrisete korisnika {0}?", u.FullName), "Brisanje korisnika", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr != DialogResult.OK) { return; } bool ops = MainController.DeleteUser(u); if (ops) { KORSN_RefreshUsersGrid(true); MUtility.ShowInformation("Korisnik uspesno obrisan"); } }
private void KORSN_btnProfile_Click(object sender, EventArgs e) { if (KORSN_dgvUsers.SelectedRows.Count == 0) { MUtility.ShowInformation("Odaberite korisnika"); return; } User sel = (User)KORSN_dgvUsers.SelectedRows[0].DataBoundItem; ProfileForm pf = new ProfileForm(sel); pf.ShowDialog(); }
private void btnSave_Click(object sender, EventArgs e) { if (newMensa != null) { if (!ValidateInput()) { MUtility.ShowInformation("Nevalidni podaci. Proverite sva polja!"); return; } newMensa.Name = txtName.Text; newMensa.Location = txtLocation.Text; newMensa.WorkTime = txtWorkTime.Text; newMensa.CurrentlyClosed = cbxNotWorking.Checked; newMensa.GPSLat = double.Parse(txtGPS_Lat.Text); newMensa.GPSLong = double.Parse(txtGPS_Lon.Text); MainController.AddMensa(newMensa); RefreshList(); RefreshData(); newMensa = null; return; } if (selectedMensa == null) { MUtility.ShowInformation("Odaberi menzu za izmenu"); return; } if (!ValidateInput()) { MUtility.ShowInformation("Nevalidni podaci. Proverite sva polja!"); return; } selectedMensa.Name = txtName.Text; selectedMensa.CurrentlyClosed = cbxNotWorking.Checked; selectedMensa.Location = txtLocation.Text; selectedMensa.GPSLong = double.Parse(txtGPS_Lon.Text); selectedMensa.GPSLat = double.Parse(txtGPS_Lat.Text); selectedMensa.WorkTime = txtWorkTime.Text; MainController.UpdateMensa(selectedMensa); RefreshList(); RefreshData(); }
private void btnDelete_Click(object sender, EventArgs e) { if (selectedMensa == null) { MUtility.ShowInformation("Odaberi fakultet za brisanje"); return; } DialogResult dg = MessageBox.Show("Da li ste sigurni da zelite da obrisete " + selectedMensa.Name + "?", "Brisanje fakulteta", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dg == DialogResult.No) { return; } MainController.DeleteMensa(selectedMensa); RefreshList(); RefreshData(); }
private void KORSN_btnChangeUser_Click(object sender, EventArgs e) { if (KORSN_dgvUsers.SelectedRows.Count == 0) { MUtility.ShowWarrning("Odaberite korisnika"); return; } User u = KORSN_dgvUsers.SelectedRows[0].DataBoundItem as User; UserForm uf = new UserForm(u); if (uf.ShowDialog() == DialogResult.OK) { bool ops = MainController.UpdateUser(u); if (ops) { MUtility.ShowInformation("Korisnik uspesno azuriran"); } KORSN_RefreshUsersGrid(true); } }
private void btnSave_Click(object sender, EventArgs e) { //dodavanje fakuleta if (newFac != null) { if (txtName.Text == String.Empty) { MUtility.ShowInformation("Naziv ne sme biti prazan"); return; } newFac.Name = txtName.Text; MainController.AddFaculty(newFac); RefreshList(); RefreshData(); newFac = null; return; } if (selectedFaculty == null) { MUtility.ShowInformation("Odaberi fakultet za izmenu"); return; } if (txtName.Text == string.Empty) { MUtility.ShowInformation("Naziv ne sme biti prazan"); return; } selectedFaculty.Name = txtName.Text; MainController.UpdateFaculty(selectedFaculty); RefreshList(); RefreshData(); }