コード例 #1
0
 public static void ChangeData(DataGridView sverPDataGrid, ExportParametrs exportP, object objectEditDataGrid, bool load, int rowIndex, int colIndex)
 {
     try
     {
         if (load == true)
         {
             if (sverPDataGrid.Rows[rowIndex].Cells[colIndex].Value == null)
             {
                 sverPDataGrid.Rows[rowIndex].Cells[colIndex].Value = "";
             }
             if (sverPDataGrid.Rows[rowIndex].Cells[colIndex].Value.ToString() != FunctionUse.different)
             {
                 if (sverPDataGrid.Rows[rowIndex].Tag.ToString() == RowsDatagridExportNames.tipSpec)
                 {
                     exportP.TipSpec = (RowsDatagridExportNames.TipSpecAndVed)Array.IndexOf(RowsDatagridExportNames.tip, sverPDataGrid.Rows[rowIndex].Cells[colIndex].Value);
                 }
                 else if (sverPDataGrid.Rows[rowIndex].Tag.ToString() == RowsDatagridExportNames.tipVed)
                 {
                     exportP.Tipved = (RowsDatagridExportNames.TipSpecAndVed)Array.IndexOf(RowsDatagridExportNames.tip, sverPDataGrid.Rows[rowIndex].Cells[colIndex].Value);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         MessageBox.Show(ex.StackTrace);
         if (ex.InnerException != null)
         {
             MessageBox.Show(ex.InnerException.ToString());
         }
     }
 }
コード例 #2
0
        public static void ChangeSpec(DataGridView sverPDataGrid, ExportParametrs newDataBase)
        {
            try
            {
                for (int i = 0; i <= sverPDataGrid.Rows.Count - 1; i++)
                {
                    if (sverPDataGrid.Rows[i].Tag.ToString() == RowsDatagridExportNames.tipSpec)
                    {
                        if (sverPDataGrid.Rows[i].Cells[ColDatagridExportNames.value].GetType() == typeof(DataGridViewComboBoxCell))
                        {
                            DataGridViewComboBoxCell cc = (DataGridViewComboBoxCell)sverPDataGrid.Rows[i].Cells[ColDatagridExportNames.value];
                            if (cc.Items != null)
                            {
                                sverPDataGrid.Rows[i].Cells[SveraParam.ColDatagridNames.Value].Value = RowsDatagridExportNames.tip[(int)newDataBase.TipSpec];
                            }
                        }
                    }

                    if (sverPDataGrid.Rows[i].Tag.ToString() == RowsDatagridExportNames.tipVed)
                    {
                        if (sverPDataGrid.Rows[i].Cells[ColDatagridExportNames.value].GetType() == typeof(DataGridViewComboBoxCell))
                        {
                            DataGridViewComboBoxCell cc = (DataGridViewComboBoxCell)sverPDataGrid.Rows[i].Cells[ColDatagridExportNames.value];
                            if (cc.Items != null)
                            {
                                sverPDataGrid.Rows[i].Cells[SveraParam.ColDatagridNames.Value].Value = RowsDatagridExportNames.tip[(int)newDataBase.Tipved];
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("ChangeSpec", ex);
            }
        }
コード例 #3
0
 public SveraExportParam(ExportParametrs exportP) :
     this()
 {
     this.exportP = exportP.Copy();
 }
コード例 #4
0
 public ExportParametrs(ExportParametrs exportP) :
     this(exportP.tipSpec, exportP.tipVed)
 {
 }