コード例 #1
0
 private void grdLogGeneral_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
 {
     //if (this.permissionDelete)
     //{
     //    if (MessageBox.Show(AppMessage.MSG0015, AppMessage.MSG0000, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel)
     //    {
     //        e.Cancel = true;
     //    }
     //    else
     //    {
     //        DotNetService.Instance.LogService.Delete(UserInfo, this.EntityId);
     //    }
     //}
 }
コード例 #2
0
ファイル: SiparisForm.cs プロジェクト: canhalfe/CafeBoost
        private void dgvSiparisDetaylar_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            DialogResult dr =
                MessageBox.Show("Seçili detayları silmek istediğinize emin misiniz?",
                                "Silme Onayı",
                                MessageBoxButtons.YesNo,
                                MessageBoxIcon.Warning,
                                MessageBoxDefaultButton.Button2);

            if (dr != DialogResult.Yes)
            {
                e.Cancel = true;
            }
        }
コード例 #3
0
        private void allBusinessApplicationsDataGrid_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            DialogResult usersChoice = MessageBox.Show("Are you sure you want to delete this locational clearance?", "Deleting Record", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

            if (usersChoice == DialogResult.Cancel)
            {
                e.Cancel = true;
                return;
            }
            DataGridViewRow row = allBusinessApplicationsDataGrid.CurrentRow;
            string          businessApplicationID = row.Cells["ID"].Value.ToString();

            editDeleteInCSVByID(businessApplicationID, "DELETE", "");
        }
