public override void Delete() { if (dgvErrors.SelectedRows.Count == 1) { ErrorWrapper ew = (ErrorWrapper)dgvErrors.SelectedRows[0].DataBoundItem; Crud.Delete(ew.Error); RefreshData(); } }
private void btnClear_Click(object sender, EventArgs e) { foreach (DataGridViewRow logItem in dgvLog.Rows) { LogWrapper log = (LogWrapper)logItem.DataBoundItem; Crud.Delete(log.Logging); } LoadData(); }
public void CrudTest2() { //act Crud <RestaurantDataAccessLayer.Restaurant> crud = new Crud <RestaurantDataAccessLayer.Restaurant>(); //arrange bool test = crud.Delete(crud.Retrieve(4)); //assert Assert.IsTrue(test); }
private void Delete_Click(object sender, EventArgs e) { if (lBKeywords.SelectedIndex != -1) { var keyword = (Keyword)lBKeywords.SelectedItem; _crudKeyword.Delete(keyword._id); lBKeywords.SelectedIndex = -1; FillListBox(); ClearKeywordInfoTextboxes(); } }
public override void Delete() { IList <Models.Core.MenuItem> mpgms = Crud.GetList <Models.Core.MenuItem, Models.Core.Menu>("menu", selectedMenu); foreach (Models.Core.MenuItem mpgm in mpgms) { Crud.Delete(mpgm); } Crud.Delete(selectedMenu); RefreshAll(); }
public override void Delete() { IList <Models.Core.UserGroupMenu> mugms = Crud.GetList <Models.Core.UserGroupMenu, Models.Core.UserGroup>("UserGroup", selectedUserGroup); foreach (Models.Core.UserGroupMenu mugm in mugms) { Crud.Delete(mugm); } Crud.Delete(selectedUserGroup); RefreshAll(); }
private void btnDeleteEvent_Click(object sender, EventArgs e) { string result; try { int rowIndex = dgvEventsLog.SelectedRows[0].Index; if (rowIndex == Constants.NONE) { return; } Guid id = (Guid)(dgvEventsLog.Rows[rowIndex].Cells[10].Value); if (id != Guid.Empty) { DialogResult dialogResult = MessageBox.Show("?לבטל", "ביטול אירוע", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialogResult != DialogResult.Yes) { return; } if (crud == null) { Audit("אין גישה לנתונים :שגיאת ביטול אירוע", AuditSeverity.Critical); return; } if (!crud.Delete(id, out result)) { Audit($"שגיאת ביטול אירוע: {result}", AuditSeverity.Critical); return; } if (!RefreshCriminalEventsGrid(out result)) { Audit($"שגיאת טעינת אירועים: {result}", AuditSeverity.Critical); return; } } } catch (Exception ex) { Audit($"שגיאת ביטול אירוע: {ex.Message}", AuditSeverity.Critical); } }
static void Main(string[] args) { Console.WriteLine("Hello World!"); //To make this thing work you first need to make an instance of the Crud class and fill in the asked parameters. Crud Connection = new Crud("your server.com", "your database", "your username", "your password"); //Then you can what you want, with data you can do 4 things, create, read, update and delete, in short terms (CRUD) //-Create: C-// Contact AContact = new Contact(); AContact.Name = "Steven"; AContact.Email = "*****@*****.**"; Connection.Create(AContact); //---------// //-Read: R-// List <Tag> ListOfAllTags = Connection.SelectAll <Tag>(); Tag ATag = new Tag(); ATag.Name = "you search value"; List <Tag> ListOfSpecificTags = Connection.SelectWhere(ATag); //---------// //-Update: U-// //The id needs to be set in the update object otherwise the update cant work because the id will be 0. Tag UpdateTag = new Tag(); UpdateTag.Id = 6; UpdateTag.Name = "Dependency Injection"; Connection.Update <Tag>(UpdateTag); //---------// //-Delete: D-// Tag DeleteTag = new Tag(); DeleteTag.Id = 4; DeleteTag.Name = "Sander Moerman"; Connection.Delete(ATag); //---------// }
private void button3_Click(object sender, EventArgs e) { ISession s = DataLayer.GetSession(); try { Crud <Tim> .Delete(s, int.Parse(textBox5.Text)); neaktivno(); textBox10.Text = ""; textBox9.Text = ""; textBox5.Text = ""; } catch (Exception ex) { } }
private void BtnDeleteCard_Click(object sender, EventArgs e) { var selectedIndex = LbCardList.SelectedIndex; if (selectedIndex > -1) { var card = (Card)LbCardList.SelectedItem; var isDeleted = _cardCrud.Delete(card._id); if (isDeleted == true) { MessageBox.Show($"Card: {card} is delete"); FillListBox(); } else { MessageBox.Show("Chichi ile konuşuyor olur öyle"); } } }
public override void Save() { selectedMenu.Icon = iconName; Crud.Put(selectedMenu); IList <Models.Core.MenuItem> mpgms = Crud.GetList <Models.Core.MenuItem, Models.Core.Menu>("Menu", selectedMenu); foreach (Models.Core.MenuItem mpgm in mpgms) { Crud.Delete(mpgm); } int seq = 0; foreach (Models.Core.Program pgm in programs.Items) { Models.Core.MenuItem mpgm = new Models.Core.MenuItem(); mpgm.Sequence = seq++; mpgm.Menu = selectedMenu; mpgm.Program = pgm; Crud.Put(mpgm); } RefreshAll(); Common.Interaction.ThrowMessage(this, "Menu saved succesfully."); }
public override void Save() { Crud.Put(selectedUserGroup); IList <Models.Core.UserGroupMenu> mugms = Crud.GetList <Models.Core.UserGroupMenu, Models.Core.UserGroup>("UserGroup", selectedUserGroup); foreach (Models.Core.UserGroupMenu mugm in mugms) { Crud.Delete(mugm); } int seq = 0; foreach (Models.Core.Menu men in menus.Items) { Models.Core.UserGroupMenu mugm = new Models.Core.UserGroupMenu(); mugm.Sequence = seq++; mugm.UserGroup = selectedUserGroup; mugm.Menu = men; Crud.Put(mugm); } RefreshAll(); Common.Interaction.ThrowMessage(this, "Usergroup saved succesfully."); }
// DELETE api/clanak/5 public void Delete(int id) { Crud <Rad> .Delete(sesija, id); }
// DELETE api/clanak/5 public void Delete(int id) { Crud <PrakticniProjekat> .Delete(sesija, id); }
// DELETE api/clanak/5 public void Delete(int id) { Crud <Literatura> .Delete(sesija, id); }
// DELETE api/clanak/5 public void Delete(int id) { Crud <Knjiga> .Delete(sesija, id); }
private void btnDelete_Click(object sender, EventArgs e) { Crud.Delete((Models.Logistics.PlanningLocation)lbxLocations.SelectedItem); RefreshData(); txtLocation.Focus(); }
// DELETE api/clanak/5 public void Delete(int id) { Crud <TeorijskiProjekat> .Delete(sesija, id); }
// DELETE api/clanak/5 public void Delete(int id) { Crud <WebStranice> .Delete(sesija, id); }
// DELETE api/clanak/5 public void Delete(int id) { Crud <Izvestaj> .Delete(sesija, id); }
// DELETE api/clanak/5 public void Delete(int id) { Crud <Student> .Delete(sesija, id); }
// DELETE api/clanak/5 public void Delete(int id) { Crud <Predmet> .Delete(sesija, id); }
// DELETE api/clanak/5 public void Delete(int id) { Crud <Clanak> .Delete(sesija, id); }