private void btnCancel_Click(object sender, System.EventArgs e) { try { if (this.ultraGrid1.ActiveRow.Cells["状态"].Value.ToString() != "预留") { throw new BusinessException("展位预订设置", "此展位不在预留状态,无法取消预留!"); } ShowSeat seat = new ShowSeat(); seat.cnnJobID = int.Parse(cmbShow.SelectedItem.DataValue.ToString()); seat.cnvcSeat = this.ultraGrid1.ActiveRow.Cells["展位"].Value.ToString(); JobManage jobManage = new JobManage(); jobManage.CancelLeaveSeat(seat); BindSeat(); 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 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) { string strSql = "select a.*,c.cnvcMemberCardNo,c.cnvcPaperNo,c.cnvcMemberName,c.cnvcFree from tbShowSeat a " + " left outer join tbMemberSeat b on a.cnnJobID=b.cnnID " + " and a.cnvcSeat=b.cnvcSeat and a.cnvcFloor=b.cnvcFloor " //+" and b.cnvcState = '"+ConstApp.Show_Seat_State_Booking+"'" + " left outer join tbMember c on b.cnvcMemberCardNo=c.cnvcMemberCardNo " + " where a.cnvcFloor='" + strFloor + "' and a.cnnJobID=" + strJobID; DataTable dtSeat = Helper.Query(strSql); //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 = ""; } else if (seat.cnvcState.Length > 1) { lbl.BackColor = Color.Red; } 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)) { if (seat.cnvcState == "") { lbl.Click += new EventHandler(lbl_Click); } else { lbl.Click += new EventHandler(lblUse_Click); } } pl.Controls.Add(lbl); } }
private void btnHold_Click(object sender, System.EventArgs e) { //占位 try { if (txtSeat.Text == "") { throw new BusinessException("展位预留", "请选择展位"); } if (txtSeat.Tag == null || txtSeat.Tag.ToString() == "") { throw new BusinessException("展位预留", "请选择展位"); } if (null == cmbShow.SelectedItem) { throw new BusinessException("展位预留", "请选择招聘会"); } if (null == cmbFloor.SelectedItem) { throw new BusinessException("展位预留", "请选择展位大厅"); } ShowSeat seat = new ShowSeat(); seat.cnvcSeat = txtSeat.Text; seat.cnnJobID = int.Parse(cmbShow.SelectedItem.DataValue.ToString()); seat.cnvcFloor = cmbFloor.SelectedItem.DataValue.ToString(); seat.cnvcOperName = this.oper.cnvcOperName; seat.cndOperDate = DateTime.Now; DataTable dtSeat = Helper.Query("select * from tbShowSeat where cnnJobID=" + seat.cnnJobID + " and cnvcState='" + seat.cnvcOperName + "'"); if (dtSeat.Rows.Count > 0) { ShowSeat oldSeat = new ShowSeat(dtSeat); throw new BusinessException("展位预留", "你已经占了一个位置,不能再占了。你占的位置是:" + oldSeat.cnvcSeat); } JobManage jm = new JobManage(); jm.HoldSeat(seat); MessageBox.Show(this, "占位成功", "展位预留", MessageBoxButtons.OK, MessageBoxIcon.Information); //LoadPanel(); this.btnLoadSeat_Click(null, null); } 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 btnRemain_Click(object sender, System.EventArgs e) { try { if (txtSeat.Text == "") { throw new BusinessException("展位预留", "请选择展位"); } if (txtSeat.Tag == null || txtSeat.Tag.ToString() == "") { throw new BusinessException("展位预留", "请选择展位"); } if (null == cmbShow.SelectedItem) { throw new BusinessException("展位预留", "请选择招聘会"); } if (null == cmbFloor.SelectedItem) { throw new BusinessException("展位预留", "请选择展位大厅"); } ShowSeat seat = new ShowSeat(); seat.cnnJobID = int.Parse(cmbShow.SelectedItem.DataValue.ToString()); seat.cnvcJobName = cmbShow.SelectedItem.DisplayText; seat.cnvcSeat = txtSeat.Text; seat.cnvcFloor = cmbFloor.SelectedItem.DataValue.ToString(); seat.cnvcState = ConstApp.Show_Seat_State_Remain; seat.cnvcOperName = this.oper.cnvcOperName; seat.cndOperDate = DateTime.Now; JobManage jobManage = new JobManage(); jobManage.SeatRemain(seat); MessageBox.Show(this, "展位预留成功!", "展位预留", MessageBoxButtons.OK, MessageBoxIcon.Information); LoadPanel(); } 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(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(); }