Exemplo n.º 1
0
        /// <summary>
        /// Expedite submission button click event handler.This method submits the ticket to NJUNS submit ticket service
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnExpSubmission_Click(object sender, EventArgs e)
        {
            if (!ValidateRequiredFieldsForNull())
            {
                // Show error and  return
                MessageBox.Show("Failed to submit the ticket.Required fields are empty.", "G/Technology");
                return;
            }
            if (!changesSaved)
            {
                MessageBox.Show("Please save the changes before submitting the ticket. ", "G/Technology");
                return;
            }
            // Submit the ticket
            customNjunsSharedLibrary njunsSharedLibrary = new customNjunsSharedLibrary();

            if (GetStepsByOrder() == null)
            {
                MessageBox.Show("A ticket should have atleast one step for submission.", "G/Technology");
                return;
            }
            if (njunsSharedLibrary.SubmitTicket(objTicket.GIS_NJUNS_TICKET_ID, 'I'))
            {
                // Make the form read only. Grey out Submission and Save buttons.
                LockControlValues(new List <Control> {
                    grpBxTicket, grpBxSteps, grpBxSubmission
                });
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Save button click event handler. This method saved the ticket details to the DB.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         customNjunsSharedLibrary njunsSharedLibrary = new customNjunsSharedLibrary();
         ResetStepIds();
         objTicket.TicketStepTypeList = GetStepsByOrder();
         dataLayer             = new DataLayer();
         dataLayer.DataContext = DataContext;
         dataLayer.CopyPropertiesFrom(objTicket);
         dataLayer.SaveTicketAndStepDetails();
         ticketBindingSource.ResetBindings(false);
         changesSaved = true;
         this.Close();
     }
     catch (Exception)
     {
         throw;
     }
 }