Ejemplo n.º 1
0
        protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "cancel")
            {
                string gotoYN = e.CommandArgument.ToString().Split(new string[] { ",," }, StringSplitOptions.RemoveEmptyEntries)[1].Trim();
                //已出發之公務車無法取消
                if (gotoYN == "N")
                {
                    JuicDao dao = new JuicDao("MENU");

                    dao.DeleteCarrent(e.CommandArgument.ToString().Split(new string[] { ",," }, StringSplitOptions.RemoveEmptyEntries)[0].Trim());

                    Label3.Text = "已取消此租借";
                }
                else
                {
                    Label3.Text = "已出發之公務車無法取消";
                }
            }
        }