private void btnSave_Click(object sender, System.EventArgs e) { try { for (int i = 0; i < this.panel1.Controls.Count; i++) { Control ctrl = this.panel1.Controls[i]; ShowSeat seat = new ShowSeat(); seat.cnnJobID = int.Parse(cmbShow.Value.ToString()); seat.cnvcJobName = cmbShow.Text.ToString(); seat.cnnX = ctrl.Location.X; seat.cnnY = ctrl.Location.Y; seat.cnnHeight = ctrl.Height; seat.cnnWidth = ctrl.Width; if (ctrl.Name.StartsWith("lbl")) { //朝向 zhhLabel zhhlbl = this.panel1.Controls[i] as zhhLabel; if (zhhlbl.BorderTop == System.Drawing.Color.Transparent) { seat.cnvcDirection = "上"; } if (zhhlbl.BorderBottom == System.Drawing.Color.Transparent) { seat.cnvcDirection = "下"; } if (zhhlbl.BorderLeft == System.Drawing.Color.Transparent) { seat.cnvcDirection = "左"; } if (zhhlbl.BorderRight == System.Drawing.Color.Transparent) { seat.cnvcDirection = "右"; } //座位号 seat.cnvcSeat = ctrl.Name.Substring(3); } seat.cnvcControlName = ctrl.Name; seat.cnvcFloor = "3"; // if (cmbShow.Text.StartsWith("默认招聘会展位")) // { // seat.cnvcDefaultSeat = "1"; // } JobManage jobManage = new JobManage(); jobManage.AddSeat(seat); } MessageBox.Show(this, "招聘会展位方案设置成功!", "招聘会展位方案设置", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (BusinessException bex) { MessageBox.Show(this, bex.Message, bex.Type, MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (System.Exception ex) { MessageBox.Show(this, ex.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void LoadSeat(Panel pl, string strFloor, string strJobID) { DataTable dtSeat = Helper.Query("select * from tbShowSeat where cnvcFloor='" + strFloor + "' and cnnJobID=" + strJobID); foreach (DataRow drSeat in dtSeat.Rows) { ShowSeat seat = new ShowSeat(drSeat); zhhLabel lbl = new zhhLabel(); lbl.Name = "lbl" + seat.cnvcControlName; lbl.Text = seat.cnvcControlName; //seat.cnvcSeat; if (seat.cnvcControlName.StartsWith("黑")) { lbl.BackColor = Color.Black; } if (seat.cnvcControlName.StartsWith("空")) { lbl.Text = ""; } if (seat.cnvcState == ConstApp.Show_Seat_State_Booking) { lbl.BackColor = Color.Red; } else if (seat.cnvcState == ConstApp.Show_Seat_State_Remain) { lbl.BackColor = Color.Yellow; } else if (seat.cnvcState == ConstApp.Show_Seat_State_SignIn) { lbl.BackColor = Color.Blue; } else if (seat.cnvcState.Length > 0) //== this.oper.cnvcOperName) { lbl.BackColor = Color.Green; } Point p1 = new Point(seat.cnnX, seat.cnnY); lbl.Location = p1; lbl.Height = seat.cnnHeight; lbl.Width = seat.cnnWidth; lbl.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134))); lbl.TextAlign = ContentAlignment.MiddleCenter; lbl.BorderStyle = BorderStyle.None; Helper.SetlblDirection(lbl, seat.cnvcDirection); if (Helper.IsNumber(seat.cnvcControlName)) { lbl.Click += new EventHandler(lbl_Click); } pl.Controls.Add(lbl); } }
private void btnSeat_Click(object sender, System.EventArgs e) { zhhLabel lbl = new zhhLabel(); lbl.Name = "lbl" + txtSeat.Text; lbl.Text = txtSeat.Text; lbl.Width = 30; lbl.Height = 20; lbl.Left = 100; lbl.Top = 100; lbl.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134))); lbl.TextAlign = ContentAlignment.MiddleCenter; lbl.BorderStyle = BorderStyle.None; switch (cmbDirection.Text) { case "上": lbl.BorderBottom = System.Drawing.Color.Black; lbl.BorderLeft = System.Drawing.Color.Black; lbl.BorderRight = System.Drawing.Color.Black; lbl.BorderTop = System.Drawing.Color.Transparent; break; case "下": lbl.BorderBottom = System.Drawing.Color.Transparent; lbl.BorderLeft = System.Drawing.Color.Black; lbl.BorderRight = System.Drawing.Color.Black; lbl.BorderTop = System.Drawing.Color.Black; break; case "左": lbl.BorderBottom = System.Drawing.Color.Black; lbl.BorderLeft = System.Drawing.Color.Transparent; lbl.BorderRight = System.Drawing.Color.Black; lbl.BorderTop = System.Drawing.Color.Black; break; case "右": lbl.BorderBottom = System.Drawing.Color.Black; lbl.BorderLeft = System.Drawing.Color.Black; lbl.BorderRight = System.Drawing.Color.Transparent; lbl.BorderTop = System.Drawing.Color.Black; break; default: lbl.BorderBottom = System.Drawing.Color.Black; lbl.BorderLeft = System.Drawing.Color.Black; lbl.BorderRight = System.Drawing.Color.Black; lbl.BorderTop = System.Drawing.Color.Transparent; break; } lbl.AllowDrop = true; lbl.MouseDown += new System.Windows.Forms.MouseEventHandler(MyMouseDown); lbl.MouseLeave += new System.EventHandler(MyMouseLeave); lbl.MouseMove += new System.Windows.Forms.MouseEventHandler(MyMouseMove); lbl.Click += new EventHandler(lbl_Click); this.panel1.Controls.Add(lbl); }
private void LoadSeat(string strID) { JobManage jobManage = new JobManage(); DataTable dtSeat = jobManage.GetAll2DefaultSeat(strID); foreach (DataRow drSeat in dtSeat.Rows) { ShowSeat seat = new ShowSeat(drSeat); if (seat.cnvcControlName.StartsWith("lbl")) { zhhLabel lbl = new zhhLabel(); lbl.Name = seat.cnvcControlName; lbl.Text = seat.cnvcSeat; Point p1 = new Point(seat.cnnX, seat.cnnY); lbl.Location = p1; lbl.Height = seat.cnnHeight; lbl.Width = seat.cnnWidth; lbl.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134))); lbl.TextAlign = ContentAlignment.MiddleCenter; lbl.BorderStyle = BorderStyle.None; switch (seat.cnvcDirection) { case "上": lbl.BorderBottom = System.Drawing.Color.Black; lbl.BorderLeft = System.Drawing.Color.Black; lbl.BorderRight = System.Drawing.Color.Black; lbl.BorderTop = System.Drawing.Color.Transparent; break; case "下": lbl.BorderBottom = System.Drawing.Color.Transparent; lbl.BorderLeft = System.Drawing.Color.Black; lbl.BorderRight = System.Drawing.Color.Black; lbl.BorderTop = System.Drawing.Color.Black; break; case "左": lbl.BorderBottom = System.Drawing.Color.Black; lbl.BorderLeft = System.Drawing.Color.Transparent; lbl.BorderRight = System.Drawing.Color.Black; lbl.BorderTop = System.Drawing.Color.Black; break; case "右": lbl.BorderBottom = System.Drawing.Color.Black; lbl.BorderLeft = System.Drawing.Color.Black; lbl.BorderRight = System.Drawing.Color.Transparent; lbl.BorderTop = System.Drawing.Color.Black; break; default: lbl.BorderBottom = System.Drawing.Color.Black; lbl.BorderLeft = System.Drawing.Color.Black; lbl.BorderRight = System.Drawing.Color.Black; lbl.BorderTop = System.Drawing.Color.Transparent; break; } lbl.AllowDrop = true; this.panel1.Controls.Add(lbl); } else { Label lbl2 = new Label(); lbl2.Name = seat.cnvcControlName; lbl2.BorderStyle = BorderStyle.FixedSingle; if (seat.cnvcControlName == "dlblEntry") { lbl2.Text = "入口|服务台"; } if (seat.cnvcControlName == "dlblPrint") { lbl2.Text = "文印室|电子显示屏"; } if (seat.cnvcControlName == "dlblSpace1") { } if (seat.cnvcControlName == "dlblSpace2") { } if (seat.cnvcControlName == "dlblStair") { lbl2.Text = "信息处理室|楼梯间"; } if (seat.cnvcControlName == "dlblToilet") { lbl2.Text = "卫生间"; } if (seat.cnvcControlName == "label1") { lbl2.Text = "洗手间"; } if (seat.cnvcControlName == "label2") { lbl2.Text = "出口"; } if (seat.cnvcControlName == "label13") { lbl2.BackColor = Color.Black; } if (seat.cnvcControlName == "label14") { lbl2.BackColor = Color.Black; } if (seat.cnvcControlName == "label15") { lbl2.BackColor = Color.Black; } if (seat.cnvcControlName == "label16") { lbl2.BackColor = Color.Black; } if (seat.cnvcControlName == "label17") { lbl2.BackColor = Color.Black; } Point p2 = new Point(seat.cnnX, seat.cnnY); lbl2.Location = p2; // lbl2.Left = seat.cnnX; // lbl2.Top = seat.cnnY; lbl2.Height = seat.cnnHeight; lbl2.Width = seat.cnnWidth; this.panel1.Controls.Add(lbl2); } } initProperty(); }