private void btnOk_Click(object sender, EventArgs e) { //add new dgv = new Bunifu.Framework.UI.BunifuCustomDataGrid(); CRUDfunkcije crud = new CRUDfunkcije(); crud.UserMail(UserMail, UserID); crud.Insert(myProperty); PopulateGrid(); //PopulateGrid(myProperty); }
private void detaljiVozila_Click(object sender, EventArgs e) { PropertyInterface pom = myProperty; string ID = dgv.SelectedRows[0].Cells[0].Value.ToString(); PopulateGrid(myForm); myProperty = pom; //Visible = false; CRUDfunkcije crud = new CRUDfunkcije("detalji"); crud.UserMail(UserMail, UserID); crud.Update(myForm, ID, dgv); // Visible = true; PopulateGrid(myProperty); }
private void btnUpdate_Click(object sender, EventArgs e) { PropertyInterface pom = myProperty; string ID = dgv.SelectedRows[0].Cells[0].Value.ToString(); PopulateGrid(); myProperty = pom; Visible = false; CRUDfunkcije crud = new CRUDfunkcije(); crud.UserMail(UserMail, UserID); crud.Update(myProperty, ID, dgv); Visible = true; try { PopulateGrid(); } catch { } }
private void btnDelete_Click(object sender, EventArgs e) { DialogResult myResult = MetroMessageBox.Show(this, "Do you really want to delete this item?", "Delete Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Error); if (myResult == DialogResult.Yes) { int SelektovaniRed = dgv.SelectedRows[0].Index; CRUDfunkcije crud = new CRUDfunkcije(); crud.UserMail(UserMail, UserID); crud.Delete(myProperty, SelektovaniRed, dgv); try { PopulateGrid(); } catch { DialogResult dr = MetroMessageBox.Show(this, "\n\nNemoguce je obrisati ovaj red zbog povezanosti sa drugim tabelama!!!\n\n", "Greska pri brisanju!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { //No delete } }