Ejemplo n.º 1
0
        void DeleteObj()
        {
            try
            {
                if (grdBrowsers.SelectedRows.Count > 0)
                {
                    DialogResult dr = MessageUtil.Confirm("External Browser will be deleted. are you sure?");
                    if (dr == System.Windows.Forms.DialogResult.Yes)
                    {
                        int     browserId = grdBrowsers.SelectedRows[0].Cells["Id"].Value.ToInt();
                        Browser br        = new Browser {
                            Id = browserId
                        };
                        br.Delete();
                        UpdateForm();
                    }
                    return;
                }
                return;
            }
            catch (Exception ex)
            {
                FreeLogger.LogMethod(ex, this.Name, "DeleteObj");

                MessageUtil.Error("Object could not be deleted.");
            }
        }
Ejemplo n.º 2
0
        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult dR = MessageUtil.Confirm("Program will be closed. Are you sure?");

            if (dR == System.Windows.Forms.DialogResult.Yes)
            {
                _isFromClosing = true;
                this.Close();
            }
            return;
        }
Ejemplo n.º 3
0
 private void FrmBookmarkList_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (_isFromClosing == false)
     {
         DialogResult dR = MessageUtil.Confirm("Program will be closed. Are you sure?");
         if (dR != System.Windows.Forms.DialogResult.Yes)
         {
             e.Cancel = true;
             return;
         }
     }
 }
Ejemplo n.º 4
0
        private void FrmBookmark_FormClosing(object sender, FormClosingEventArgs e)
        {
            int changeCount = _bookmarkId == -1 ? 0 : 1;

            if (bookmark.ChangeSetCount > changeCount && isUpdated == false)
            {
                DialogResult dr = MessageUtil.Confirm("Form will be Closed, Are you sure?");
                if (dr != System.Windows.Forms.DialogResult.Yes)
                {
                    e.Cancel = true;
                }
            }
        }
Ejemplo n.º 5
0
        private void Delete()
        {
            try
            {
                if (grdVwBookmarks.SelectedRows.Count > 0)
                {
                    if (MessageUtil.Confirm("Bookmark will be deleted. Are you sure?") == System.Windows.Forms.DialogResult.Yes)
                    {
                        int      bkmrkId = grdVwBookmarks.SelectedRows[0].Cells["ID"].Value.ToInt();
                        Bookmark bkmrk   = null;
                        for (int bookmarkCounter = 0; bookmarkCounter < bookmarkList.Count; bookmarkCounter++)
                        {
                            if (bkmrkId == bookmarkList[bookmarkCounter].ID)
                            {
                                bkmrk = bookmarkList[bookmarkCounter];
                                break;
                            }
                        }

                        if (bkmrk != null)
                        {
                            bkmrk.Delete();
                            bookmarkList.Remove(bkmrk);
                            SetDataSourceOfGRid();
                            MessageUtil.Message("Bookmark deleted successfully.");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LightLogger.LogMethod(ex, this.Name, "Delete");

                MessageUtil.Error("Object could not be deleted.");
            }
        }