private void FrmReportErrorOfLineByHours_Load(object sender, EventArgs e) { try { errors.AddRange(BLLError.GetAll()); lines.AddRange(BLLLine.GetLines(AccountSuccess.strListChuyenId.Split(',').Select(x => Convert.ToInt32(x)).ToList())); if (lines != null && lines.Count > 0) { GetDataForCbbHours(); if (times != null && times.Count > 0) { cbbHours.DataSource = times; cbbHours.DisplayMember = "Name"; GetDataChart(); } } else { MessageBox.Show("Lỗi: Không có thông tin Chuyền", "Thông Báo Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { MessageBox.Show("Lỗi: " + ex.Message, "Thông Báo Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void LoadDataToCbbLine() { try { Floor floor = (Floor)cbbFloor.SelectedItem; if (floor != null) { var listLine = new List <LineModel>(); listLine.Add(new LineModel() { MaChuyen = 0, TenChuyen = "(Chọn chuyền)" }); var listLineInDB = BLLLine.GetLines(floor.IdFloor); //( chuyenDAO.GetListDSChuyenByFloorId(floor.IdFloor.ToString()); if (listLineInDB != null && listLineInDB.Count > 0) { listLine.AddRange(listLineInDB); } cbbLine.DataSource = listLine; cbbLine.DisplayMember = "TenChuyen"; } } catch (Exception ex) { throw ex; } }
private void GetDataForCBLine() { try { if (AccountSuccess.IsOwner) { Floor floor = (Floor)cbFloor2.SelectedItem; cbLine.DataSource = null; if (floor.IdFloor != 0) { var lines = BLLLine.GetLines(AccountSuccess.strListChuyenId.Split(',').Select(x => Convert.ToInt32(x)).ToList(), floor.IdFloor, true); if (lines != null && lines.Count > 0) { cbLine.DataSource = lines; cbLine.DisplayMember = "TenChuyen"; } } } else { cbLine.DataSource = null; var lines = BLLLine.GetLines(AccountSuccess.strListChuyenId.Split(',').Select(x => Convert.ToInt32(x)).ToList(), int.Parse(AccountSuccess.IdFloor), false); if (lines != null && lines.Count > 0) { cbLine.DataSource = lines; cbLine.DisplayMember = "TenChuyen"; } } } catch (Exception ex) { } }
private void LoadDataToGridView() { try { if (AccountSuccess.IsOwner) { Floor floor = (Floor)cbbFloor.SelectedItem; gridControl1.DataSource = null; if (floor.IdFloor != 0) { var lines = BLLLine.GetLines(AccountSuccess.strListChuyenId.Split(',').Select(x => Convert.ToInt32(x)).ToList(), floor.IdFloor, true); if (lines != null && lines.Count > 0) { gridControl1.DataSource = lines; } } } else { gridControl1.DataSource = null; var lines = BLLLine.GetLines(AccountSuccess.strListChuyenId.Split(',').Select(x => Convert.ToInt32(x)).ToList(), int.Parse(AccountSuccess.IdFloor), false); if (lines != null && lines.Count > 0) { gridControl1.DataSource = lines; } } } catch (Exception ex) { throw ex; } }
private void LoadDSChuyen() { cbbChuyen.DataSource = null; cbbChuyen.Text = "(--Chọn Chuyền--)"; if (!string.IsNullOrEmpty(AccountSuccess.strListChuyenId)) { var listChuyenByListId = BLLLine.GetLines(AccountSuccess.strListChuyenId.Split(',').Select(x => Convert.ToInt32(x)).ToList()); if (listChuyenByListId != null && listChuyenByListId.Count > 0) { cbbChuyen.DataSource = listChuyenByListId; cbbChuyen.DisplayMember = "TenChuyen"; } } }
private void GetDataForCbbLine() { try { var listLine = BLLLine.GetLines(AccountSuccess.strListChuyenId.Split(',').Select(x => Convert.ToInt32(x)).ToList());// chuyenDAO.GetListChuyenInfByListId(AccountSuccess.strListChuyenId); if (listLine != null && listLine.Count > 0) { cbbLine.DataSource = listLine; cbbLine.DisplayMember = "TenChuyen"; } } catch (Exception ex) { throw ex; } }
private void FrmResetKeypad_Load(object sender, EventArgs e) { try { var listChuyen = new List <LineModel>(); listChuyen.Add(new LineModel() { MaChuyen = 0, TenChuyen = " - - Chọn Chuyền - - " }); var sbc = BLLLine.GetLines(AccountSuccess.strListChuyenId.Split(',').Select(x => Convert.ToInt32(x)).ToList()); listChuyen.AddRange(sbc); cboChuyen.DataSource = null; cboChuyen.DataSource = listChuyen; cboChuyen.DisplayMember = "TenChuyen"; cboChuyen.SelectedIndex = 0; } catch (Exception) { MessageBox.Show("Không lấy được thông tin chuyền.", "Lỗi"); } }