private void uC_ImageButtonVPanel_Block_ImageButtonItemClick(object sender, EventArgs e) { Label ib = (Label)sender; BlockPriceRich sb = (BlockPriceRich)ib.Tag; _SimBlockObj = sb; DlgCreateBlockPrice dlgCreateBlock = new DlgCreateBlockPrice(this); dlgCreateBlock.Text = "设置区域价格"; dlgCreateBlock.ShowDialog(); if (dlgCreateBlock.DialogResult == DialogResult.OK) { if (dlgCreateBlock._bChange) { int nIndex = uC_HallInfoSeek1.cbb_SeatingChart.SelectedIndex; cbb_Level_SelectedIndexChanged(null, null); //QueryData(); ReQueryDataBy(nIndex); } } else { if (dlgCreateBlock._bChange) { int nIndex = uC_HallInfoSeek1.cbb_SeatingChart.SelectedIndex; cbb_Level_SelectedIndexChanged(null, null); //QueryData(); ReQueryDataBy(nIndex); } } }
public void ReQueryDataBy(int nIndex) { _SimBlockObj = null; uC_ImageButtonVPanel_Block.Clear(); _SimBlockObj = null; if (_seatingChart == null) { return; } List <BlockPriceRich> list = BlockPriceRich.RetrieveObjList(_seatingChart.SeatingChartId, _ShowPlanId); if (list == null || list.Count <= 0) { return; } uC_ImageButtonVPanel_Block.Clear(); List <ImageButtonItem> listImgButton = new List <ImageButtonItem>(); foreach (BlockPriceRich bpr in list) { ImageButtonItem ibi = new ImageButtonItem(); ibi._Img = global::WinFormUI.Properties.Resources.SeatChartFlag; string szSinglePrice = bpr._blockPrice.SinglePrice == 0 ? "无" : bpr._blockPrice.SinglePrice.ToString(); ibi._DisplayText = bpr._block.BlockName + "\r\n价格:" + szSinglePrice; ibi._BackColor = bpr._block.Bgcolour; ibi._objFlag = bpr; listImgButton.Add(ibi); } uC_ImageButtonVPanel_Block.CreateControl(listImgButton); }
private void bt_Delete_Click(object sender, EventArgs e) { if (dgv_Block.SelectedRows == null) { return; } if (dgv_Block.SelectedRows.Count <= 0) { return; } if (dgv_Block.SelectedRows[0].Tag == null) { return; } BlockPriceRich bk = (BlockPriceRich)dgv_Block.SelectedRows[0].Tag; if (bk._blockPrice != null && bk._blockPrice.BlockPriceId.Trim().Length > 0) { bool bR = BlockPrice.DeleteObj(bk._blockPrice); if (bR) { _bChange = true; FillData(); } } }
private void ResetDataToPriceControls(BlockPriceRich bk) { tb_BlockName.Text = bk._block.BlockName; tb_BlockName.Tag = bk; if (bk._block.Bgcolour != 0) { lb_BgColor.BackColor = Color.FromArgb(bk._block.Bgcolour & 0x0000ff, (bk._block.Bgcolour & 0x00ff00) >> 8, (bk._block.Bgcolour & 0xff0000) >> 16); } else { lb_BgColor.BackColor = System.Drawing.Color.Transparent; } tb_SinglePrice.Text = bk._blockPrice.SinglePrice.ToString(); tb_DoublePrice.Text = bk._blockPrice.DoublePrice.ToString(); tb_BoxPrice.Text = bk._blockPrice.BoxPrice.ToString(); tb_StudentPrice.Text = bk._blockPrice.StudentPrice.ToString(); }
private void dgv_Block_SelectionChanged(object sender, EventArgs e) { if (dgv_Block.SelectedRows == null) { return; } if (dgv_Block.SelectedRows.Count <= 0) { return; } if (dgv_Block.SelectedRows[0].Tag == null) { return; } BlockPriceRich bk = (BlockPriceRich)dgv_Block.SelectedRows[0].Tag; ResetDataToPriceControls(bk); }
public static List <BlockPriceRich> RetrieveObjList(string szSeatingChartId, string szShowPlanId) { List <BlockPriceRich> list = new List <BlockPriceRich>(); BlockDbo dbo = new BlockDbo(); DataTable dt = dbo.RetrieveALLItems_Ext(szSeatingChartId, szShowPlanId); if (dt == null || dt.Rows.Count <= 0) { return(list); } foreach (DataRow dr in dt.Rows) { BlockPriceRich bpR = new BlockPriceRich(); bpR._block = Block.ChangeObj(dr); bpR._blockPrice = BlockPrice.ChangeObj(dr); list.Add(bpR); } return(list); }
private void FillData() { dgv_Block.Rows.Clear(); List <BlockPriceRich> list = BlockPriceRich.RetrieveObjList(_frmContainer._seatingChart.SeatingChartId, _frmContainer._ShowPlanId); foreach (BlockPriceRich sb in list) { int nR = this.dgv_Block.Rows.Add(new object[] { sb._block.BlockId, sb._block.BlockName, sb._block.Bgcolour, sb._block.Seats, sb._blockPrice.SinglePrice, sb._blockPrice.DoublePrice, sb._blockPrice.BoxPrice, sb._blockPrice.StudentPrice, sb._block.HasBlockPrice, sb._block.SeatingChartId }); dgv_Block.Rows[nR].Tag = sb; DataGridViewRow row = this.dgv_Block.Rows[nR]; //row.Cells["Bgcolour"] if (sb._block.Bgcolour != 0) { row.DefaultCellStyle.BackColor = Color.FromArgb(sb._block.Bgcolour & 0x0000ff, (sb._block.Bgcolour & 0x00ff00) >> 8, (sb._block.Bgcolour & 0xff0000) >> 16); } if (_frmContainer._SimBlockObj != null) { if (_frmContainer._SimBlockObj._block.BlockId == sb._block.BlockId) { row.Selected = true; ResetDataToPriceControls(sb); } } //dgv_Block.sel } if (_frmContainer._SimBlockObj == null) { dgv_Block.ClearSelection(); } }
public void ClearItems() { uC_ImageButtonVPanel_Block.Clear(); seatChartDispScreen1.seatChartDisp1.ClearItems(); _SimBlockObj = null; }