/// <summary> /// 载入按钮点击; /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_Load_Click(object sender, EventArgs e) { this._Course = CourseRepository.Find("2060316"); this.txb_CourseDescription.Text = this._Course.Description; this.LoadCourseAppraisalType(); this.LoadAppraisalForm(); }
/// <summary> /// 载入按钮点击; /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_Load_Click(object sender, EventArgs e) { this._Course = CourseRepository.Find("2060316"); this.txb_CourseNumber.Text = this._Course.Number; this.txb_CourseName.Text = this._Course.Name; this.txb_CourseCredit.Text = this._Course.Credit.ToString(); this.txb_CourseDescription.Text = this._Course.Description; }
/// <summary> /// 载入按钮点击; /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_Load_Click(object sender, EventArgs e) { this._Course = CourseRepository.Find("2060316"); this.txb_CourseDescription.Text = this._Course.Description; this.ckb_IsAvailable.Checked = this._Course.IsAvailable; //多选按钮的选中状态与逻辑类型的变量对应; this.ckb_HasExperiment.Checked = this._Course.HasExperiment; this.ckb_HasMooc.Checked = this._Course.HasMooc; }
/// <summary> /// 载入按钮点击; /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_Load_Click(object sender, EventArgs e) { this._Course = CourseRepository.Find("2060316"); this.txb_CourseDescription.Text = this._Course.Description; this.nud_CourseCredit.Minimum = CourseService.MinCredit; //设置数值增减框的最小值; this.nud_CourseCredit.Maximum = CourseService.MaxCredit; //设置数值增减框的最大值; this.nud_CourseCredit.Value = this._Course.Credit; //访问数值增减框的值; }
/// <summary> /// 载入按钮点击; /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_Load_Click(object sender, EventArgs e) { this._Course = CourseRepository.Find("2060316"); this.txb_CourseDescription.Text = this._Course.Description; this.lbl_CourseHourDistribution.Text = this._Course.CourseHourDistribution; this.tkb_TheoreticalHour.Minimum = 0; //设置滑动条最小值; this.tkb_TheoreticalHour.Maximum = this._Course.TotalHour; //设置滑动条最大值; this.tkb_TheoreticalHour.SmallChange = 1; //设置滑动条滚动1段刻度所改变的值; this.tkb_TheoreticalHour.TickFrequency = this._Course.TotalHour / 8; //设置滑动条刻度数量; this.tkb_TheoreticalHour.Value = this._Course.TheoreticalHour; //设置滑动条的值; }
/// <summary> /// 载入按钮点击; /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_Load_Click(object sender, EventArgs e) { this._Course = CourseRepository.Find("2060316"); this.txb_CourseDescription.Text = this._Course.Description; this.rdb_IsProfessional.Checked = //单选按钮被选中后,同一分组框中的其它单选按钮将不会被选中; (this.rdb_IsProfessional.Text == this._Course.Type); //根据单选按钮的文本与对象属性值是否一致,设置单选按钮是否被选中; this.rdb_IsPublic.Checked = (this.rdb_IsPublic.Text == this._Course.Type); this.rdb_IsCompulsory.Checked = (this.rdb_IsCompulsory.Text == this._Course.LearningType); this.rdb_IsOptional.Checked = (this.rdb_IsOptional.Text == this._Course.LearningType); }
/// <summary> /// 载入课程; /// </summary> private void LoadCourse() { this._Course = CourseRepository.Find("2060316"); this.txb_CourseNumber.Text = this._Course.Number; this.txb_CourseName.Text = this._Course.Name; this.nud_CourseCredit.DataBindings.Clear(); //清空控件的数据绑定项; this.nud_CourseCredit.DataBindings.Add //向控件的数据绑定项添加绑定项,并分别指定控件属性名称、对象、对象属性名称,从而实现双向更改; ("Value", this._Course, "Credit"); //若该属性更改时,相应更改其它属性,可在该属性中触发PropertyChanged事件(类还需实现INotifyPropertyChanged接口),从而实现其它属性在控件中的同步更改; this.lbl_CourseHourDistribution.DataBindings.Clear(); this.lbl_CourseHourDistribution.DataBindings.Add ("Text", this._Course, "CourseHourDistribution"); this.tkb_TheoreticalHour.DataBindings.Clear(); this.tkb_TheoreticalHour.DataBindings.Add ("Maximum", this._Course, "TotalHour"); this.tkb_TheoreticalHour.DataBindings.Add ("Value", this._Course, "TheoreticalHour"); this.txb_CourseDescription.Text = this._Course.Description; this.ckb_IsAvailable.Checked = this._Course.IsAvailable; this.ckb_HasExperiment.Checked = this._Course.HasExperiment; this.ckb_HasMooc.Checked = this._Course.HasMooc; this.AddRangeWithCheckedItem (this.clb_FormativeAssessment, this._Course.FormativeAssessments, CourseService.GetAllFormativeAssessment); this.rdb_IsProfessional.Checked = (this.rdb_IsProfessional.Text == this._Course.Type); this.rdb_IsPublic.Checked = (this.rdb_IsPublic.Text == this._Course.Type); this.rdb_IsCompulsory.Checked = (this.rdb_IsCompulsory.Text == this._Course.LearningType); this.rdb_IsOptional.Checked = (this.rdb_IsOptional.Text == this._Course.LearningType); this.lsb_CourseAppraisalType.Items.Clear(); this.lsb_CourseAppraisalType.Items.AddRange (CourseAppraisalType.GetAllTypes()); this.lsb_CourseAppraisalType.SelectedItem = this._Course.AppraisalType; this.ListBoxLoadSubItems (this.lsb_CourseAppraisalType, this.lsb_CourseAppraisalForm, CourseAppraisalType.GetAllForms); this.lsb_CourseAppraisalForm.SelectedItem = this._Course.AppraisalForm; }
/// <summary> /// 点击载入按钮; /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_Load_Click(object sender, EventArgs e) { if (this._Course == null) { this._Course = CourseRepository.Find("2060316"); MessageBox.Show($"已载入《{this._Course.Name}》。修改课程信息后请及时提交。"); return; } DialogResult messageboxResult = //定义对话框操作结果,用于接收消息框操作结果; MessageBox.Show //消息框的Show方法除了显示消息框,还能在用户完成对消息框的操作后,返回消息框操作结果; ("即将重新载入课程,请确认先前的修改均已提交!", "警告", MessageBoxButtons.YesNo, //消息框按钮; MessageBoxIcon.Warning); //消息框图标; if (messageboxResult == DialogResult.Yes) //若消息框操作结果为是; { MessageBox.Show ($"已重新载入《{this._Course.Name}》。", "消息", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// 点击载入按钮; /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_Load_Click(object sender, EventArgs e) { this._Course = CourseRepository.Find("2060316"); MessageBox.Show($"已载入《{this._Course.Name}》。"); }
/// <summary> /// 点击载入按钮; /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_Load_Click(object sender, EventArgs e) { this._Course = CourseRepository.Find("2060316"); MessageBox.Show($"已载入《{this._Course.Name}》。修改课程信息后请及时提交。"); this.btn_Submit.Enabled = true; }
/// <summary> /// 载入按钮点击; /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_Load_Click(object sender, EventArgs e) { this._Course = CourseRepository.Find("2060316"); this.txb_CourseDescription.Text = this._Course.Description; this.LoadFormativeAssessments(); }
/// <summary> /// 载入按钮点击; /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_Load_Click(object sender, EventArgs e) { this._Course = CourseRepository.Find("2060316"); this.txb_CourseDescription.Text = this._Course.Description; this.rtb_CourseSyllabus.Rtf = this._Course.Syllabus; }