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 { } }
public PoInfo(IDbName _database, Schedule _schedule) { BuildingQuery buildingQuery = new BuildingQuery(_database); id = _schedule.id; PoNumber = _schedule.PoNumber; Model = _schedule.Model; Article = _schedule.Article; ModelName = _schedule.ModelName; Quantity = _schedule.Quantity != null ? (int)_schedule.Quantity : 0; Line = buildingQuery.GetProductionLine(ShareFuncs.GetInt(_schedule.ProductionLine_Id)).LineName; }
private void GetSelectedSchedule() { if (lbSchedule.SelectedItem == null) { return; } SelectedSchedule = lbSchedule.SelectedItem as Schedule; SelectedProductionLine = BuildingQuery.GetProductionLine(ShareFuncs.GetInt(SelectedSchedule.ProductionLine_Id)); txtProductionLine.Text = SelectedProductionLine.LineName; UpdateOgiginalSequence(); }
public SequenceCtrl(Schedule _schedule, bool _displayHeader) { InitializeComponent(); header = _displayHeader; Schedule = new Schedule(); if (Schedule != null) { Schedule = ScheduleQuery.GetSchedule(_schedule.id); ds_schedule.DataSource = Schedule; var ProductionLine = BuildingQuery.GetProductionLine(ShareFuncs.GetInt(Schedule.ProductionLine_Id)); txProductionLine.Text = ProductionLine.LineName; txtUpdateTime.Text = Schedule.ScheduleClass.LastModified.ToString("hh::mm: tt, dd/MM/yyyy"); } OriginalPo = new OriginalPO(); Draw(); }
private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { try { if (listBox1.SelectedItem == null) { return; } var currentPo = listBox1.SelectedItem as OriginalPO; var temp1 = buildingQuery.GetProductionLine(currentPo.ProductionLine_Id); if (temp1 != null) { comboBox2.SelectedItem = PoLine.Where(i => i.id == temp1.id).First(); } } catch { } }
public BeamInterface(BeamCutInterface BInterface, int place) { InitializeComponent(); try { lbStartTime.Text = BInterface.StartCutTime.ToString(); lbStopTime.Text = BInterface.StopCutTime.ToString(); BeamCutQuery beamCutQuery = new BeamCutQuery(_SERVER.ServerName.Database); ScheduleQuery scheduleQuery = new ScheduleQuery(_SERVER.ServerName.Database); SequenceQuery sequenceQuery = new SequenceQuery(_SERVER.ServerName.Database); BuildingQuery buildingQuery = new BuildingQuery(_SERVER.ServerName.Database); var clone_po = beamCutQuery.GetBeamCutPo(BInterface.BeamCutPo_Id); lbTotalPoCutQty.Text = clone_po.CuttingQuantity.ToString(); lbComponent.Text = clone_po.ComponentRef; var po = sequenceQuery.GetOriginalPo(ShareFuncs.GetInt(BInterface.OriginalPo_Id)); var schedule = scheduleQuery.GetSchedule(ShareFuncs.GetInt(BInterface.Schedule_Id)); if (schedule == null) { if (po != null) { schedule = scheduleQuery.GetSchedule(po); } if (schedule == null) { this.Hide(); Error = true; return; } } lbPlace.Text = place.ToString(); DS_Interface.DataSource = BInterface; DS_Po.DataSource = schedule; lbLine.Text = buildingQuery.GetProductionLine(ShareFuncs.GetInt(schedule.ProductionLine_Id)).LineName; } catch { this.Hide(); Error = true; return; } }
private void UpdateSelectedSchedule() { SelectedOriginalPo = new OriginalPO(); SelectedSchedule = new Schedule(); SelectedSequence = new OriginalPOsequence(); SelectedScheduleLine = string.Empty; txtProductionLine.Text = string.Empty; if (lbSchedule.SelectedItem == null) { return; } SelectedSchedule = ScheduleQuery.GetSchedule((lbSchedule.SelectedItem as Schedule).id); SelectedProductionLine = BuildingQuery.GetProductionLine(ShareFuncs.GetInt(SelectedSchedule.ProductionLine_Id)); txtProductionLine.Text = SelectedScheduleLine = SelectedProductionLine.LineName; UpdateModelComponent(); UpdateOgiginalSequence(); }