void cbb_Level_SelectedIndexChanged(object sender, EventArgs e) { if (uC_HallInfoSeek1.cbb_Theater.SelectedItem == null) { return; } if (uC_HallInfoSeek1.cbb_Hall.SelectedItem == null) { return; } if (uC_HallInfoSeek1.cbb_Level.SelectedItem == null) { return; } SimTheaterInfo sti = (SimTheaterInfo)uC_HallInfoSeek1.cbb_Theater.SelectedItem; string szTheaterId = sti._TheaterId; SimHall sh = (SimHall)uC_HallInfoSeek1.cbb_Hall.SelectedItem; string szHallId = sh._HallId; SimHallLevel shl = (SimHallLevel)uC_HallInfoSeek1.cbb_Level.SelectedItem; string szLevel = shl._LevelId; _editSeatInfo = new SeatMaDll.EditSeatInfo(); _editSeatInfo._szTheaterName = sti._TheaterName; _editSeatInfo._szHallName = sh._HallName; _editSeatInfo._szLevelName = shl._LevelId; List <SeatMaDll.SeatingChart> scList = SeatingChartAction.RetrieveObjListWithBlock(sh._HallId, Convert.ToInt32(shl._LevelId)); uC_HallInfoSeek1.InitSeatingChart(scList); QueryData(); }
public void InitHallWithHallId(string szTheaterId, string szHallId) { cbb_Hall.ResetText(); List <SimHall> list = SimHall.RetrieveItems(szTheaterId); cbb_Hall.DataSource = list; cbb_Hall.SelectedItem = FindHallByHallId(list, szHallId); }
private static SimHall ChangeObj(DataRow dr) { SimHall obj = new SimHall(); obj._HallId = dr["HallId"] == DBNull.Value ? "" : dr["HallId"].ToString(); obj._HallName = dr["HallName"] == DBNull.Value ? "" : dr["HallName"].ToString(); return(obj); }
public override bool Equals(object obj) { if (null == obj) { return(false); } if (obj.GetType() != typeof(SimHall) && !obj.GetType().IsSubclassOf(typeof(SimHall))) { return(false); } SimHall that = (SimHall)obj; return(this._HallId == that._HallId); }
public void InitHall(string szTheaterId) { cbb_Hall.ResetText(); List <SimHall> list = SimHall.RetrieveItems(szTheaterId); cbb_Hall.DataSource = list; if (list.Count > 0) { cbb_Hall.SelectedItem = list[0]; } else { cbb_Hall.SelectedItem = null; } }
public static List <SimHall> RetrieveItems(string szTheaterId) { List <SimHall> list = new List <SimHall>(); DataTable dt = new HallDbo().RetrieveALLItems(szTheaterId); if (dt == null || dt.Rows.Count <= 0) { return(list); } foreach (DataRow dr in dt.Rows) { SimHall obj = ChangeObj(dr); list.Add(obj); } return(list); }
private void SaveData() { if (this.bgwSave.IsBusy) { throw new ApplicationException("系统正在执行数据提交操作,请稍后..."); } if (_editSeatInfo == null) { MessageBox.Show("必须选择一个座位图!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (_seatingChart == null) { MessageBox.Show("必须选择一个座位图!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (uC_HallInfoSeek1.cbb_Theater.SelectedItem == null) { MessageBox.Show("必须选择一个影院!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (uC_HallInfoSeek1.cbb_Hall.SelectedItem == null) { MessageBox.Show("必须选择一个影厅!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (uC_HallInfoSeek1.cbb_Level.SelectedItem == null) { MessageBox.Show("必须选择一个座位图!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } SimTheaterInfo sti = (SimTheaterInfo)uC_HallInfoSeek1.cbb_Theater.SelectedItem; SimHall sh = (SimHall)uC_HallInfoSeek1.cbb_Hall.SelectedItem; SimHallLevel shl = (SimHallLevel)uC_HallInfoSeek1.cbb_Level.SelectedItem; if (seatChartDispScreen1.seatChartDisp1.Controls.Count <= 0) { MessageBox.Show("座位图中没有座位,不能导入保存!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } this.Cursor = Cursors.AppStarting; this.bgwSave.RunWorkerAsync(); }
void cbb_Hall_SelectedIndexChanged(object sender, EventArgs e) { //throw new NotImplementedException(); if (uC_HallInfoSeek1.cbb_Theater.SelectedItem == null) { return; } if (uC_HallInfoSeek1.cbb_Hall.SelectedItem == null) { return; } SimTheaterInfo sti = (SimTheaterInfo)uC_HallInfoSeek1.cbb_Theater.SelectedItem; string szTheaterId = sti._TheaterId; SimHall sh = (SimHall)uC_HallInfoSeek1.cbb_Hall.SelectedItem; string szHallId = sh._HallId; uC_HallInfoSeek1.InitHallLevel(szTheaterId, szHallId); }
public void InitHall(string szTheaterId) { cbb_Hall.ResetText(); cbb_Hall.DataSource = SimHall.RetrieveItems(szTheaterId); cbb_Hall.SelectedItem = null; }
private void SaveData() { if (this.bgwSave.IsBusy) { throw new ApplicationException("系统正在执行数据提交操作,请稍后..."); } if (_editSeatInfo == null) { MessageBox.Show("必须选择一个座位图!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (_seatingChart == null) { MessageBox.Show("必须选择一个座位图!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (uC_HallInfoSeek1.cbb_Theater.SelectedItem == null) { MessageBox.Show("必须选择一个影院!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (uC_HallInfoSeek1.cbb_Hall.SelectedItem == null) { MessageBox.Show("必须选择一个影厅!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (uC_HallInfoSeek1.cbb_Level.SelectedItem == null) { MessageBox.Show("必须选择一个座位图!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } SimTheaterInfo sti = (SimTheaterInfo)uC_HallInfoSeek1.cbb_Theater.SelectedItem; SimHall sh = (SimHall)uC_HallInfoSeek1.cbb_Hall.SelectedItem; SimHallLevel shl = (SimHallLevel)uC_HallInfoSeek1.cbb_Level.SelectedItem; if (_editSeatInfo._szTheaterName != sti._TheaterName) { MessageBox.Show("导入的影院名称与座位图的影院名称不一致!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (_editSeatInfo._szHallName != sh._HallName) { MessageBox.Show("导入的影厅名称与座位图的影厅名称不一致!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (_editSeatInfo._szLevelName != shl._LevelId) { MessageBox.Show("导入的座位图楼层与座位图的楼层不一致!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (seatChartDispScreen1.seatChartDisp1.Controls.Count <= 0) { MessageBox.Show("座位图中没有座位,不能导入保存!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } SeatMaDll.SeatingChart stchTemp = SeatingChartAction.GetSeatingChart(_seatingChart.SeatingChartName); if (stchTemp == null) { stchTemp = BuildSeatingChart(_seatingChart.SeatingChartName); stchTemp.BgColour = _seatingChart.BgColour; stchTemp.Shape = _seatingChart.Shape; _seatingChart = stchTemp; } else { stchTemp.BgColour = _seatingChart.BgColour; stchTemp.Shape = _seatingChart.Shape; _seatingChart = stchTemp; bool bWillUsed = SeatingChartAction.SeatingChartExistWillUsed(_seatingChart.SeatingChartName, DateTime.Now); if (bWillUsed) { MessageBox.Show("座位图正在买票中使用,不能导入保存!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } MessageBoxButtons buttons = MessageBoxButtons.YesNo; DialogResult result = MessageBox.Show("座位图已经存在,是否重新导入?", "系统提示", buttons); if (result == System.Windows.Forms.DialogResult.No) { return; } bool bHaveUsed = SeatingChartAction.SeatingChartExistHaveUsed(_seatingChart.SeatingChartId); if (bHaveUsed) { SeatingChartAction.UpdateActiveFlag(_seatingChart.SeatingChartId, 0); stchTemp = BuildSeatingChart(_seatingChart.SeatingChartName); stchTemp.BgColour = _seatingChart.BgColour; stchTemp.Shape = _seatingChart.Shape; _seatingChart = stchTemp; } else { SeatAction.DeleteBySeatingChartId(_seatingChart.SeatingChartId); } } this.Cursor = Cursors.AppStarting; this.bgwSave.RunWorkerAsync(); }
private bool ImportData(ref string szMsg) { if (uC_HallInfoSeek1.cbb_Theater.SelectedItem == null) { szMsg = "必须选择一个影院!"; return(false); } if (uC_HallInfoSeek1.cbb_Hall.SelectedItem == null) { szMsg = "必须选择一个影厅!"; return(false); } if (uC_HallInfoSeek1.cbb_Level.SelectedItem == null) { szMsg = "必须选择一个楼层!"; return(false); } SimTheaterInfo sti = (SimTheaterInfo)uC_HallInfoSeek1.cbb_Theater.SelectedItem; string szTheaterId = sti._TheaterId; SimHall sh = (SimHall)uC_HallInfoSeek1.cbb_Hall.SelectedItem; string szHallId = sh._HallId; SimHallLevel shl = (SimHallLevel)uC_HallInfoSeek1.cbb_Level.SelectedItem; string szLevel = shl._LevelId; _editSeatInfo = new SeatMaDll.EditSeatInfo(); _editSeatInfo._szTheaterName = sti._TheaterName; _editSeatInfo._szHallName = sh._HallName; _editSeatInfo._szLevelName = shl._LevelId; OpenFileDialog dialog = new OpenFileDialog(); dialog.Title = "请选择包含数据的座位图文件"; dialog.Filter = "座位图文件|*.dat"; string szFileName_Full = ""; //@"c:\Firsite.dat"; if (dialog.ShowDialog(this) == DialogResult.OK) { szFileName_Full = dialog.FileName; if (szFileName_Full.Trim().Length <= 0) { //MessageBox.Show("文件名称不能为空!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); szMsg = "文件名称不能为空!"; return(false); } } if (szFileName_Full.Trim().Length <= 0) { return(false); } //bool bImport = seatChartDispScreen1.seatChartDisp1.ImportItems(szFileName_Full, ref _editSeatInfo, ref szMsg); bool bImport = seatChartDispScreen1.seatChartDisp1.PreImportItems(szFileName_Full, ref _editSeatInfo, ref szMsg); if (!bImport) { return(false); } SetSeatResource(_editSeatInfo._ObjSeatingChart.BgColour); seatChartDispScreen1.seatChartDisp1.ImportSeatChartNew(_editSeatInfo._ObjSeatingChart); _seatingChart = _editSeatInfo._ObjSeatingChart; _seatingChart.SeatingChartName = _editSeatInfo._szSeatingChartName; seatChartDispScreen1.seatChartDisp1.Invalidate(); bool bInUsed = SeatingChartAction.SeatingChartExistWillUsed(_seatingChart.SeatingChartName, DateTime.Now); if (bInUsed) { MessageBox.Show("座位图正在买票中使用,不能导入保存!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } return(bImport); }