コード例 #1
0
        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);
        }
コード例 #2
0
        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();
            }
        }