Пример #1
0
 private void btnTransfer_Click(object sender, EventArgs e)
 {
     if (dgvAddingSelected.DataSource != null)
     {
         DataTable dtGridView1 = new DataTable();
         //dtGridView1 = (DataTable)dgvAddingItem.DataSource;
         //dtSource.Merge(dtGridView1);
         //dgvAddingSelected.DataSource = dtSource;
         foreach (DataGridViewColumn column in dgvAddingItem.Columns)
         {
             dtGridView1.Columns.Add(column.HeaderText);
         }
         foreach (DataGridViewRow row in dgvAddingItem.Rows)
         {
             Boolean CheckRow = Convert.ToBoolean(row.Cells["Select"].Value);
             if (CheckRow)
             {
                 dtGridView1.Rows.Add();
                 foreach (DataGridViewCell cell in row.Cells)
                 {
                     dtGridView1.Rows[dtGridView1.Rows.Count - 1][cell.ColumnIndex] = cell.Value.ToString();
                 }
             }
         }
         //dtSource.Merge(dtGridView1);
         dgvAddingSelected.DataSource = dtGridView1;
     }
     else if (dgvAddingSelected.DataSource is null)
     {
         CopyGrid.CopyDataGridView(dgvAddingItem, dgvAddingSelected);
     }
 }
Пример #2
0
        private void btnTransfer_Click(object sender, EventArgs e)
        {
            CopyGridView copyGrid = new CopyGridView();

            copyGrid.CopyDataGridView(dgvQuerry, dgvSelected);
        }
Пример #3
0
 private void btnFinalTransfer_Click(object sender, EventArgs e)
 {
     CopyGrid.CopyDataGridView(dgvListDevice, dgvListFinal);
     dgvAddOutDevice.Rows.Clear();
     CheckGO();
 }
Пример #4
0
        private void btnChoose_Click(object sender, EventArgs e)
        {
            try
            {
                if (rdrYesUse.Checked == true)
                {
                    CopyGridView copyGrid = new CopyGridView();
                    copyGrid.copyDataGridViewNotDelete(dgvAddOutDevice, dgvListDevice);

                    dgvListDevice.Columns.Add("Ma_TS_Repair", "Vật tư cần sửa chữa");

                    foreach (DataGridViewRow row in dgvRepairDevice.Rows)
                    {
                        Boolean CheckRow = Convert.ToBoolean(row.Cells["Select"].Value);
                        if (CheckRow)
                        {
                            string MTS = row.Cells["Ma_TS"].Value.ToString();
                            foreach (DataGridViewRow row2 in dgvListDevice.Rows)
                            {
                                row2.Cells["Ma_TS_Repair"].Value = MTS;
                            }
                        }
                    }


                    AntiDuplicated antiDuplicated = new AntiDuplicated();
                    antiDuplicated.AntiColumnDuplicate(dgvListDevice);

                    string ColumnName = dgvAddOutDevice.Columns["Select"].Name.ToString();
                    AutoComplete.AutoUnselectAll(dgvAddOutDevice, ColumnName);

                    foreach (DataGridViewRow row in dgvRepairDevice.Rows)
                    {
                        Boolean CheckRow = Convert.ToBoolean(row.Cells["Select"].Value);
                        if (CheckRow)
                        {
                            int n = row.Index;
                            dgvRepairDevice.Rows.RemoveAt(n);
                        }
                    }


                    btnFinalTransfer_Click(this, new EventArgs());
                }
                else if (rdrNoUse.Checked == true)
                {
                    CopyGridView copyGrid = new CopyGridView();
                    copyGrid.CopyDataGridView(dgvRepairDevice, dgvListDevice);

                    foreach (DataGridViewRow row in dgvRepairDevice.Rows)
                    {
                        Boolean CheckRow = Convert.ToBoolean(row.Cells["Select"].Value);
                        if (CheckRow)
                        {
                            int n = row.Index;
                            dgvRepairDevice.Rows.RemoveAt(n);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #5
0
        private void btnTransfer_Click(object sender, EventArgs e)
        {
            CopyGridView copyGrid = new CopyGridView();

            copyGrid.CopyDataGridView(dgvAddingDevice, dgvAddOutDevice);
        }
Пример #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            CopyGridView copy = new CopyGridView();

            copy.CopyDataGridView(dgvQuerry, dgvSelected);
        }
Пример #7
0
 private void btnTransfer_Click(object sender, EventArgs e)
 {
     CopyGrid.CopyDataGridView(dgvRepairDevice, dgvRepairSelected);
 }