コード例 #1
0
ファイル: admin.aspx.cs プロジェクト: jaydenkjh/Go_Singapore2
        public void Button6_Click(object sender, EventArgs e)
        {
            AdminDataManager ADMgr = new AdminDataManager();
            int  itineraryID       = -1;
            int  attractionID      = -1;
            bool doit         = true;
            int  returnresult = -1;

            try
            {
                itineraryID  = Int32.Parse(this.TextBox13.Text);
                attractionID = Int32.Parse(this.TextBox14.Text);
                if (itineraryID < 1 || attractionID < 1)
                {
                    doit = false;
                }
            }
            catch (Exception)
            {
                doit = false;
            }
            if (doit)
            {
                returnresult = ADMgr.deleteItineraryDoList(itineraryID, attractionID);
                DataTable dt = ADMgr.getItineraryDoList();
                GridView3.DataSource = dt;
                GridView3.DataBind();
                if (returnresult < 1)
                {
                    this.TextBox15.Text = "Failure to delete. Please try again.";
                }
                else
                {
                    this.TextBox15.Text = "Deleted successfully.";
                }
            }
        }