예제 #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);
            }
        }
예제 #2
0
        //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);
            }
        }