private void initialData() { if (typeof(writeLog) == ParentForm1.GetType()) { writeLog wl = (writeLog)ParentForm1; shareList = wl.SharedUser; } else if (typeof(writeSchedule) == ParentForm1.GetType()) { writeSchedule ws = (writeSchedule)ParentForm1; shareList = ws.SharedUser; } }
private void save_button_Click(object sender, EventArgs e) { if (typeof(writeLog) == ParentForm1.GetType()) { writeLog wl = (writeLog)ParentForm1; wl.SharedUser = shareList; } else if (typeof(writeSchedule) == ParentForm1.GetType()) { writeSchedule ws = (writeSchedule)ParentForm1; ws.SharedUser = shareList; } MessageBox.Show("保存成功!"); this.Close(); }
//写日程 private void schedule_pictureBox_Click(object sender, EventArgs e) { if (write_schedule == null || write_schedule.IsDisposed) { writeSchedule.ParentFormChange formChangeDelegate = new writeSchedule.ParentFormChange(init_rc_Panel); write_schedule = new writeSchedule(formChangeDelegate); write_schedule.User = this.user; write_schedule.Role = this.role; write_schedule.ScheduleDate = DateTime.Now; } if (!write_schedule.Created) { write_schedule.Show(); } else { write_schedule.WindowState = FormWindowState.Normal; write_schedule.Focus(); } }