コード例 #4
0
ファイル: frmBanLe.cs プロジェクト: trinhhoangthong1/BTPM1
 private void dgvDanhsachSP_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
 {
     if (MessageBox.Show("Bạn có chắc chắn xóa không?", "Phieu Ban Le", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
     {
         e.Cancel = true;
     }
     else
     {
         BindingSource bs  = ((BindingSource)dgvDanhsachSP.DataSource);
         DataRowView   row = (DataRowView)bs.Current;
         numTongTien.Value -= Convert.ToInt64(row["THANH_TIEN"]);
         deleted.Add(new MaSanPham(Convert.ToString(row["ID_MA_SAN_PHAM"]), Convert.ToInt32(row["SO_LUONG"])));
     }
 }
コード例 #5
0
 private void dgvQuyenLoi_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
 {
     //int TT = ut.getInt(e.Row.Cells["QuyenLoi_TT"].Value);
     //LoaiThe_QuyenLoi tmp = g1LoaiThe.LstQuyenLoi.Find(
     //    delegate(LoaiThe_QuyenLoi ct)
     //    {
     //        return ct.TT == TT;
     //    });
     //if (tmp == null) return;
     //if (tmp.ThayDoi == 1)
     //    tmp.ThayDoi = 0;//Khong them, khong xoa
     //else
     //    tmp.ThayDoi = 3;//Xoa
 }
コード例 #6
0
    //</snippet50>

    //<snippet20>
    private void DataGridView1_UserDeletingRow(object sender,
                                               DataGridViewRowCancelEventArgs e)
    {
        DataGridViewRow startingBalanceRow = DataGridView1.Rows[0];

        // Check if the Starting Balance row is included in the selected rows
        if (DataGridView1.SelectedRows.Contains(startingBalanceRow))
        {
            // Do not allow the user to delete the Starting Balance row.
            MessageBox.Show("Cannot delete Starting Balance row!");

            // Cancel the deletion if the Starting Balance row is included.
            e.Cancel = true;
        }
    }
コード例 #7
0
 private void WatchListGrid_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
 {
     try
     {
         string test  = e.Row.Cells[0].Value.ToString();
         Stock  stock = this.stocks.First(s => s.Ticker == test);
         lock (this.stocks)
         {
             this.stocks.Remove(stock);
         }
     }
     catch
     {
     }
 }
コード例 #8
0
        private void langsCountDGV_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            var tag = e.Row.Tag as Число_носителей_языков;

            if (tag == null)
            {
                return;
            }
            using (var context = new LinguisticModel())
            {
                context.Число_носителей_языков.Attach(tag);
                context.Число_носителей_языков.Remove(tag);
                context.SaveChanges();
            }
        }
コード例 #9
0
        private void OnUserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            Variable variable = (Variable)e.Row.DataBoundItem;

            if (variable.IsOutput)
            {
                MessageBox.Show("Deleting a variable is impossible it participates in calculation of other variables.",
                                Program.MainForm.Name, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                e.Cancel = true;
            }
            else
            {
                _variables.Remove(variable.Name);
            }
        }
コード例 #10
0
 private void watchList_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
 {
     if (e.Row is AdvancedDataGridView.TreeGridNode && !(e.Row as AdvancedDataGridView.TreeGridNode).UserRow)
     {
         e.Cancel = true;
     }
     else
     {
         e.Cancel = false;
         if (e.Row is AdvancedDataGridView.TreeGridNode && (e.Row as AdvancedDataGridView.TreeGridNode).IsExpanded)
         {
             ClearRow(e.Row.Index);
         }
     }
 }
コード例 #11
0
        private void dataGridViewX1_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            if (MessageBox.Show("Bạn có chắc chắn xóa không?", "Phieu Nhan", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            {
                e.Cancel = true;
            }
            else
            {
                DataRowView                       view = (DataRowView)bindingNavigator1.BindingSource.Current;
                ChiTietPhieuNhanControl           ctrl = new ChiTietPhieuNhanControl();
                IList <ChiTietPhieuNhanPhongInFo> ds   = ctrl.ChiTietPhieuNhan(view["MaNhanPhong"].ToString());

                ctrl.Save();
            }
        }
コード例 #12
0
        private void RefereeData_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            var name = RefereeData.SelectedRows[0].Cells[0].Value.ToString();

            foreach (var i in ApplicationData.Refs)
            {
                if (i.name == name)
                {
                    ApplicationData.Refs.Remove(i);
                    break;
                }
            }

            ApplicationData.SaveData();
        }
        private void patientDataGridView_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            int    patientId   = Convert.ToInt32(patientDataGridView.Rows[e.Row.Index].Cells[0].Value.ToString());
            string name        = patientDataGridView.Rows[e.Row.Index].Cells[1].Value.ToString();
            string gender      = patientDataGridView.Rows[e.Row.Index].Cells[2].Value.ToString();
            string age         = patientDataGridView.Rows[e.Row.Index].Cells[3].Value.ToString();
            string address     = patientDataGridView.Rows[e.Row.Index].Cells[4].Value.ToString();
            string phone       = patientDataGridView.Rows[e.Row.Index].Cells[5].Value.ToString();
            string roomNo      = patientDataGridView.Rows[e.Row.Index].Cells[6].Value.ToString();
            int    doctorId    = Convert.ToInt32(patientDataGridView.Rows[e.Row.Index].Cells[7].Value.ToString());
            int    testId      = Convert.ToInt32(patientDataGridView.Rows[e.Row.Index].Cells[8].Value.ToString());
            string checkinDate = patientDataGridView.Rows[e.Row.Index].Cells[9].Value.ToString();

            p = new patientDTO(patientId, name, gender, age, address, phone, roomNo, doctorId, testId, checkinDate);
        }
コード例 #14
0
        private void dgvDemons_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            var deletedDemon = GetDemonFromDataGridViewRow(e.Row, false);

            if (deletedDemon != null)
            {
                using (var transaction = _dbSession.BeginTransaction())
                {
                    _logger.Info("Deleting demon: " + deletedDemon.ToString());
                    _dbSession.Delete(deletedDemon);
                    _logger.Info("Deleted.");
                    transaction.Commit();
                }
            }
        }
コード例 #15
0
ファイル: FindForm.cs プロジェクト: ohio813/StreamsFinder
        /// <summary>
        /// If the user deletes one or more rows, delete the streams on the file system.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dataGridResult_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            DataRowView drv = e.Row.DataBoundItem as DataRowView;

            FileInfoData.FileInfoRow fir = drv.Row as FileInfoData.FileInfoRow;
            NTFS.FileStreams         FS  = new NTFS.FileStreams(fir.File_Name);

            foreach (NTFS.StreamInfo s in FS)
            {
                if (s.Name == fir.Stream_Name)
                {
                    s.Delete();
                }
            }
        }
