예제 #1
0
        /// <summary>
        /// 获得影厅
        /// </summary>
        private void BindFHallChoose(int pageindex)
        {
            DataSet ds = Flamingo.BLL.ShowPlan.GetHallByDailyPlan(dpid, fname, pageindex, 10, out hallItemsCount);

            ltvHallChoose.Items.Clear();
            ltvHallChoose.Columns.Clear();
            if (ds.Tables[ds.Tables.Count - 1].Rows.Count > 0)
            {
                ltvHallChoose.Columns.Add("影厅选择", 80, HorizontalAlignment.Center);
                ltvHallChoose.View = View.LargeIcon;

                //日期图片保存地址
                string path  = "images/imgs/";
                string ppath = "";
                //日期图片底板地址
                string bpath = "images/imgs/dailyplandate.jpg";
                Flamingo.Common.Draw draw = new Flamingo.Common.Draw();

                imgltHallChoose.Images.Clear();
                ltvHallChoose.LargeImageList = imgltHallChoose;
                foreach (DataRow row in ds.Tables[ds.Tables.Count - 1].Rows)
                {
                    ListViewItem item = new ListViewItem();
                    item.Name = row["HallID"].ToString().Trim();
                    try
                    {
                        //生成厅图片
                        ppath = path + row["HallName"].ToString().Trim() + ".jpg";
                        if (!File.Exists(ppath))
                        {
                            draw.CreateImage(row["HallName"].ToString().Trim(), ppath, bpath);
                            draw.CreateImage(row["HallName"].ToString().Trim(), ppath.Replace(".", "_."), bpath.Replace(".", "_."));
                        }
                        imgltHallChoose.Images.Add(item.Name, Image.FromFile(ppath));
                        imgltHallChoose.Images.Add(item.Name + "_", Image.FromFile(ppath.Replace(".", "_.")));
                        item.ImageKey = item.Name;
                    }
                    catch
                    {
                        item.Text = item.Text = row["HallName"].ToString().Trim();
                    }

                    ltvHallChoose.Items.Add(item);
                }
                ltvHallChoose.Items[0].Selected = true;
                hallCurrentIndex = pageindex;
            }
        }
예제 #2
0
        /// <summary>
        /// 场次选择
        /// </summary>
        /// <param name="dailyplanid">日计划ID</param>
        /// <param name="filmid">影片ID</param>
        /// <param name="hallid">影厅ID</param>
        private void BindShowChoose(int pageindex)
        {
            DataSet ds = Flamingo.BLL.ShowPlan.GetShowPlan(dpid, fname, hid, pageindex, 10, out showtotalcount);

            ltvShowChoose.Items.Clear();
            ltvShowChoose.Columns.Clear();
            if (ds.Tables[0].Rows.Count > 0)
            {
                ltvShowChoose.Columns.Add("场次选择", 80, HorizontalAlignment.Center);
                ltvShowChoose.View = View.LargeIcon;

                //日期图片保存地址
                string path  = "images/imgs/showplan/";
                string ppath = "";
                //日期图片底板地址
                string bpath = "images/imgs/dailyplandate.jpg";
                Flamingo.Common.Draw draw = new Flamingo.Common.Draw();

                imgltShowChoose.Images.Clear();
                ltvShowChoose.LargeImageList = imgltShowChoose;

                string imgname = string.Empty;
                foreach (DataRow row in ds.Tables[ds.Tables.Count - 1].Rows)
                {
                    ListViewItem item = new ListViewItem();

                    item.Name = row["ShowPlanID"].ToString().Trim();
                    item.Tag  = row["ShowPlanTime"].ToString();
                    try
                    {
                        //生成场次图片
                        imgname = row["ShowPlanTime"].ToString().Trim().Replace(":", "");
                        ppath   = path + imgname + ".jpg";
                        if (!File.Exists(ppath))
                        {
                            draw.CreateImage(row["ShowPlanTime"].ToString().Trim(), ppath, bpath);
                        }
                        imgltShowChoose.Images.Add(item.Name, Image.FromFile(ppath));
                        item.ImageKey = item.Name;
                    }
                    catch
                    {
                        item.Text = item.Text = row["ShowPlanTime"].ToString().Trim();
                    }
                    ltvShowChoose.Items.Add(item);
                }
                //ltvShowChoose.Items[0].Selected = true;
                showcurrentindex = pageindex;
            }
        }
예제 #3
0
        /// <summary>
        /// 获取时间选择
        /// </summary>
        private int BindDateChoose(int pageindex)
        {
            int totalpage = 0;

            try
            {
                DataSet ds = Flamingo.BLL.DailyPlan.GetDateChoose(pageindex, 10, out totalpage);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    ltvDateChoose.Items.Clear();
                    ltvDateChoose.Columns.Clear();
                    ltvDateChoose.Columns.Add("时间选择", 100, HorizontalAlignment.Center);
                    ltvDateChoose.View = View.LargeIcon;

                    //日期图片保存地址
                    string path  = "images/imgs/";
                    string ppath = "";
                    //日期图片底板地址
                    string bpath = "images/imgs/dailyplandate.jpg";
                    Flamingo.Common.Draw draw = new Flamingo.Common.Draw();

                    imgltDateChoose.Images.Clear();
                    ltvDateChoose.LargeImageList = imgltDateChoose;
                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        ListViewItem item = new ListViewItem();
                        item.Name = row["DailyPlanId"].ToString().Trim();
                        item.Tag  = (object)DateTime.Parse(row["PlanDate"].ToString()).ToString("MM月dd日");

                        try
                        {
                            //生成日期图片
                            ppath = path + DateTime.Parse(row["PlanDate"].ToString()).ToString("MMdd") + ".jpg";
                            if (!File.Exists(ppath))
                            {
                                draw.CreateImage(DateTime.Parse(row["PlanDate"].ToString()).ToString("MM月dd日"), ppath, bpath);
                                draw.CreateImage(DateTime.Parse(row["PlanDate"].ToString()).ToString("MM月dd日"), ppath.Replace(".", "_."), bpath.Replace(".", "_."));
                            }
                            imgltDateChoose.Images.Add(item.Name, Image.FromFile(ppath));
                            imgltDateChoose.Images.Add(item.Name + "_", Image.FromFile(ppath.Replace(".", "_.")));
                            item.ImageKey = item.Name;
                        }
                        catch
                        {
                            item.Text = DateTime.Parse(row["PlanDate"].ToString()).ToString("MM月dd日");
                        }
                        ltvDateChoose.Items.Add(item);
                    }

                    ltvDateChoose.Items[0].Selected = true;
                    dpid   = ltvDateChoose.Items[0].Name;
                    dpdate = ltvDateChoose.Items[0].Tag.ToString();
                    ltvDateChoose.Items[0].ImageKey = dpid + "_";

                    ////获取影片选择
                    BindFilmChoose(1);

                    ////获取影厅选择
                    BindFHallChoose(1);

                    ////获取场次选择
                    BindShowChoose(1);
                }
                else
                {
                    //MessageBox.Show("没有可用日计划");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("获取日计划失败!" + ex.Message);
            }
            return(totalpage);
        }