void pc_Click(object sender, EventArgs e) { if (this.loaded) { RoomPlanShowPanel ctr = sender as RoomPlanShowPanel; RoomPlanObject roomPlan = ctr.Tag as RoomPlanObject; GlobalTools.GoPanel(new MovieSeatSelectorPanel(roomPlan, movie, moviePlan, planDt)); } //MessageBoxHelper.Show("准备选座!"); //throw new NotImplementedException(); }
private void SetMoviePlan(MoviePlanObject plan) { this.moviePlan = plan; for (int i = this.panelContent.Controls.Count-1; i >=0 ; i--) { Control ctr = this.panelContent.Controls[i]; if (ctr.Name == "picNoPlanHint") { WindowFormDelegate.RemoveControlFrom(this.panelContent, ctr); } else if (ctr is RoomPlanShowPanel) { // //this.panelContent.Controls.Remove(ctr); WindowFormDelegate.RemoveControlFrom(this.panelContent, ctr); } //this.picNoPlanHint.Visible = false; } if (plan == null) { // 274, 257 PictureBox pic = new PictureBox(); pic.Name = "picNoPlanHint"; pic.BackgroundImage = Properties.Resources.BuyTick_No_Plan; pic.Width = 745; pic.Height = 374; pic.Location = new Point(274, 257); //this.panelContent.Controls.Clear(); WindowFormDelegate.AddControlTo(this.panelContent, pic); // this.panelContent.Controls.Add(pic); //this..Visible = true; return; } if (movie.OtherName.Length>0) { this.lbOtherName.Visible = false; } else { this.lbOtherName.Visible = true; if(plan.Type.Length>0) this.lbOtherName.Text = movie.OtherName + "(" + plan.Type + ")"; } this.lbLanguage.Text = string.Format("语言:{0}", plan.Language); this.lbLanguage.ForeColor = Color.FromArgb(85, 85, 85); List<RoomPlanObject> lists=plan.RoomPlans; if (lists != null && lists.Count > 0) { //this.panelContent.Controls.Clear(); int x = 57; int y = 274; int linecount = 5; int picWid = 195; int picHeight = 88; int colSep = 14; int rowSep = 14; int controlCount = 0; bool isToday=this.planDt.Day==System.DateTime.Now.Day; int hourNow=System.DateTime.Now.Hour; int minuteNow=System.DateTime.Now.Minute+5; for (int i = 0; i < lists.Count; i++) { try { string tttt = lists[i].Playtime; string[] times = tttt.Split(':'); int hour = Convert.ToInt32(times[0]); int minute = Convert.ToInt32(times[1]); if (isToday && (hour == hourNow && minute < minuteNow)) { continue; } } catch(Exception ex) { GlobalTools.Log(ex); } RoomPlanShowPanel pc = new RoomPlanShowPanel(lists[i]); pc.AutoScaleMode = AutoScaleMode.None; pc.Width = picWid; pc.Height = picHeight; pc.Tag = lists[i]; pc.Location = new Point(x + (controlCount % linecount) * (picWid + colSep), y + (controlCount / linecount) * (picHeight + rowSep)); pc.Click += new EventHandler(pc_Click); //this.panelContent.Controls.Add(pc); WindowFormDelegate.AddControlTo(this.panelContent, pc); controlCount++; } } }
private void SetMoviePlan(MoviePlanObject plan) { this.moviePlan = plan; for (int i = this.panelContent.Controls.Count - 1; i >= 0; i--) { Control ctr = this.panelContent.Controls[i]; if (ctr.Name == "picNoPlanHint") { WindowFormDelegate.RemoveControlFrom(this.panelContent, ctr); } else if (ctr is RoomPlanShowPanel) { // //this.panelContent.Controls.Remove(ctr); WindowFormDelegate.RemoveControlFrom(this.panelContent, ctr); } //this.picNoPlanHint.Visible = false; } if (plan == null) { // 274, 257 PictureBox pic = new PictureBox(); pic.Name = "picNoPlanHint"; pic.BackgroundImage = Properties.Resources.BuyTick_No_Plan; pic.Width = 745; pic.Height = 374; pic.Location = new Point(274, 257); //this.panelContent.Controls.Clear(); WindowFormDelegate.AddControlTo(this.panelContent, pic); // this.panelContent.Controls.Add(pic); //this..Visible = true; return; } if (movie.OtherName.Length > 0) { this.lbOtherName.Visible = false; } else { this.lbOtherName.Visible = true; if (plan.Type.Length > 0) { this.lbOtherName.Text = movie.OtherName + "(" + plan.Type + ")"; } } this.lbLanguage.Text = string.Format("语言:{0}", plan.Language); this.lbLanguage.ForeColor = Color.FromArgb(85, 85, 85); List <RoomPlanObject> lists = plan.RoomPlans; if (lists != null && lists.Count > 0) { //this.panelContent.Controls.Clear(); int x = 57; int y = 274; int linecount = 5; int picWid = 195; int picHeight = 88; int colSep = 14; int rowSep = 14; int controlCount = 0; bool isToday = this.planDt.Day == System.DateTime.Now.Day; int hourNow = System.DateTime.Now.Hour; int minuteNow = System.DateTime.Now.Minute + 5; for (int i = 0; i < lists.Count; i++) { try { string tttt = lists[i].Playtime; string[] times = tttt.Split(':'); int hour = Convert.ToInt32(times[0]); int minute = Convert.ToInt32(times[1]); if (isToday && (hour == hourNow && minute < minuteNow)) { continue; } } catch (Exception ex) { GlobalTools.Log(ex); } RoomPlanShowPanel pc = new RoomPlanShowPanel(lists[i]); pc.AutoScaleMode = AutoScaleMode.None; pc.Width = picWid; pc.Height = picHeight; pc.Tag = lists[i]; pc.Location = new Point(x + (controlCount % linecount) * (picWid + colSep), y + (controlCount / linecount) * (picHeight + rowSep)); pc.Click += new EventHandler(pc_Click); //this.panelContent.Controls.Add(pc); WindowFormDelegate.AddControlTo(this.panelContent, pc); controlCount++; } } }