コード例 #16
0
        private void breakpointGridView_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            string   value    = e.Row.Cells[1].Value.ToString();
            int      splitter = value.IndexOf(':', 4);
            FilePath file     = new FilePath(value.Substring(0, splitter));
            IProject project  = _projectService.Project;

            if (!project.IsInternal)
            {
                file = new FilePath(Path.Combine(project.ProjectDirectory, file));
            }
            int lineNum = Convert.ToInt32(value.Substring(splitter + 1, value.Length - splitter - 1));

            WabbitcodeBreakpointManager.RemoveBreakpoint(file, lineNum);
        }
コード例 #17
0
        private void dataGridView1_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            int BillItemNarrationId;

            if (e.Row.Cells["BillItem_Narration_Id"].Value != null)
            {
                if (int.TryParse(e.Row.Cells["BillItem_Narration_Id"].Value.ToString(), out BillItemNarrationId))
                {
                    BillItemNarrationEL _BillItemNarrationEL = new BillItemNarrationEL();
                    _BillItemNarrationEL.BillItem_Narration_Id = BillItemNarrationId;
                    DeletedItemNarration.Add(_BillItemNarrationEL);
                }
            }
            e.Row.Visible = false;
        }
コード例 #18
0
        /// <summary>
        /// 删除某一行 通过id
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgv_bill_insert_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            Goods  goods = new Goods();
            string errorMessage;

            goods.id = Convert.ToInt32(e.Row.Cells["id"].Value.ToString());
            if (billBuzz.deleteBill(goods, out errorMessage))
            {
                MessageBox.Show("删除成功");
            }
            else
            {
                MessageBox.Show(errorMessage);
            }
        }
コード例 #19
0
 private void GridView1_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
 {
     if (e.Row.Cells["ID"].Value != DBNull.Value)
     {
         if (MessageBox.Show("Kaydı silmek istediğinize eminmisiniz ?", "Soru", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             AKBclass.DBMudahale.SQLIsle("DELETE FROM Kalemler_Tbl WHERE ID = " + e.Row.Cells["ID"].Value.ToString());
             Hesapla();
         }
         else
         {
             e.Cancel = true;
         }
     }
 }
コード例 #20
0
        private void myGrid_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            String name = myGrid.Rows[myGrid.CurrentRow.Index].Cells[0].Value.ToString();
            int    pos  = -1;

            for (int i = 0; i < Program.ods.Tables[1].Rows.Count; i++)
            {
                if (Program.ods.Tables[1].Rows[i][0].ToString() == name)
                {
                    pos = i;
                }
            }
            Program.ods.Tables[1].Rows.RemoveAt(pos);
            MessageBox.Show(Program.ods.Tables[1].Rows.Count.ToString());
        }
コード例 #21
0
ファイル: Pixels.cs プロジェクト: BogdanPinchuk/Difdisofil
        /// <summary>
        /// Відбувається при видаленні рядків на вкладці Піксель
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DataGridViewPixel_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            // видаляємо із словника маркери які були виділені в таблиці
            for (int i = 0; i < dataGridViewPixel.SelectedRows.Count; i++)
            {
                markerPix.MarkerDict.Remove(int.Parse(dataGridViewPixel.
                                                      SelectedRows[i].HeaderCell.Value.ToString()));
            }

            // сортування (перезаписуємо словник для нормального добавляння елементів в кінець)
            markerPix.MarkerDict = markerPix.MarkerDict.ToDictionary(x => x.Key, y => y.Value);

            // оновлюємо зображення
            PictureBoxPixel.Refresh();
        }
