protected void Rating1_Changed(object sender, AjaxControlToolkit.RatingEventArgs e) { rating = e.Value.ToString(); if (rating == null) { rating = "1"; } AjaxControlToolkit.Rating _rating = (AjaxControlToolkit.Rating)sender; DataListItem item = (DataListItem)_rating.NamingContainer; if (item != null) { idd = (string)DataList1.DataKeys[item.ItemIndex]; } SqlConnection scon = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString); scon.Open(); String chkpas = "******" + idd + "'"; SqlCommand com2 = new SqlCommand(chkpas, scon); pname = com2.ExecuteScalar().ToString(); String query = "insert into [Table3](Id,Product_name,Rating) values('" + idd + "','" + pname + "'," + Convert.ToInt16(rating.ToString()) + ")"; SqlCommand cmd = new SqlCommand(); cmd.CommandText = query; cmd.Connection = scon; cmd.ExecuteNonQuery(); System.Diagnostics.Debug.WriteLine(idd); scon.Close(); }
protected void RatingControlChanged(object sender, AjaxControlToolkit.RatingEventArgs e) { con.Open(); SqlCommand cmd = new SqlCommand("insert into RatingDetails(Rate)values(@Rating)", con); cmd.Parameters.AddWithValue("@Rating", ratingControl.CurrentRating); cmd.ExecuteNonQuery(); con.Close(); BindRatingControl(); }
//-----------------------Rating code------------------------------// protected void RatingControlChanged(object sender, AjaxControlToolkit.RatingEventArgs e) { string MaSanPham = Request.QueryString["MaSanPham"].ToString(); SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["WebBanDTConnectionString"].ConnectionString); con.Open(); SqlCommand cmd = new SqlCommand("insert into RatingDetails(Rate, MaSanPham)values(@Rating, '" + MaSanPham + "')", con); cmd.Parameters.AddWithValue("@Rating", ratingControl.CurrentRating); cmd.ExecuteNonQuery(); con.Close(); BindRatingControl(); }
protected void SupplementRating_Changed(object sender, AjaxControlToolkit.RatingEventArgs e) { // Needed for the workaround with AjaxToolkit bug if (this.isFired) { return; } else { isFired = true; //this.CheckIfLoggedIn(); } }
public void ajaxType1JamRating_Changed(object sender, AjaxControlToolkit.RatingEventArgs e) { var myShow = GetMyShow(hdnMyShowId.Value); if (myShow == null) { return; } using (IUnitOfWork uow = UnitOfWork.Begin()) { myShow.Type1JamRating = int.Parse(e.Value); uow.Commit(); } }
protected void Rating1_Changed(object sender, AjaxControlToolkit.RatingEventArgs e) { // Store the new rating to a cookie. Inform the user of successful // rating or any error. try { // You may also persist the rating value in a // database at this point. SetRatingToCookie(e.Value); e.CallbackResult = "Got your " + e.Value + "! Thank you."; } catch (Exception ex) { e.CallbackResult = "The following error occurred: " + ex.Message + ". Please try again"; } }
public void ajaxSongRating_Changed(object sender, AjaxControlToolkit.RatingEventArgs e) { ResetPanels(); var setSongId = new Guid(e.Tag); var userId = new Guid(Membership.GetUser(User.Identity.Name).ProviderUserKey.ToString()); var rating = (int?)int.Parse(e.Value); var analysisService = new AnalysisService(Ioc.GetInstance <IAnalysisRepository>()); var analysis = analysisService.GetAnalysisBySetSongAndUser(setSongId, userId).SingleOrDefault(); if (analysis != null) { using (IUnitOfWork uow = UnitOfWork.Begin()) { analysis.Rating = rating; uow.Commit(); } } else { Guid?myShowId = null; if (!string.IsNullOrEmpty(hdnMyShowId.Value)) { myShowId = new Guid(hdnMyShowId.Value); } Analysis newAnalysis = new Analysis { AnalysisId = Guid.NewGuid(), CreatedDate = DateTime.Now, MyShowId = myShowId, Rating = rating, SetSongId = setSongId, UserId = userId }; bool success = false; analysisService.SaveCommit(newAnalysis, out success); } }
//protected void Button2_Click(object sender, EventArgs e) //{ // if (TextBox1.Text != "") // { // DataList1.DataSourceID = null; // DataList1.DataSource = SqlDataSource5; // DataList1.DataBind(); // } // } protected void Rating1_Changed(object sender, AjaxControlToolkit.RatingEventArgs e) { rating = e.Value.ToString(); }
protected void Rating1_Click(object sender, AjaxControlToolkit.RatingEventArgs e) { }
protected void Rating1_Changed(object sender, AjaxControlToolkit.RatingEventArgs e) { Label1.Text = e.Value; }
protected void LikeRating_Changed(object sender, AjaxControlToolkit.RatingEventArgs e) { }
protected void Rating1_Changed(object sender, AjaxControlToolkit.RatingEventArgs e) { lbl_rating.Text = Rating1.CurrentRating.ToString(); }
protected override void OnChanged(AjaxControlToolkit.RatingEventArgs e) { base.OnChanged(e); this.CurrentRating = int.Parse(e.Value); }
protected void RatingRate_Changed(object sender, AjaxControlToolkit.RatingEventArgs e) { System.Threading.Thread.Sleep(300); //TODO: Save e.Value to database. e.CallbackResult = "success"; }
protected void Rating1_Changed(object sender, AjaxControlToolkit.RatingEventArgs e) { lit_Rating.Text = "You rated " + Rating1.CurrentRating.ToString() + "/" + Rating1.MaxRating.ToString() + ". Thank you."; }
protected void likerating_changed(Object sender, AjaxControlToolkit.RatingEventArgs e) { e.CallbackResult = "Upadatedone.Value=" + e.Value + "Tag= " + e.Tag; }