Exemple #1
0
        private void buttonEditWorkSystem_Click(object sender, EventArgs e)
        {
            DataRowView view = this.BindingContext[adaWorkSystemDataSet1, "Schedule"].Current as DataRowView;

            ADAWorkSystemDataSet.ScheduleRow row = view.Row as ADAWorkSystemDataSet.ScheduleRow;

            WorkSystemDetailForm f = new WorkSystemDetailForm();

            f.WorkSystemDataSet.Merge(adaWorkSystemDataSet1);

            f.WorkSystemDataSet.DefaultViewManager.DataViewSettings["Schedule"].RowFilter = "ScheduleId=" + row.ScheduleId;

            if (f.ShowDialog() == DialogResult.OK)
            {
                adaWorkSystemDataSet1.Merge(f.WorkSystemDataSet);
                RefreshWorkSystemListView();
            }
        }
Exemple #2
0
        private void buttonAddWorkSystem_Click(object sender, EventArgs e)
        {
            WorkSystemDetailForm f = new WorkSystemDetailForm();

            f.WorkSystemDataSet.Merge(adaWorkSystemDataSet1);

            ADAWorkSystemDataSet.ScheduleRow newScheduleRow = f.WorkSystemDataSet.Schedule.NewScheduleRow();
            newScheduleRow.Name     = "Work System " + (f.WorkSystemDataSet.Schedule.Count + 1);
            newScheduleRow.Type     = (int)ScheduleType.WorkSystemModel;
            newScheduleRow.IsActive = true;
            f.WorkSystemDataSet.Schedule.AddScheduleRow(newScheduleRow);

            f.WorkSystemDataSet.DefaultViewManager.DataViewSettings["Schedule"].RowFilter = "ScheduleId=" + newScheduleRow.ScheduleId;

            if (f.ShowDialog() == DialogResult.OK)
            {
                adaWorkSystemDataSet1.Merge(f.WorkSystemDataSet);
                RefreshWorkSystemListView();
            }
        }