コード例 #22
0
 private void grid_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
 {
     if (!checkDeleteWithoutAsking.Checked)
     {
         if (MessageBox.Show("Bạn có chắc muốn xóa dòng dữ liệu này?", "",
                             MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
         {
             e.Cancel = true;
         }
         else
         {
             e.Cancel = false;
         }
     }
 }
コード例 #23
0
        private void blockData_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            var blockTeamName = blockData.SelectedRows[0].Cells[0].Value.ToString();

            foreach (var i in SelectedReferee.blocks)
            {
                if (i.teamName == blockTeamName)
                {
                    SelectedReferee.blocks.Remove(i);
                    break;
                }
            }

            ApplicationData.SaveData();
        }
コード例 #24
0
 private void tarifDataGridView_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
 {
     if (checkBox1.Checked == true)
     {
         DialogResult dr = MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
         if (dr == DialogResult.Cancel)
         {
             e.Cancel = true;
         }
     }
     else
     {
         e.Cancel = true;
     }
 }
コード例 #25
0
        private void projectsDataGridView_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            DataRowView rowView = e.Row.DataBoundItem as DataRowView;

            DialogResult resp = MessageBox.Show(
                "Deleting a project deletes all associated time entries.  " +
                "You may want to set it as inactive instead.\nPermanently delete this project?",
                "Delete project (" + rowView.Row["ProjectName"] + ") and all its time entries?",
                MessageBoxButtons.YesNo);

            if (resp == DialogResult.No)
            {
                e.Cancel = true;
            }
        }
コード例 #26
0
ファイル: TxnDelivery.cs プロジェクト: icprog/SampleXIN2012
 private void deliveryDetailsDataGridView_UserDeletingRow(object sender,
                                                          DataGridViewRowCancelEventArgs e)
 {
     if (TBStatus == 0)
     {
         e.Cancel = true;
         return;
     }
     if (MessageBox.Show("要刪除本筆出貨明細?", "刪除",
                         MessageBoxButtons.YesNo,
                         MessageBoxIcon.Question) == DialogResult.No)
     {
         e.Cancel = true;
     }
 }
コード例 #27
0
 private void HandleUserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
 {
     if (e.Row.Index >= m_actorInformationViewModel.Actors.Count)
     {
         return;                 // Deleting new row by pressing escape - can't cancel this.
     }
     if (m_selectedActorsRemainingToDelete == 0)
     {
         m_selectedActorsRemainingToDelete = GetCountOfConfirmedActorsToDelete();
         if (m_selectedActorsRemainingToDelete == 0)
         {
             e.Cancel = true;
         }
     }
 }
コード例 #28
0
ファイル: Type_taskForm.cs プロジェクト: Tetz228/CourseWork-2
 // При выделение строки и нажатии на клавишу Del(Delete) вызывается функция удаления
 private void dataGridViewType_task_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
 {
     if (Values.AuthRole_user != 2)
     {
         if (MessageBox.Show("Вы действительно хотите удалить запись?", "Подтверждение удаления", MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             DeleteRowType_task();
         }
         e.Cancel = true;
     }
     else
     {
         e.Cancel = true;
     }
 }
コード例 #29
0
 // Name: dataGridView1_UserDeletingRow
 //
 // Description:
 //      Event handler for the DataGridView user deleteing row event.
 //      When the row is selected pressing the Delete key will attempt
 //      to delete the row from the DataGridView.
 //      The row is deleted from the data table.  If the delete is not
 //      successful the cancel state is set for the event.
 //
 // Inputs:
 //      sender  DataGridView
 //      e       Event arguments.
 //
 // Outputs:
 //      Cancel  If the delete is not successful the cancel state
 //              is set to true.
 //
 // Returns:
 //      None.
 //
 // History:
 //      02-Oct-2006 ([email protected])
 //          Created.
 private void dataGridView1_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
 {
     System.Diagnostics.Debug.WriteLine(dataGridView1.DataSource.ToString() +
                                        " User deleting row " + e.Row.ToString(), "Event");
     if (RouteDelete(e.Row) == 0)
     {
         e.Cancel = true;
     }
     else
     {
         // Disable hover over tool tips
         dataGridView1.CellMouseMove -= dataGridView1_CellMouseMove;
         LastDataRow = null;
     }
 }
コード例 #30
0
ファイル: RegBotControl.cs プロジェクト: try1975/RegBot
        private void DgvItems_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            if (e.Row.Index == -1)
            {
                return;
            }
            var id = (int)e.Row.Cells["Id"].Value;

            using (var db = new LiteDatabase(connectionString))
            {
                // Get a collection (or create, if doesn't exist)
                var col = db.GetCollection <IAccountData>("AccountsData");
                col.Delete(id);
            }
        }