Exemplo n.º 1
0
        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);
            }
        }