protected void btnOkay_Click(object sender, EventArgs e) { ArticleCommentController comment_obj = new ArticleCommentController(); string user_id = Session["UserId"].ToString(); string status = rdlStatus.SelectedValue; Page.Validate("ValidationCheck"); if (Page.IsValid) { System.Threading.Thread.Sleep(2000); int i = comment_obj.UpdateStatus(user_id, _idx, status); if (i == -1) { lblErrorMsg.Text = "Thông tin không đầy đủ"; ClientScript.RegisterStartupScript(this.GetType(), "onload", "onError();", true); MultiView1.ActiveViewIndex = 0; } else if (i == -2) { lblErrorMsg.Text = "Tiến trình xử lý bị lỗi"; ClientScript.RegisterStartupScript(this.GetType(), "onload", "onError();", true); MultiView1.ActiveViewIndex = 2; } else if (i == -3) { lblErrorMsg.Text = "Dữ liệu không tồn tại"; ClientScript.RegisterStartupScript(this.GetType(), "onload", "onError();", true); MultiView1.ActiveViewIndex = 2; } else if (i == 1) { lblResult.Text = "Cập nhật thành công"; MultiView1.ActiveViewIndex = 1; ClientScript.RegisterStartupScript(this.GetType(), "onload", "onSuccess();", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "onload", "onError();", true); MultiView1.ActiveViewIndex = 2; } } }