public EditScheduleForm(Schedule schedule) { InitializeComponent(); try { DS_Schedule.DataSource = this.schedule; this.schedule = schedule; buildingQuery = new BuildingQuery(_SERVER.ServerName.Database); sequenceQuery = new SequenceQuery(_SERVER.ServerName.Database); ScheduleQuery = new ScheduleQuery(_SERVER.ServerName.Database); ScheduleLine = PoLine = buildingQuery.GetProductionLines(); DS_Schedule.DataSource = this.schedule; DS_Line.DataSource = ScheduleLine; DS_OriginalPoLine.DataSource = PoLine; var temp1 = buildingQuery.GetProductionLine(schedule.ProductionLine_Id); if (temp1 != null) { comboBox1.SelectedItem = ScheduleLine.Where(i => i.id == temp1.id).First(); } var pos = sequenceQuery.GetOriginalPos(schedule); if (pos != null) { DS_OriginalPo.DataSource = pos; } } catch { } }
private void btnGetPo_Click(object sender, EventArgs e) { if (txtSearchPo.Text == string.Empty) { return; } var pos = sequenceQuery.GetOriginalPos(txtSearchPo.Text); if (pos == null) { return; } DS_OriginalPo.DataSource = pos; }