private void returnBtn_Click(object sender, EventArgs e) { var dmTable = OfflineDataControl.GetDmDatatable(kkno, skno); classBriefcase = BriefcaseControl.GetBriefcase(kkno); if (isRollCalling) { foreach (var student in RollCallControl.CopyOfStudentList) { var dmTableRows = dmTable.Select(string.Format("XSID = '{0}'", student.StudentId)); if (!dmTableRows.Any()) { continue; } student.RollCallStatus = Convert.ToInt16(dmTableRows.First()["DKZT"]); if (dmTableRows.First()["DMSJ1"] != DBNull.Value) // 如果点名时间1不为空的话 { student.ArriveTime = Convert.ToDateTime(dmTableRows.First()["DMSJ1"]); } } Student.DmTable = dmTable; Student.ClassBriefcase = classBriefcase; } Close(); }
private void changeToNormalBtn_Click(object sender, EventArgs e) { //先把Briefcase找出来 classBriefcase = BriefcaseControl.GetBriefcase(kkno); //然后把当前的学号找出来 var studentId = Convert.ToString(studentsGridView.SelectedRows.First().Cells["学号"].Value); //然后更改当前的上课状态 显示的上课状态哦 dp_ChangeDisplayStatus(sender); //然后获取点名表 var dmTable = OfflineDataControl.GetDmDatatable(kkno, skno); //改点名表里的记录 这里改的就是数据了. OfflineDataControl.ChangeDmRecord(ref dmTable, studentId, 0, DateTime.Now, 1); //存点名表. BriefcaseControl.SaveDmTable(classBriefcase, dmTable); }
/// <summary> /// 手动更改签到状态 /// </summary> /// <param name="kkno">开课编号</param> /// <param name="skno">上课编号</param> /// <param name="isRollCalling">是否正在签到</param> public ViewStudentsForm(long kkno, long skno, bool isRollCalling) { InitializeComponent(); this.skno = skno; this.kkno = kkno; var dmTable = OfflineDataControl.GetDmDatatable(kkno, skno); this.isRollCalling = isRollCalling; // 是否正在签到 if (dmTable == null) { // 判断获取到的点名表是否为空 //如果为空 则显示出上课编号和开课编号 MsgBox.ShowMsgBoxDialog(string.Format("数据有误 请将以下信息提供给维护人员:\n" + "上课编号:{0}\n" + "开课编号:{1}", skno, kkno)); Close(); return; } var dmDisplayTable = OfflineDataControl.DmtableToDisplayTable(dmTable); studentsGridView.DataSource = dmDisplayTable; classBriefcase = BriefcaseControl.GetBriefcase(kkno); //调用一个或者几个函数函数 该函数应该: //1.传入 kkno 和 skno 返回该堂课的点名表 //2.传入kkno和datatable 可以正常写入briefcase. //指纹点名的时候也应该这样. //这些函数应该在OfflineDataControl中. }