Exemple #1
0
        /// <summary>
        /// update the state of the intervention using engineer service
        /// if success redirect to homepage
        /// else display error message
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Submit_btn_Click(object sender, EventArgs e)
        {
            try
            {
                bool success = engineerService.updateInterventionState(new Guid(Request.QueryString["Id"]), (InterventionState)State.SelectedIndex);

                if (success)
                {
                    Response.Redirect("~/Engineer/Welcome.aspx", false);
                }
                else
                {
                    errorMessage.Text = "Update Failed, this can be one of the following reasons" + " <br />" +
                                        " You are not authorized to change this intervention state or" + " <br />" +
                                        " The state selected is invalid" + " <br />";
                    //Response.Redirect("~/InternalError.aspx");
                }
            }
            catch (Exception)
            {
                Response.Redirect("~/Errors/InternalErrors.aspx", true);
            }
        }