private void TUMUNU_SIL() { int index = xtraTabControl_MASTER_MNG_DETAY.SelectedTabPageIndex; var rtb = xtraTabControl_MASTER_MNG_DETAY.TabPages[index].Controls[0]; DevExpress.XtraGrid.GridControl grd_ = (DevExpress.XtraGrid.GridControl)rtb; System.Data.DataView RW = (System.Data.DataView)grd_.DataSource; DevExpress.XtraGrid.Views.Grid.GridView GR = (DevExpress.XtraGrid.Views.Grid.GridView)grd_.MainView; if (GR.RowCount > 0) { DialogResult c = MessageBox.Show("Silmek istediğinize eminmisiniz?", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (c == DialogResult.Yes) { SqlConnection con = new SqlConnection(_GLOBAL_PARAMETRELER._CONNECTION_STRING.ToString()); con.Open(); SqlCommand Cmd = new SqlCommand() { CommandText = " TRUNCATE TABLE [dbo].[__MAS_EDT_" + xtraTabControl_MASTER_MNG_DETAY.SelectedTabPage.Tag.ToString() + "_" + xtraTabControl_MASTER_MNG_DETAY.SelectedTabPage.Name + "]" }; Cmd.CommandTimeout = 0; Cmd.Connection = con; Cmd.ExecuteNonQuery(); } } else { MessageBox.Show("TARİFE SEÇİNİZ"); } RW.Table.Rows.Clear(); RW.Table.AcceptChanges(); GR.RefreshData(); }
private void SATIR_SIL() { int index = xtraTabControl_MASTER_MNG_DETAY.SelectedTabPageIndex; var rtb = xtraTabControl_MASTER_MNG_DETAY.TabPages[index].Controls[0]; DevExpress.XtraGrid.GridControl grd_ = (DevExpress.XtraGrid.GridControl)rtb; System.Data.DataView RW = (System.Data.DataView)grd_.DataSource; DevExpress.XtraGrid.Views.Grid.GridView GR = (DevExpress.XtraGrid.Views.Grid.GridView)grd_.MainView; if (GR.RowCount > 0) { // int[] GETROW = GR.GetSelectedRows(); DialogResult c = MessageBox.Show("Silmek istediğinize eminmisiniz?", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (c == DialogResult.Yes) { DeleteSelectedRows(GR); //GR.ClearSorting(); //for (int i = GETROW.Length - 1; i >= 0; i--) //{ // RW.Delete(Convert.ToInt32(GETROW[i])); //} } } else { MessageBox.Show("TARİFE SEÇİNİZ"); } GR.RefreshData(); }
private void TARIFE_YAPISTIR() { int index = xtraTabControl_MASTER_MNG_DETAY.SelectedTabPageIndex; var rtb = xtraTabControl_MASTER_MNG_DETAY.TabPages[index].Controls[0]; DevExpress.XtraGrid.GridControl grd_ = (DevExpress.XtraGrid.GridControl)rtb; System.Data.DataView RW = (System.Data.DataView)grd_.DataSource; DevExpress.XtraGrid.Views.Grid.GridView GR = (DevExpress.XtraGrid.Views.Grid.GridView)grd_.MainView; CLASS.DESIGNE_CLASS paste = new CLASS.DESIGNE_CLASS(); paste.MASTER_YAPISTIR(RW, GR); GR.RefreshData(); }