Beispiel #1
0
        //add deviation
        private void editDeviation_Click(object sender, EventArgs e)
        {
            String    deviationRef = this.DeviationDataGridView.CurrentRow.Cells[0].Value.ToString();
            Deviation deviation    = autorisation.canUpdateDeviation(deviationRef);

            //The user can update the deviation if signature attribut of the deviation has the user name
            if (deviation != null)
            {
                //dos the user choose the Deviation to update
                if (deviationRef != "" && deviationRef != null)
                {
                    //make sure that the deviation is closed
                    if (!deviationModel.isDeviationClosed(deviation))
                    {
                        //update Deviation
                        SaveDeviation saveDeviation = new SaveDeviation("updateDeviation", null, this);
                        saveDeviation.updateDeviation(deviation);
                    }
                    else
                    {
                        MessageBox.Show("You Are Not Allowed To Make Any Change On This Item Because Its Already Closed !", "Infos", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            else
            {
                MessageBox.Show("You Are Not Allowed To Update This Item !", "Infos", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        //edit deviation
        private void deviationÜberarbeitenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            String    deviationRef = this.DeviationDataGridView.CurrentRow.Cells[0].Value.ToString();
            Deviation deviation    = autorisation.canUpdateDeviation(deviationRef);

            //The user can update the deviation if signature attribut of the deviation has the user name
            if (deviation != null)
            {
                //dos the user choose the Deviation to update
                if (deviationRef != "" && deviationRef != null)
                {
                    //make sure that the deviation is closed
                    if (!deviationModel.isDeviationClosed(deviation))
                    {
                        //update Deviation
                        SaveDeviation saveDeviation = new SaveDeviation("updateDeviation", this, null);
                        saveDeviation.updateDeviation(deviation);
                    }
                    else
                    {
                        MessageBox.Show(this.languageModel.getString("notAllowedToChange"), "Infos", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            else
            {
                MessageBox.Show(this.languageModel.getString("notAllowedToUpdateItem"), "Infos", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Beispiel #3
0
        public EmailGUI(Deviation deviation, SaveDeviation saveDeviation)
        {
            InitializeComponent();
            this.deviation      = deviation;
            this.saveDeviation  = saveDeviation;
            this.deviationModel = new DeviationModel();
            emailSender         = new EmailSender();
            languageModel       = new LanguageModel();

            //generate email Content from deviation
            this.generateEmailContent();
        }
Beispiel #4
0
 //Show deviation double click
 private void DeviationDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (this.DeviationDataGridView.CurrentRow != null)
     {
         String    deviationRef = this.DeviationDataGridView.CurrentRow.Cells[0].Value.ToString();
         Deviation deviation    = deviationModel.getDeviationWithRef(deviationRef);
         //The user can update the deviation if signature attribut of the deviation has the user name
         if (deviation != null)
         {
             //show Deviation
             SaveDeviation saveDeviation = new SaveDeviation("showDeviation", null, this);
             saveDeviation.showDeviation(deviation);
         }
         else
         {
             MessageBox.Show("Deviation dos not exist!");
         }
     }
     else
     {
         MessageBox.Show("Please Choose a Deviation Before makimg this Action!");
     }
 }
 //show deviation double click
 private void DeviationDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (this.DeviationDataGridView.CurrentRow != null)
     {
         String    deviationRef = this.DeviationDataGridView.CurrentRow.Cells[0].Value.ToString();
         Deviation deviation    = deviationModel.getDeviationWithRef(deviationRef);
         //The user can update the deviation if signature attribut of the deviation has the user name
         if (deviation != null)
         {
             //show Deviation
             SaveDeviation saveDeviation = new SaveDeviation("showDeviation", this, null);
             saveDeviation.showDeviation(deviation);
         }
         else
         {
             MessageBox.Show(this.languageModel.getString("deviationNotExist"));
         }
     }
     else
     {
         MessageBox.Show(this.languageModel.getString("chooseDeviation"));
     }
 }
Beispiel #6
0
        //add deviation
        private void addDeviation_Click(object sender, EventArgs e)
        {
            SaveDeviation saveDeviation = new SaveDeviation("newDeviation", null, this);

            saveDeviation.Show();
        }
Beispiel #7
0
        //
        private void saveDeviationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveDeviation saveDeviation = new SaveDeviation("newDeviation", null, this);

            saveDeviation.Show();
        }