Esempio n. 1
0
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            DataRowView view = this.BindingContext[adaWorkSystemDataSet1, "Schedule.FK_Activity_Schedule"].Current as DataRowView;

            ADAWorkSystemDataSet.ActivityRow row = view.Row as ADAWorkSystemDataSet.ActivityRow;
            int scheduleId = row.ScheduleId;

            row.Delete();

            DataRow[] rows = adaWorkSystemDataSet1.Activity.Select("ScheduleId = " + scheduleId,
                                                                   "Sequence ASC");

            int i = 1;

            foreach (ADAWorkSystemDataSet.ActivityRow activityRow in rows)
            {
                activityRow.Sequence = i++;
            }
        }