protected void submit_review_Click(object sender, EventArgs e) { if (Page.IsValid) { try { if (Session["CheckRefresh"] != null) { if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString()) { Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString()); if (Session["User_Id"] != null) { bl.User_id = Session["User_Id"].ToString(); } else { if (Request.Cookies["User_Id"] != null) { Session["User_Id"] = Request.Cookies["User_Id"].Value; bl.User_id = Request.Cookies["User_Id"].Value; } } bl.Date_time = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"); bl.Client_id = util.GetClientIpAddress(this.Page); bl.Review = txt_review.Text.Trim(); bl.Headline = txt_Heading.Text.Trim(); bl.Rating = ViewState["Rating"].ToString(); bl.Category = ""; bl.Status = "N"; if (submit_review.Text == "Update Review") { rb = dl.Update_user_rating(bl); } else { rb = dl.Insert_user_rating(bl); } if (rb.status) { Utilities.MessageBox_UpdatePanel_Redirect(updatepanel1, "Thanks for your review, Your Review is submitted at HogwartsInstitute", Request.Url.AbsoluteUri); } else { Utilities.MessageBox_UpdatePanel_Redirect(updatepanel1, "Thanks for your review, Your Review is submitted at HogwartsInstitute", Request.Url.AbsoluteUri); } //Thread Stamp_Action = new Thread(delegate () //{ // dtnew = dl.select_receriver_name_for_user_for_review(bl.User_id); // if (dtnew.table.Rows.Count > 0) // { // bl.Type = null; // bl.First_name = dtnew.table.Rows[0]["applicant_first_name"].ToString(); // bl.Message = "Hi " + bl.First_name + ", Thanks for your review, Your Review is submitted at cellsalts4health, We will update you when your review is approved"; // //bl.Success = send_sms_to_user(dtnew.table.Rows[0]["applicant_mobile"].ToString(), bl.Message); // //rb = dl.sms_log(bl); // //bl.Type = null; // if (dtnew.table.Rows[0]["applicant_email"].ToString() != "" && dtnew.table.Rows[0]["applicant_email"].ToString() != null) // { // bl.Success = email_to_user_new(dtnew.table.Rows[0]["applicant_email"].ToString(), bl.Message); // rb = dl.sms_log(bl); // } // } // dtnew = dl.select_receriver_name_for_user_for_review("9986546496"); // if (dtnew.table.Rows.Count > 0) // { // bl.Type = null; // bl.Message = "Hi " + dtnew.table.Rows[0]["applicant_first_name"].ToString() + ", One of our client Mr/Miss/Mrs : " + bl.First_name + " has submitted a Review at cellsalts4health, Please Login to your account and review it for approve."; // //bl.Success = send_sms_to_user(dtnew.table.Rows[0]["applicant_mobile"].ToString(), bl.Message); // //rb = dl.sms_log(bl); // // bl.Type = null; // if (dtnew.table.Rows[0]["applicant_email"].ToString() != "" && dtnew.table.Rows[0]["applicant_email"].ToString() != null) // { // bl.Success = email_to_user_new(dtnew.table.Rows[0]["applicant_email"].ToString(), bl.Message); // rb = dl.sms_log(bl); // } // } //}); //Stamp_Action.IsBackground = true; //Stamp_Action.Start(); } else { Utilities.MessageBox_UpdatePanel(updatepanel1, "Page Refresh or Back button is now allowed"); } } else { Utilities.MessageBox_UpdatePanel(updatepanel1, "Page expired!!! Please re open this page in new window."); } } catch (NullReferenceException ex) { Utilities.MessageBox_UpdatePanel_Redirect(updatepanel1, "Records could not be saved: Please Try Again", Request.Url.AbsoluteUri); } } }