예제 #1
0
        //Gabriele 25/11/18
        //UPDATE: Gabriele 4/12/18 - to also delete scouting reports for all recruits when applicable
        protected void BtnDelete_Click(object sender, EventArgs e)
        {
            string       recruitID = Request.QueryString["id"];
            RecruitClass recruit   = ConnectionClass.GetRecruit(Convert.ToInt32(recruitID));
            string       position  = recruit.Position;

            try
            {
                ConnectionClass.DeleteReport(recruitID, position);
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                ConnectionClass.DeleteRecruit(recruitID);
                Response.Redirect("Recruits.aspx");
            }
        }
예제 #2
0
        // 25/11/18 Gabriele //Updated to master
        //UPDATE: Gabriele 4/12/18 - to also delete scouting reports for all recruits when applicable
        protected void ListViewRecruits_deleteRecruit(object sender, ListViewCommandEventArgs e)
        {
            string       recruitID = e.CommandArgument.ToString();
            RecruitClass recruit   = ConnectionClass.GetRecruit(Convert.ToInt32(recruitID));
            string       position  = recruit.Position;


            try
            {
                ConnectionClass.DeleteReport(recruitID, position);
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                if (e.CommandName == "deleteRecruit")
                {
                    ConnectionClass.DeleteRecruit(recruitID);
                    Page.Response.Redirect(Page.Request.Url.ToString(), true);
                }
            }
        }