Exemplo n.º 1
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            //try
            //{
            string app_id  = ddlApp.SelectedValue;
            string path_id = Request.QueryString["id"];
            string path    = txtPath.Text;

            int i = path_obj.UpdatePath(app_id, path_id, path);

            switch (i)
            {
            case -3:
                Response.Write("<script>alert('Không tồn tại ID này.');window.location.href='" + view_ctrl + "';</script>");
                Response.End();
                break;

            case -2:
                Response.Write("<script>alert('Update không thành công.');window.location.href='" + edit_ctrl + "';</script>");
                Response.End();
                break;

            case -1:
                Response.Write("<script>alert('Thông tin không đầy đủ');window.location.href='" + edit_ctrl + "';</script>");
                Response.End();
                break;

            case 1:
                Response.Write("<script>alert('Update thành công');window.location.href='" + view_ctrl + "';</script>");
                Response.End();
                break;

            default:
                Response.Write("<script>alert('Lỗi hệ thống');window.location.href='" + view_ctrl + "';</script>");
                Response.End();
                break;
            }

            //}
            //catch (Exception ex) { ex.ToString(); }
        }