示例#1
0
        public void Delete_Click(object sender, EventArgs e)
        {
            Button button   = (Button)sender;
            string buttonId = button.ID;

            if (Session["LoggedInUserID"] == null)
            {
                Response.Write("<script language='javascript'>window.alert('Something went wrong, pleasse try again later');window.location='SignIn.aspx';</script>");
                //Response.Write("<script language='javascript'>window.alert('Popup message ');window.location='webform.aspx';</script>");
                //Response.Redirect("SignIn.aspx");
                return;
            }

            string strTitle = buttonId.Remove(0, 3);

            int iResult = SC.RemoveGame(strTitle);

            if (iResult == 0)
            {
                //Dont exsists
                Response.Write("<script>alert('Game Title does not Exists');</script>");
            }
            else if (iResult == 1)
            {
                //All Good
                Response.Write("<script>alert('Game Deleted');</script>");
            }
            else
            {
                Response.Write("<script>alert('Something went wrong, please try again later');</script>");
            }
        }
示例#2
0
        protected void Delete_Click(object sender, EventArgs e)
        {
            if (Session["LoggedInUserID"] == null)
            {
                //Response.Write("<script>alert('Something went wrong, pleasse try again later');Response.Redirect(SignIn.aspx");</script>");
                Response.Redirect("SignIn.aspx");
                return;
            }

            if (Delete_Title.Value == "")
            {
                Response.Write("<script>alert('Please fill in the Game Titles');</script>");
            }

            string strTitle = Delete_Title.Value;

            int iResult = SC.RemoveGame(strTitle);

            if (iResult == 0)
            {
                //Dont exsists
                Response.Write("<script>alert('Game Title does not Exists');</script>");
            }
            else if (iResult == 1)
            {
                //All Good
                Response.Write("<script>alert('Game Deleted');</script>");
            }
            else
            {
                Response.Write("<script>alert('Something went wrong, please try again later');</script>");
            }
        }