예제 #1
0
        protected void GetWorkshopDetails(string workshopname)
        {
            SqlConnection  con = GetSqlCon.GetCon();
            SqlDataAdapter com = new SqlDataAdapter("GetWorkshopDetails", con);

            com.SelectCommand.CommandType = CommandType.StoredProcedure;
            com.SelectCommand.Parameters.AddWithValue("@param1", workshopname);
            DataTable dtWorkshops = new DataTable();

            com.Fill(dtWorkshops);
            DescOficina.DataSource = dtWorkshops;
            DescOficina.DataBind();

            //rating
            double rating   = Commissions.GetAvgRating(Users.GetWorkshopId(workshopname));
            Label  ratinglb = DescOficina.FindControl("ratinglabel") as Label;

            if (rating == -1)
            {
                ratinglb.Text = "Sem Avaliação";
            }
            else
            {
                ratinglb.Text = rating.ToString() + "/5" + "&#9733";
            }
        }