Exemple #1
0
 private void editBtn_Click(object sender, EventArgs e)
 {
     if (this.linesGrid.SelectedRows.Count > 0)
     {
         var lineId = (int)this.linesGrid.SelectedRows[0].Cells["ID"].Value;
         var editLineForm = new EditLineForm(this, lineId);
         editLineForm.ShowDialog(this);
     }
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="SelectExceptionForm"/> class.
        /// </summary>
        /// <param name="form">The form.</param>
        /// <param name="lineId">The line id.</param>
        public SelectExceptionForm(EditLineForm form, int lineId = 0)
        {
            this.exceptionLogic = SWKM.Setup.IoC.Resolve<ExceptionLogic>();
            this.lineId = lineId;
            this.editLineForm = form;

            InitializeComponent();

            var response = exceptionLogic.GetAllLineExceptions(lineId);

            if (response.Successful == true)
            {
                this.selectedExceptionList = response.Objects;
                this.RefreshGrid();
            }
            else
            {
                MessageBox.Show(this, response.ErrorMessage, "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #3
0
 private void addBtn_Click(object sender, EventArgs e)
 {
     var editLineForm = new EditLineForm(this);
     editLineForm.ShowDialog(this);
 }