Ejemplo n.º 1
0
 private void sverPDataGrid_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == sverPDataGrid.Columns[SveraParam.ColDatagridNames.Redact].Index)
     {
         if (SveraB.RowNamesShort[e.RowIndex].redact == true)
         {
             if (sverPDataGrid.Rows[e.RowIndex].Tag.ToString() == SveraParam.RowsDatagridNames.vedRabotTable)
             {
                 VedTableForm ved = new VedTableForm(SveraB.FromDataBaseWideForSvera.VedRabotTable);
                 if (ved.ShowDialog(this) == DialogResult.OK)
                 {
                     SveraB.FromDataBaseWideForSvera.VedRabotTable = ved.VedTableP;
                 }
             }
             else
             {
                 RedactText red = new RedactText(sverPDataGrid.Rows[e.RowIndex].Cells[SveraParam.ColDatagridNames.Value].Value.ToString());
                 if (red.ShowDialog(this) == DialogResult.OK)
                 {
                     sverPDataGrid.Rows[e.RowIndex].Cells[SveraParam.ColDatagridNames.Value].Value = red.RedactRichBox.Text;
                     SveraParam.ChangeData(sverPDataGrid, SveraB.FromDataBaseWideForSvera, objectEditDataGrid, load, e.RowIndex, sverPDataGrid.Columns[SveraParam.ColDatagridNames.Value].Index);
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
 private void sverPDataGrid_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex > -1 && e.RowIndex > -1)
     {
         if (e.ColumnIndex == sverPDataGrid.Columns[SveraParam.ColDatagridNames.Redact].Index)
         {
             if (sveraP.RowList[e.RowIndex].redact == true)
             {
                 if (sverPDataGrid.Rows[e.RowIndex].Tag.ToString() == SveraParam.RowsDatagridNames.vedRabotTable)
                 {
                     PodKlassFrom pod = sveraP.FromDataBaseWideForSvera.PodklassUseR;
                     if (sveraP.FromDataBaseWideForSvera.PodklassL.Count > 1 && pod.Equals(sveraP.FromDataBaseWideForSvera.PodklassL[0]))
                     {
                     }
                     else
                     {
                         VedTableRevisionForm ved = new VedTableRevisionForm(pod.VedTableRevision);
                         if (ved.ShowDialog(this) == DialogResult.OK)
                         {
                             pod.VedTableRevision = ved.VedTableExp;
                             sveraP.FromDataBaseWideForSvera.VedRabotDifferent = false;
                         }
                     }
                 }
                 else if (sverPDataGrid.Rows[e.RowIndex].Tag.ToString() == SveraParam.RowsDatagridNames.Revision || sverPDataGrid.Rows[e.RowIndex].Tag.ToString() == SveraParam.RowsDatagridNames.etap || sverPDataGrid.Rows[e.RowIndex].Tag.ToString() == SveraParam.RowsDatagridNames.kolic)
                 {
                     PodKlassFrom pod = sveraP.FromDataBaseWideForSvera.PodklassUseR;
                     if (sveraP.FromDataBaseWideForSvera.PodklassL.Count > 1 && pod.Equals(sveraP.FromDataBaseWideForSvera.PodklassL[0]))
                     {
                     }
                     else
                     {
                         RevisionForm rev = new RevisionForm(pod.Revision);
                         if (rev.ShowDialog(this) == DialogResult.OK)
                         {
                             pod.Revision = rev.RevisionExp.ToList();
                             sveraP.FromDataBaseWideForSvera.MakeVedTableCorrectToRevision();
                             sveraP.FromDataBaseWideForSvera.RevisionDifferent = false;
                             sverPDataGrid.Rows[sveraP.RowList.FirstOrDefault(r => r.nameRow == SveraParam.RowsDatagridNames.Revision).numberRow].Cells[SveraParam.ColDatagridNames.Value].Value = sveraP.FromDataBaseWideForSvera.RevisionTxt;
                             sverPDataGrid.Rows[sveraP.RowList.FirstOrDefault(r => r.nameRow == SveraParam.RowsDatagridNames.etap).numberRow].Cells[SveraParam.ColDatagridNames.Value].Value     = sveraP.FromDataBaseWideForSvera.EtapTxt;
                             sverPDataGrid.Rows[sveraP.RowList.FirstOrDefault(r => r.nameRow == SveraParam.RowsDatagridNames.kolic).numberRow].Cells[SveraParam.ColDatagridNames.Value].Value    = sveraP.FromDataBaseWideForSvera.Kolic;
                         }
                     }
                 }
                 else if (sverPDataGrid.Rows[e.RowIndex].Tag.ToString() == SveraParam.RowsDatagridNames.Podklass)
                 {
                     PodKlassForm rev = new PodKlassForm(sveraP.FromDataBaseWideForSvera);
                     if (rev.ShowDialog(this) == DialogResult.OK)
                     {
                         ChangeSpec();
                     }
                 }
                 else
                 {
                     string ved = sverPDataGrid.Rows[e.RowIndex].Cells[SveraParam.ColDatagridNames.Value].Value.ToString();
                     if (sverPDataGrid.Rows[e.RowIndex].Tag.ToString() == SveraParam.RowsDatagridNames.vedRabot)
                     {
                         ved = sveraP.FromDataBaseWideForSvera.VedRabot;
                     }
                     RedactText red = new RedactText(ved);
                     if (red.ShowDialog(this) == DialogResult.OK)
                     {
                         sverPDataGrid.Rows[e.RowIndex].Cells[SveraParam.ColDatagridNames.Value].Value = red.RedactRichBox.Text;
                         SveraParam.ChangeData(sverPDataGrid, sveraP.FromDataBaseWideForSvera, objectEditDataGrid, load, e.RowIndex, sverPDataGrid.Columns[SveraParam.ColDatagridNames.Value].Index);
                     }
                 }
             }
         }
     }
 }