コード例 #1
0
 private void ListOfQuestion_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         QuestionsInformation.ReturnNewQuestion = GetObjectSelect();
         Qustion OldObject = QuestionsInformation.ReturnNewQuestion;
         Operation.ListOfAllQuestion.Remove(OldObject);
         ListOfQuestion.ClearSelection();
         if (QuestionsInformation.ReturnNewQuestion != null)
         {
             QuestionsInformation QuestionsInformationPage = new QuestionsInformation(TypeOfChoice.Edit);
             if (QuestionsInformationPage.ShowDialog() == DialogResult.OK)
             {
                 Operation.ListOfAllQuestion.Remove(OldObject);
                 Operation.ListOfAllQuestion.Add(QuestionsInformation.ReturnNewQuestion);
                 ShowData(Operation.ListOfAllQuestion);
             }
         }
         else
         {
             MessageBox.Show(Survey.Properties.Messages.NoSelectItem, GenralVariables.ErrorString, MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception ex)
     {
         GenralVariables.Errors.Log(ex.Message);
         MessageBox.Show(Survey.Properties.Messages.MessageError);
     }
 }
コード例 #2
0
 private void ListOfQuestion_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         QuestionWillDeleteOrEdit = GetObjectSelect();
         if (QuestionWillDeleteOrEdit != null)
         {
             QuestionsInformation QuestionsInformationPage = new QuestionsInformation(QuestionWillDeleteOrEdit, Global.TypeOfChoice.Edit.ToString());
             QuestionsInformationPage.ShowDialog();
             if (StaticObjects.SuccOfFail == 1)
             {
                 ListOfAllQuestion = Operation.GetQustion();
                 ShowData();
                 StaticObjects.SuccOfFail = 0;
             }
         }
         else
         {
             MessageBox.Show(Survey.Properties.Resource1.NoSelectItem, Global.Constant.ErrorString, MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception ex)
     {
         StaticObjects.Erros.Log(ex);
         MessageBox.Show(Survey.Properties.Resource1.MessageError);
     }
 }
コード例 #3
0
 /// <summary>
 /// This Listener for Add button when press add button
 /// </summary>
 private void Add_Click(object sender, EventArgs e)
 {
     try
     {
         ListOfQuestion.ClearSelection();
         QuestionsInformation QuestionsInformationPage = new QuestionsInformation(TypeOfChoice.Add);
         if (QuestionsInformationPage.ShowDialog() == DialogResult.OK)
         {
             Operation.ListOfAllQuestion.Add(QuestionsInformation.ReturnNewQuestion);
             ShowData(Operation.ListOfAllQuestion);
         }
     } catch (Exception ex)
     {
         GenralVariables.Errors.Log(ex.Message);
         MessageBox.Show(Survey.Properties.Messages.MessageError);
     }
 }
コード例 #4
0
 /// <summary>
 /// This Listener for Add button when press add button
 /// </summary>
 private void Add_Click(object sender, EventArgs e)
 {
     try
     {
         ListOfQuestion.ClearSelection();
         QuestionsInformation QuestionsInformationPage = new QuestionsInformation(QuestionWillDeleteOrEdit, Global.TypeOfChoice.Add.ToString());
         QuestionsInformationPage.ShowDialog();
         if (StaticObjects.SuccOfFail == 1)
         {
             ListOfAllQuestion = Operation.GetQustion();
             ShowData();
             StaticObjects.SuccOfFail = 0;
         }
     }catch (Exception ex)
     {
         StaticObjects.Erros.Log(ex);
         MessageBox.Show(Survey.Properties.Resource1.MessageError);
     }
 }