/// <summary>
        ///根据电影院评分排序查出当地的电影院
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static List <MoviePianChang> search_pianChang_byMovieDate(int m_id, int y_id, DateTime dt)
        {
            List <MoviePianChang> list = new List <MoviePianChang>();

            SqlParameter[] p =
            {
                new SqlParameter("@m_id", m_id),
                new SqlParameter("@y_id", y_id),
                new SqlParameter("@date", dt),
            };
            SqlDataReader sdr = DBHelper.ExecuteReader("search_pianChang_byMovieDate", CommandType.StoredProcedure, p);

            if (sdr.HasRows)
            {
                while (sdr.Read())
                {
                    MoviePianChang mpc = new MoviePianChang();
                    mpc.P_id     = int.Parse(sdr["p_id"].ToString());
                    mpc.M_minute = int.Parse(sdr["m_minute"].ToString());
                    mpc.M_name   = sdr["m_name"].ToString();
                    mpc.M_voice  = sdr["m_voice"].ToString();
                    mpc.T_name   = sdr["t_name"].ToString();
                    mpc.P_time   = Convert.ToDateTime(sdr["p_time"].ToString());
                    mpc.P_price  = Convert.ToDouble(sdr["p_price"]);
                    list.Add(mpc);
                }
            }
            sdr.Close();
            return(list);
        }
Ejemplo n.º 2
0
    void createMoviePianChang(MoviePianChang mpc)
    {
        HtmlGenericControl tr = new HtmlGenericControl("tr");

        if (pdEven)
        {
            tr.Attributes.Add("class", "even");
            pdEven = false;
        }
        else
        {
            pdEven = true;
        }
        HtmlGenericControl td_time = new HtmlGenericControl("td");

        td_time.Attributes.Add("class", "hall-time");

        HtmlGenericControl bold = new HtmlGenericControl("em");

        bold.Attributes.Add("class", "bold");
        bold.InnerText = mpc.P_time.Hour + ":" + mpc.P_time.Minute;
        td_time.Controls.Add(bold);
        DateTime dt = mpc.P_time.AddMinutes(mpc.M_minute);
        Label    lb = new Label();

        lb.Text = "预计" + dt.Hour + ":" + dt.Minute + "散场";
        td_time.Controls.Add(lb);
        tr.Controls.Add(td_time);

        HtmlGenericControl td_name = new HtmlGenericControl("td");

        td_name.Attributes.Add("class", "hall-name");
        td_name.InnerText = mpc.T_name;
        tr.Controls.Add(td_name);

        HtmlGenericControl td_type = new HtmlGenericControl("td");

        td_type.Attributes.Add("class", "hall-type");
        td_type.InnerText = mpc.M_voice;
        tr.Controls.Add(td_type);



        HtmlGenericControl td_price = new HtmlGenericControl("td");

        td_price.Attributes.Add("class", "hall-price");
        td_price.Attributes.Add("data-partcode", "dingxinnew");
        HtmlGenericControl em = new HtmlGenericControl("em");

        em.Attributes.Add("class", "now");
        string str1 = String.Format("{0:F}", mpc.P_price);           //默认为保留两位

        em.InnerText = str1;
        td_price.Controls.Add(em);
        tr.Controls.Add(td_price);


        HtmlGenericControl td_seat = new HtmlGenericControl("td");

        td_seat.Attributes.Add("class", "hall-seat");

        tr.Controls.Add(td_seat);
        HtmlGenericControl a = new HtmlGenericControl("a");

        a.Attributes.Add("class", "seat-btn");
        a.InnerText = "选座购票";
        td_seat.Controls.Add(a);
        t_body.Controls.Add(tr);
    }