Exemplo n.º 1
0
        }//----------------------------

        //this event is raised when dgvscheduleDetails is double clicked
        private void dgvScheduleDetailsDoubleClick(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                if (!String.IsNullOrEmpty(_sysIdScheduleDetails))
                {
                    using (SubjectScheduleDetailsUpdate frmUpdate = new SubjectScheduleDetailsUpdate(_userInfo, _scheduleManager, _schedInfo,
                                                                                                     _scheduleManager.GetDetailsScheduleInformationDetails(_sysIdScheduleDetails)))
                    {
                        frmUpdate.ShowDialog(this);

                        if (frmUpdate.HasUpdated || frmUpdate.HasDeleted)
                        {
                            _hasUpdatedScheduleDetails = true;

                            Int32 detailsLoaded = 0;

                            this.dgvScheduleDetails.DataSource = _scheduleManager.GetBySysIdScheduleScheduleDetailsTable(_schedInfo.ScheduleSysId,
                                                                                                                         false, ref detailsLoaded);
                            this.dgvMarkDeleted.DataSource = _scheduleManager.GetBySysIdScheduleScheduleDetailsTable(_schedInfo.ScheduleSysId,
                                                                                                                     true, ref detailsLoaded);

                            if (frmUpdate.HasDeleted && !_scheduleManager.HasValidCountOfScheduleDetails(_schedInfo.ScheduleSysId, _schedInfo.IsTeamTeaching))
                            {
                                this.chkIsTeamTeaching.Enabled = true;

                                if (dgvScheduleDetails.Rows.Count > 0 && _schedInfo.IsIrregularModular)
                                {
                                    this.chkIsIrregularModular.Enabled = false;
                                }
                                else if (dgvScheduleDetails.Rows.Count <= 0)
                                {
                                    this.chkIsIrregularModular.Enabled = this.lnkAddDetails.Enabled = true;
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                RemoteClient.ProcStatic.ShowErrorDialog(ex.Message, "Error Loading Subject Schedule Details Module");
            }
            finally
            {
                this.Cursor = Cursors.Arrow;
            }
        }//--------------------------