コード例 #1
0
 public override void Delete()
 {
     if (dgvErrors.SelectedRows.Count == 1)
     {
         ErrorWrapper ew = (ErrorWrapper)dgvErrors.SelectedRows[0].DataBoundItem;
         Crud.Delete(ew.Error);
         RefreshData();
     }
 }
コード例 #2
0
        private void btnClear_Click(object sender, EventArgs e)
        {
            foreach (DataGridViewRow logItem in dgvLog.Rows)
            {
                LogWrapper log = (LogWrapper)logItem.DataBoundItem;
                Crud.Delete(log.Logging);
            }

            LoadData();
        }
コード例 #3
0
        public void CrudTest2()
        {
            //act
            Crud <RestaurantDataAccessLayer.Restaurant> crud = new Crud <RestaurantDataAccessLayer.Restaurant>();

            //arrange
            bool test = crud.Delete(crud.Retrieve(4));

            //assert
            Assert.IsTrue(test);
        }
コード例 #4
0
ファイル: Keywords.cs プロジェクト: OmerCD/TCGUtilities
 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();
     }
 }
コード例 #5
0
        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();
        }
コード例 #6
0
        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();
        }
コード例 #7
0
        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);
            }
        }
コード例 #8
0
        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);
            //---------//
        }
コード例 #9
0
        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)
            {
            }
        }
コード例 #10
0
        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");
                }
            }
        }
コード例 #11
0
        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.");
        }
コード例 #12
0
        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.");
        }
コード例 #13
0
 // DELETE api/clanak/5
 public void Delete(int id)
 {
     Crud <Rad> .Delete(sesija, id);
 }
コード例 #14
0
 // DELETE api/clanak/5
 public void Delete(int id)
 {
     Crud <PrakticniProjekat> .Delete(sesija, id);
 }
コード例 #15
0
 // DELETE api/clanak/5
 public void Delete(int id)
 {
     Crud <Literatura> .Delete(sesija, id);
 }
コード例 #16
0
 // DELETE api/clanak/5
 public void Delete(int id)
 {
     Crud <Knjiga> .Delete(sesija, id);
 }
コード例 #17
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     Crud.Delete((Models.Logistics.PlanningLocation)lbxLocations.SelectedItem);
     RefreshData();
     txtLocation.Focus();
 }
コード例 #18
0
 // DELETE api/clanak/5
 public void Delete(int id)
 {
     Crud <TeorijskiProjekat> .Delete(sesija, id);
 }
コード例 #19
0
 // DELETE api/clanak/5
 public void Delete(int id)
 {
     Crud <WebStranice> .Delete(sesija, id);
 }
コード例 #20
0
 // DELETE api/clanak/5
 public void Delete(int id)
 {
     Crud <Izvestaj> .Delete(sesija, id);
 }
コード例 #21
0
 // DELETE api/clanak/5
 public void Delete(int id)
 {
     Crud <Student> .Delete(sesija, id);
 }
コード例 #22
0
 // DELETE api/clanak/5
 public void Delete(int id)
 {
     Crud <Predmet> .Delete(sesija, id);
 }
コード例 #23
0
 // DELETE api/clanak/5
 public void Delete(int id)
 {
     Crud <Clanak> .Delete(sesija, id);
 }