Esempio n. 1
0
 private void select_TIME_vdbutton_Click(object sender, EventArgs e)
 {
     try
     {
         frmSelectValueDomain frmselect = new frmSelectValueDomain();
         if (frmselect.ShowDialog() == DialogResult.OK)
         {
             if (frmselect.SelectedValueDomain != null)
             {
                 TIME_PERIODTextBox.Text = frmselect.SelectedValueDomain.vtlId;
             }
         }
     }
     catch (Exception ex)
     {
         CommonItem.ErrManger.ErrorManagement(ex, false, this);
     }
 }
        private void DataStructureComponentDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.ColumnIndex == DataStructureComponentDataGridView.Columns["EditName"].Index)
                {
                    DataGridViewComboBoxCell descriptionList = (DataGridViewComboBoxCell)this.DataStructureComponentDataGridView.Rows[DataStructureComponentDataGridView.CurrentRow.Index].Cells[1];

                    frmArtefactDescription frmArtDescr = new frmArtefactDescription();
                    if (descriptionList.Items.Count > 0)
                    {
                        List <KeyValuePair <string, string> > tmpList = new List <KeyValuePair <string, string> >();

                        foreach (string str in descriptionList.Items)
                        {
                            string[] couple = str.Split(" - ".ToCharArray());
                            if (couple.Length > 0)
                            {
                                KeyValuePair <string, string> tmpCouple = new KeyValuePair <string, string>(couple[0], couple[3]);
                                tmpList.Add(tmpCouple);
                            }
                        }

                        frmArtDescr.Descriptions = tmpList;
                    }

                    frmArtDescr.ApplyArtefactCheckBoxEnabled(false);
                    bool applyWholeArtefact = ((frmArtefactManager)this.Parent.FindForm()).ApplyLanguageToWholeArtefact;

                    frmArtDescr.ApplyToWholeArtifact = applyWholeArtefact;
                    string[] languagesWholeArtefact = ((frmArtefactManager)this.Parent.FindForm()).ArtefactLanguages;

                    if (applyWholeArtefact && languagesWholeArtefact != null && languagesWholeArtefact.Length > 0)
                    {
                        frmArtDescr.Languages = languagesWholeArtefact;
                    }

                    if (frmArtDescr.ShowDialog() == DialogResult.OK)
                    {
                        descriptionList.Items.Clear();
                        foreach (KeyValuePair <string, string> couple in frmArtDescr.Descriptions)
                        {
                            descriptionList.Items.Add(couple.Key + " - " + couple.Value);
                        }
                        DataStructureComponentDataGridView.Rows[DataStructureComponentDataGridView.CurrentRow.Index].Cells[1].Value = descriptionList.Items[0];
                    }
                }

                if (e.ColumnIndex == DataStructureComponentDataGridView.Columns["ValueDomainButton"].Index)
                {
                    frmSelectValueDomain frmValDom = new frmSelectValueDomain();
                    if (frmValDom.ShowDialog() == DialogResult.OK)
                    {
                        DataStructureComponentDataGridView.Rows[DataStructureComponentDataGridView.CurrentRow.Index].Cells[e.ColumnIndex - 1].Value = frmValDom.SelectedValueDomain;
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }