private void RatingImage_OnSelect(object sender, System.EventArgs e) { RatingImage ratingimage = (RatingImage)sender; var vm = (ItemDetailsPageViewModel)BindingContext; vm.Value = ratingimage.Value; }
public void GetNota(object sender, EventArgs e) { RatingImage NrStele = (RatingImage)sender; int Nota = NrStele.Nota; con.Open(); string Profilname = Request.QueryString["Nume"]; SqlCommand cmd = new SqlCommand("insert into Reviewuri (ProfesorId,Nota,UserId) values(" + GetUserId(Profilname) + "," + Nota + "," + GetUserId(username) + ")", con); cmd.ExecuteNonQuery(); con.Close(); Response.Redirect(Request.RawUrl); }
public void GetNota(object sender, EventArgs e) { RatingImage NrStele = (RatingImage)sender; int Nota = NrStele.Nota; SqlConnection con = DbConnection.GetSqlConnection(); con.Open(); int CursId = GetIdCurs(con); SqlCommand cmd = new SqlCommand("insert into Reviewuri (CursId,Nota,UserId) values(" + CursId + "," + Nota + "," + GetUserId(GetUsername()) + ")", con); System.Diagnostics.Debug.WriteLine(cmd.CommandText); cmd.ExecuteNonQuery(); con.Close(); Response.Redirect(Request.RawUrl); }
public void LoadRating() { Literal text = new Literal(); text.Text = "Nota<br />"; PanelRating.Controls.Add(text); for (int index = 1; index <= 5; index++) { RatingImage ratingimg = new RatingImage("~/Images/steaalba.png"); ratingimg.Nota = index; ratingimg.ID = index.ToString(); ratingimg.Attributes.Add("onmouseout", "ClearRating()"); ratingimg.Attributes.Add("onmouseover", "change" + index + "()"); ratingimg.Click += new ImageClickEventHandler(GetNota); PanelRating.Controls.Add(ratingimg); } }
private void Rating_OnSelect(object sender, EventArgs e) { RatingImage ratingImage = (RatingImage)sender; MC.MovieDet.Rating = (int)Rating.Value; MC.MovieDet.DateView = DateTime.Now; Movie MO = new Movie(MC.MovieDet); int NUpdRec = DB.UpdateMovieAsync(MO).Result; if (PY.WebApiAddress != "" && PY.WebApiAddress != null) { var WS = new WebApi(PY.WebApiAddress); WS.SetRatingWS(MC.MovieDet.ID, (int)MC.MovieDet.Rating).Wait(); DependencyService.Get <IMessage>().ShortAlert(AppResources.MessageRatingSaved); } else if (NUpdRec > 0) { DependencyService.Get <IMessage>().ShortAlert(AppResources.MessageRatingSaved); } }