public static string getlblDirection(zhhLabel zhhlbl) { string strDirection = ""; if (zhhlbl.BorderTop == System.Drawing.Color.Transparent) { strDirection = "上"; } if (zhhlbl.BorderBottom == System.Drawing.Color.Transparent) { strDirection = "下"; } if (zhhlbl.BorderLeft == System.Drawing.Color.Transparent) { strDirection = "左"; } if (zhhlbl.BorderRight == System.Drawing.Color.Transparent) { strDirection = "右"; } if (zhhlbl.BorderTop == System.Drawing.Color.Black && zhhlbl.BorderBottom == System.Drawing.Color.Black && zhhlbl.BorderLeft == System.Drawing.Color.Black && zhhlbl.BorderRight == System.Drawing.Color.Black) { strDirection = "闭合"; } return(strDirection); }
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 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); } }
public static void SetlblDirection(zhhLabel lbl, string strDirection) { //switch (cmbDirection.Text) switch (strDirection) { 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; case "闭合": lbl.BorderBottom = System.Drawing.Color.Black; lbl.BorderLeft = System.Drawing.Color.Black; lbl.BorderRight = System.Drawing.Color.Black; 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; } }