private void comboBoxEdit_Grade_SelectedIndexChanged(object sender, System.EventArgs e) { comboBoxEdit_Class.Properties.Items.Clear(); // comboBoxEdit_Class.Text = ""; comboBoxEdit_Class.Properties.Items.Add("全部"); comboBoxEdit_Class.SelectedItem = "全部"; DataSet gradeInfo = new GradeSystem().GetGradeInfoList(1); DataSet classInfo = new ClassSystem().GetClassInfoList(); if(classInfo.Tables[0].Rows.Count>0) { if(comboBoxEdit_Grade.SelectedItem.ToString().Equals("全部")) { foreach(DataRow classes in classInfo.Tables[0].Rows) { comboBoxEdit_Class.Properties.Items.Add(classes["info_className"].ToString()); } } else { foreach(DataRow grade in gradeInfo.Tables[0].Rows) { if(grade["info_gradeName"].ToString().Equals(comboBoxEdit_Grade.SelectedItem.ToString())) { foreach(DataRow classes in classInfo.Tables[0].Rows) { if(Convert.ToInt32(classes["info_gradeNumber"]) == Convert.ToInt32(grade["info_gradeNumber"])) { comboBoxEdit_Class.Properties.Items.Add(classes["info_className"].ToString()); } } } } } } loadPage(new TeacherBaseSystem().SearchTcBaseInfoByCondition(comboBoxEdit_Grade.SelectedItem.ToString().Replace(" ",""), comboBoxEdit_Class.SelectedItem.ToString().Replace(" ",""),textEdit_Name.Text.Replace(" ",""),textEdit_Number.Text.Replace(" ",""))); simpleButton_SaveButton.Enabled = false; }
//修改班级信息按钮 private void simpleButton_ClassModi_Click(object sender, System.EventArgs e) { string message = "是否确认修改?"; string caption = "消息提示框!"; DialogResult messageResult = MessageBox.Show(message,caption,MessageBoxButtons.YesNo,MessageBoxIcon.Question); if ( messageResult != DialogResult.Yes ) return; int rowsAffected = 0; Classes classes = new Classes(); classes.ClassInfoGradeNumber = gradeID; classes.InfoClassNumber = classID; classes.InfoClassName = comboBoxEdit_ClassNameModify.SelectedItem.ToString(); classes.InfoClassRemark = textEdit_ClassModifyRemark.Text.Trim(); if(classes.InfoClassName != string.Empty) { try { rowsAffected = new ClassSystem().UpdateClassInfo(classes); if(rowsAffected > 0) { MessageBox.Show(radioGroup_Class.SelectedIndex==0?"班级":"岗位"+"信息修改成功","系统信息!", MessageBoxButtons.OK,MessageBoxIcon.Information); gradeDataBinding(); resetClassInfo(); } else { MessageBox.Show(radioGroup_Class.SelectedIndex==0?"班级":"岗位"+"信息修改失败,请重试","系统信息!", MessageBoxButtons.OK,MessageBoxIcon.Warning); } } catch(Exception ex) { MessageBox.Show(radioGroup_Class.SelectedIndex==0?"班级":"岗位"+"信息修改失败,请重试","系统信息!", MessageBoxButtons.OK,MessageBoxIcon.Warning); CPTT.SystemFramework.Util.WriteLog(ex.Message,CPTT.SystemFramework.Util.EXCEPTION_LOG_TITLE); } } else { MessageBox.Show("请先选择要修改的信息","系统信息!", MessageBoxButtons.OK,MessageBoxIcon.Warning); } }
private void tDept_SelectedIndexChanged(object sender, System.EventArgs e) { tDuty.Properties.Items.Clear(); DataSet gradeInfo = new GradeSystem().GetGradeInfoList(1); DataSet classInfo = new ClassSystem().GetClassInfoList(); if ( classInfo.Tables[0].Rows.Count > 0 ) { if ( tDept.SelectedIndex != -1 ) { foreach ( DataRow grade in gradeInfo.Tables[0].Rows ) { if ( grade["info_gradeName"].ToString().Equals(tDept.SelectedItem.ToString()) ) { foreach ( DataRow classes in classInfo.Tables[0].Rows ) { if ( Convert.ToInt32(classes["info_gradeNumber"]) == Convert.ToInt32(grade["info_gradeNumber"]) ) tDuty.Properties.Items.AddRange(new object[]{ classes["info_className"].ToString() }); } } } if ( tDuty.Properties.Items.Count == 0 ) tDuty.Text = "班级不存在"; else tDuty.SelectedItem = tDuty.Properties.Items[0].ToString(); } else tDuty.SelectedIndex = -1; } }
//删除班级信息 private void simpleButton_DeleteClass_Click(object sender, System.EventArgs e) { int rowsAffected = 0; if(comboBoxEdit_ClassNameModify.SelectedIndex!=-1) { try { rowsAffected = new ClassSystem().DeleteClassInfo(classID,gradeID); if(rowsAffected>0) { resetClassInfo(); gradeDataBinding(); } else { MessageBox.Show("班级信息删除失败,请重试","系统信息!", MessageBoxButtons.OK,MessageBoxIcon.Warning); } } catch(Exception ex) { MessageBox.Show("班级信息删除失败,请重试","系统信息!", MessageBoxButtons.OK,MessageBoxIcon.Warning); CPTT.SystemFramework.Util.WriteLog(ex.Message,CPTT.SystemFramework.Util.EXCEPTION_LOG_TITLE); } } else { MessageBox.Show("请先选择要删除的班级","系统信息!", MessageBoxButtons.OK,MessageBoxIcon.Warning); } }
//保存班级信息 private void simpleButton_ClassSave_Click(object sender, System.EventArgs e) { if(comboBoxEdit1.SelectedIndex != -1 && textEdit_ClassName.Text != string.Empty) { Classes classes = new Classes(); classes.InfoClassName = textEdit_ClassName.Text.Trim(); classes.InfoClassRemark = textEdit_ClassRemark.Text.Trim(); if (comboBoxEdit_classNumber.SelectedItem.ToString().Equals("已经到达班级最大容量")) { MessageBox.Show("班级容量已经到达最大容量,无法进行添加操作!"); return; } if (radioGroup_Class.SelectedIndex == 0) classes.InfoClassNumber = Convert.ToInt32(comboBoxEdit_classNumber.SelectedItem); else classes.InfoClassNumber = 0; classes.ClassType = radioGroup_Class.SelectedIndex.ToString(); int rowsAffected = 0; try { rowsAffected = new ClassSystem().InsertClassInfo(classes,comboBoxEdit1.SelectedItem.ToString()); if(rowsAffected > 0) { //清空文本框 resetClassInfoAdd(); MessageBox.Show("插入成功.","系统信息!",MessageBoxButtons.OK,MessageBoxIcon.Information); //重新绑定班级信息 ClassDataBinding(); } else if(rowsAffected == -1) { string info = radioGroup_Class.SelectedIndex==0?"班级":"岗位"; MessageBox.Show(info+"名称重复,请更改名称后重试","系统信息!", MessageBoxButtons.OK,MessageBoxIcon.Warning); } else if(rowsAffected == -2) { MessageBox.Show("该部门的教师岗位由系统内定为班主任,您无法对该项目进行操作!","系统信息!", MessageBoxButtons.OK,MessageBoxIcon.Warning); } else if (rowsAffected == -3) { MessageBox.Show("班级总合不能超过28,添加失败!","系统信息!", MessageBoxButtons.OK,MessageBoxIcon.Warning); } else { MessageBox.Show("插入失败,请重试","系统信息!", MessageBoxButtons.OK,MessageBoxIcon.Warning); } } catch(Exception ex) { MessageBox.Show("插入失败,请重试","系统信息!", MessageBoxButtons.OK,MessageBoxIcon.Information); CPTT.SystemFramework.Util.WriteLog(ex.Message,CPTT.SystemFramework.Util.EXCEPTION_LOG_TITLE); } } else { MessageBox.Show("*号为必须填写内容,请检查输入","系统信息",MessageBoxButtons.OK,MessageBoxIcon.Information); } textEdit_ClassName.Text = string.Empty; }
private void comboBoxEdit_Graphic_TeaDept_SelectedIndexChanged(object sender, System.EventArgs e) { comboBoxEdit_Graphic_TeaDuty.Properties.Items.Clear(); comboBoxEdit_Graphic_TeaDuty.Properties.Items.Add("全部"); comboBoxEdit_Graphic_TeaDuty.SelectedItem = "全部"; DataSet deptInfo = new GradeSystem().GetGradeInfoList(1); DataSet dutyInfo = new ClassSystem().GetClassInfoList(); if ( dutyInfo.Tables[0].Rows.Count > 0 ) { if ( comboBoxEdit_Graphic_TeaDept.SelectedItem.ToString().Equals("全部") ) { // foreach ( DataRow duty in dutyInfo.Tables[0].Rows ) // { // comboBoxEdit_Graphic_TeaDuty.Properties.Items.Add(duty["info_className"].ToString()); // } } else { foreach ( DataRow dept in deptInfo.Tables[0].Rows ) { if ( dept["info_gradeName"].ToString().Equals(comboBoxEdit_Graphic_TeaDept.SelectedItem.ToString()) ) { foreach ( DataRow duty in dutyInfo.Tables[0].Rows ) { if(Convert.ToInt32(duty["info_gradeNumber"]) == Convert.ToInt32(dept["info_gradeNumber"])) { comboBoxEdit_Graphic_TeaDuty.Properties.Items.Add(duty["info_className"].ToString()); } } } } } } }
//出勤页面 private void comboBoxEdit_TeaDutyDetailsSearByGrade_SelectedIndexChanged(object sender, System.EventArgs e) { // if(getStuInfoByCondition.getGradeInfo(comboBoxEdit_TeaDutyDetailsSearByGrade.SelectedItem.ToString(),"").Tables[0].Rows.Count > 0) // { // // comboBoxEdit_TeaDutyDetailsSearByClass.Properties.Items.Clear(); // comboBoxEdit_TeaDutyDetailsSearByClass.Properties.Items.AddRange(new object[]{"全部"}); // comboBoxEdit_TeaDutyDetailsSearByClass.SelectedItem = "全部"; // // //根据年级选择获取年级编号 // getGradeNumberFromCombo = getStuInfoByCondition.getGradeInfo( // comboBoxEdit_TeaDutyDetailsSearByGrade.SelectedItem.ToString(),"").Tables[0].Rows[0][0].ToString(); // foreach(DataRow getClassList in getStuInfoByCondition.getClassInfo("","", // getGradeNumberFromCombo).Tables[0].Rows) // { // comboBoxEdit_TeaDutyDetailsSearByClass.Properties.Items.AddRange( // new object[]{getClassList[1].ToString()}); // } // } comboBoxEdit_TeaDutyDetailsSearByClass.Properties.Items.Clear(); comboBoxEdit_TeaDutyDetailsSearByClass.Properties.Items.Add("全部"); comboBoxEdit_TeaDutyDetailsSearByClass.SelectedItem = "全部"; DataSet deptInfo = new GradeSystem().GetGradeInfoList(1); DataSet dutyInfo = new ClassSystem().GetClassInfoList(); if ( dutyInfo.Tables[0].Rows.Count > 0 ) { if ( comboBoxEdit_TeaDutyDetailsSearByGrade.SelectedItem.ToString().Equals("全部") ) { // foreach ( DataRow duty in dutyInfo.Tables[0].Rows ) // { // comboBoxEdit_TeaDutyDetailsSearByClass.Properties.Items.Add(duty["info_className"].ToString()); // } } else { foreach ( DataRow dept in deptInfo.Tables[0].Rows ) { if ( dept["info_gradeName"].ToString().Equals(comboBoxEdit_TeaDutyDetailsSearByGrade.SelectedItem.ToString()) ) { foreach ( DataRow duty in dutyInfo.Tables[0].Rows ) { if(Convert.ToInt32(duty["info_gradeNumber"]) == Convert.ToInt32(dept["info_gradeNumber"])) { comboBoxEdit_TeaDutyDetailsSearByClass.Properties.Items.Add(duty["info_className"].ToString()); } } } } } } }
private static void DownloadGrowUpCheckReportData() { while (true) { int totalCount = 0; int succCount = 0; try { var tuple = new UtilSystem().GetDownloadRevAndID(); var reportHistory = new List<dynamic>(); YlmfDataDownload.GrowUpCheckReportDownload.DownloadLog log = null; if (!string.IsNullOrEmpty(tuple.Item6)) { var dt = new ClassSystem().GetGetClassAndGrade(); if (dt != null) { foreach (DataRow row in dt.Rows) { var rev = new UtilSystem().GetDownloadRev(row["info_className"].ToString(), 4); log = YlmfDataDownload.GrowUpCheckReportDownload.GetDownloadData(tuple.Item6, row["info_className"].ToString(), rev); if (log.code == 1) { foreach (var studentReport in log.result.list) { succCount = 1; totalCount = 1; var studentNumber = studentReport.studentNum; var referrerID = studentReport.id; foreach (var report in studentReport.reportList) { reportHistory.Add(new { referrerID = referrerID, studentNo = studentNumber, date = report.time, detail = report.reportDetail }); } new UtilSystem().InsertDownloadLog(log.lastupttime, log.Raw, succCount, totalCount, 4, row["info_className"].ToString()); } } } foreach (var item in reportHistory) { int reportID = 0; new UtilSystem().InsertGrowUpCheckReportHistory(item.studentNo, item.referrerID, item.date, out reportID); if (reportID > 0) { var reportDetail = item.detail as IList<YlmfDataDownload.GrowUpCheckReportDownload.ReportItem>; foreach (var detail in reportDetail) { totalCount++; try { new UtilSystem().InsertGrowUpCheckReportDetail(reportID, detail.resultType, detail.type); succCount++; } catch (Exception ex) { SystemFramework.Util.WriteLog(ex.ToString(), SystemFramework.Util.EXCEPTION_LOG_TITLE); } } } } } } } catch (Exception ex) { SystemFramework.Util.WriteLog(ex.ToString(), SystemFramework.Util.EXCEPTION_LOG_TITLE); } if (succCount == 0) Thread.Sleep(1000 * 60 * 20); } }