/// <summary> /// 查询数据 /// </summary> private void readData() { if (this._workflowno > 0) { BLL.WORKFLOW workflowbll = new BLL.WORKFLOW(); Model.WORKFLOW workflowmdl = new Model.WORKFLOW(); workflowmdl = workflowbll.GetModel(_workflowno); if (workflowmdl == null) //新增工作流功能时 { blankData(); } else //修改工作流功能时 { this.te_workflowname.Text = workflowmdl.WORKFLOWNAME; this.de_createdate.Text = ToolHelper.ConvertToString(workflowmdl.CREATEDATE); if (workflowmdl.STATUS == 0) { this.cbb_status.Text = "未用"; } else { this.cbb_status.Text = "在用"; } } } }
private void cbb_Workflow_SelectedIndexChanged(object sender, EventArgs e) { BLL.WORKFLOW workflowBll = new BLL.WORKFLOW(); Model.WORKFLOW workflowMdl = new Model.WORKFLOW(); workflowMdl = workflowBll.GetModel(this.cbb_Workflow.Properties.Items[this.cbb_Workflow.SelectedIndex].ToString()); init_node(workflowMdl.WORKFLOWNO); }
/// <summary> /// 增加数据方法 /// </summary> private void Add() { int termno, teacherno, workflowno; if (this.cbb_teacher.SelectedIndex == -1) { MessageBox.Show("请选择指导教师!", "提示信息"); return; } BLL.STUDENT_INFO studentBll = new BLL.STUDENT_INFO(); BLL.TERM_INFO termBll = new BLL.TERM_INFO(); Model.TERM_INFO termMdl = new Model.TERM_INFO(); BLL.WORKFLOW workflowBll = new BLL.WORKFLOW(); Model.WORKFLOW workflowMdl = new Model.WORKFLOW(); BLL.TEACHER_INFO teacherBll = new BLL.TEACHER_INFO(); Model.TEACHER_INFO teacherMdl = new Model.TEACHER_INFO(); BLL.TEA_STU teastuBll = new BLL.TEA_STU(); Model.TEA_STU teastuMdl = new Model.TEA_STU(); termMdl = termBll.GetModel(this.cbb_term.Properties.Items[this.cbb_term.SelectedIndex].ToString()); termno = termMdl.TERMNO; workflowMdl = workflowBll.GetModel(this.cbb_workflow.Properties.Items[this.cbb_workflow.SelectedIndex].ToString()); workflowno = workflowMdl.WORKFLOWNO; teacherMdl = teacherBll.GetModel(this.cbb_teacher.Properties.Items[this.cbb_teacher.SelectedIndex].ToString()); teacherno = teacherMdl.TEACHERNO; teastuMdl.TEACHERNO = teacherno; teastuMdl.TERMNO = termno; teastuMdl.WORKFLOWNO = workflowno; //获取所选学生学号列表 this.lstCheckedStudentNo.Clear(); if (this.tl_student.Nodes.Count > 0) { foreach (TreeListNode root in tl_student.Nodes) { GetCheckedStudentNo(root); } } //将所选学生插入该教师所指导学生列表中 string idStr = string.Empty; foreach (string stuno in lstCheckedStudentNo) { teastuMdl.STUNO = stuno; teastuBll.Add(teastuMdl); } //显示更新数据 readData(2); }
/// <summary> /// 初始化工作流列表 /// 根据学期检索工作流 /// </summary> private void init_workflow(int termno) { Student.BLL.WORKFLOW workflowBll = new BLL.WORKFLOW(); DataSet ds = workflowBll.GetList(" status = 1 and workflowno in (select distinct workflowno from TEA_STU where termno = " + termno.ToString() + ")"); this.cbb_Workflow.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; cbb_Workflow.Properties.Items.Clear(); cbb_Workflow.EditValue = null; cbb_Workflow.Properties.NullText = "--请选择--"; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string workflowName = ds.Tables[0].Rows[i]["WORKFLOWNAME"].ToString(); this.cbb_Workflow.Properties.Items.Add(workflowName); } }
/// <summary> /// 查询数据 /// </summary> private void ReadData(string workflowname) { string condition = ""; BLL.WORKFLOW workflowBll = new BLL.WORKFLOW(); Model.WORKFLOW workflowMdl = new Model.WORKFLOW(); workflowMdl = workflowBll.GetModel(workflowname); int workflowno = workflowMdl.WORKFLOWNO; if (workflowno > 0) { BLL.WORKFLOWSET workflowsetBll = new BLL.WORKFLOWSET(); condition = " WORKFLOWSET.WORKFLOWNO = " + workflowno.ToString(); this.gc_workflowset.DataSource = workflowsetBll.GetList(condition).Tables[0]; this.gridView1.BestFitColumns(); DBUtility.ToolHelper.DrawRowIndicator(gridView1, 40); DBUtility.ToolHelper.SetLineColorofGridView(this.gridView1); } }
/// <summary> /// 读取数据 /// </summary> private void readData(int flag) { int termno, teacherno, workflowno; BLL.STUDENT_INFO studentBll = new BLL.STUDENT_INFO(); BLL.TERM_INFO termBll = new BLL.TERM_INFO(); Model.TERM_INFO termMdl = new Model.TERM_INFO(); BLL.WORKFLOW workflowBll = new BLL.WORKFLOW(); Model.WORKFLOW workflowMdl = new Model.WORKFLOW(); BLL.TEACHER_INFO teacherBll = new BLL.TEACHER_INFO(); Model.TEACHER_INFO teacherMdl = new Model.TEACHER_INFO(); termMdl = termBll.GetModel(this.cbb_term.Properties.Items[this.cbb_term.SelectedIndex].ToString()); termno = termMdl.TERMNO; workflowMdl = workflowBll.GetModel(this.cbb_workflow.Properties.Items[this.cbb_workflow.SelectedIndex].ToString()); workflowno = workflowMdl.WORKFLOWNO; //初始化学生列表 this.tl_student.DataSource = studentBll.GetStudentNodeList(termno, workflowno).Tables[0]; this.tl_student.KeyFieldName = "nodeid"; this.tl_student.ParentFieldName = "parentid"; this.tl_student.Columns["nodename"].Caption = "学生列表"; //初始化教师指导学生列表 string condition = ""; condition += " and D.TERMNO = '" + termno.ToString() + "' "; condition += " and E.WORKFLOWNO = '" + workflowno.ToString() + "' "; if (flag == 2) { teacherMdl = teacherBll.GetModel(this.cbb_teacher.Properties.Items[this.cbb_teacher.SelectedIndex].ToString()); teacherno = teacherMdl.TEACHERNO; condition += " and C.TEACHERNO = '" + teacherno.ToString() + "' "; } BLL.TEA_STU teastuBll = new BLL.TEA_STU(); this.gridControl1.DataSource = teastuBll.GetList(condition).Tables[0]; this.gridView1.BestFitColumns(); DBUtility.ToolHelper.DrawRowIndicator(gridView1, 50); DBUtility.ToolHelper.SetLineColorofGridView(this.gridView1); }
private void init() { //初始化工作流列表数据 BLL.WORKFLOW workflowBll = new BLL.WORKFLOW(); Model.WORKFLOW workflowMdl = new Model.WORKFLOW(); clbc_workflow.Items.Clear(); List <Model.WORKFLOW> workflowList = new List <Model.WORKFLOW>(); workflowList = workflowBll.GetModelList(" status = 1"); foreach (Model.WORKFLOW l in workflowList) { clbc_workflow.Items.Add(l.WORKFLOWNAME); } //默认显示第一个工作流的节点数据 if (clbc_workflow.Items.Count > 0) { string workflowname = clbc_workflow.Items[0].Value.ToString(); ReadData(workflowname); } }
//新增时初始化节点列表 public void init() { BLL.WORKNODE worknodeBll = new BLL.WORKNODE(); BLL.WORKFLOW workflowBll = new BLL.WORKFLOW(); Model.WORKFLOW workflowMdl = new Model.WORKFLOW(); if (_enumStatus == StatusClass.AddNew) { workflowMdl = workflowBll.GetModel(workflowsetaddMdl.WORKFLOWNAME); int workflowno = workflowMdl.WORKFLOWNO; DataSet ds = worknodeBll.GetList(" NODENO not in(select NODENO from WORKFLOWSET where workflowno = " + workflowno.ToString() + " and NODENO is not null)"); this.cbb_nodename.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; cbb_nodename.Properties.Items.Clear(); cbb_nodename.EditValue = null; cbb_nodename.Properties.NullText = "--请选择--"; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string nodename = ds.Tables[0].Rows[i]["nodename"].ToString(); this.cbb_nodename.Properties.Items.Add(nodename); } } else if (_enumStatus == StatusClass.Edit) { workflowMdl = workflowBll.GetModel(workflowsetaddMdl.WORKFLOWNAME); int workflowno = workflowMdl.WORKFLOWNO; DataSet ds = worknodeBll.GetList(" NODENO not in(select NODENO from WORKFLOWSET where workflowno = " + workflowno.ToString() + " and NODENO is not null)"); this.cbb_nodename.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; cbb_nodename.Properties.Items.Clear(); cbb_nodename.EditValue = workflowsetaddMdl.NODENAME; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { this.cbb_nodename.Properties.Items.Add(ds.Tables[0].Rows[i]["nodename"].ToString()); } this.cbb_nodename.Properties.Items.Add(workflowsetaddMdl.NODENAME); this.te_workflowname.Text = workflowsetaddMdl.WORKFLOWNAME; this.cbb_nodeorder.Text = workflowsetaddMdl.NODEORDER.ToString(); this.de_begintime.Text = workflowsetaddMdl.BEGINTIME.ToString(); this.de_endtime.Text = workflowsetaddMdl.ENDTIME.ToString(); } }
/// <summary> /// 删除数据方法 /// </summary> /// <param name="id"></param> /// <returns></returns> private bool deleteData(int id) { try { BLL.WORKFLOWSET workflowsetbll = new BLL.WORKFLOWSET(); int recordCount = workflowsetbll.GetRecordCount("workflowno = " + id.ToString()); if (recordCount > 0) { MessageBox.Show("该工作流信息已经被使用,不能被删除!", "提示信息"); return(false); } else { BLL.WORKFLOW workflowbll = new BLL.WORKFLOW(); workflowbll.Delete(id); return(true); } } catch (Exception exception) { MessageBox.Show("删除失败!", exception.Message); return(false); } }
/// <summary> /// 保存数据方法 /// </summary> /// <returns></returns> private bool saveData() { try { BLL.WORKFLOW workflowbll = new BLL.WORKFLOW(); Model.WORKFLOW workflowmdl = new Model.WORKFLOW(); if (this.te_workflowname.Text == "") { MessageBox.Show("工作流名称不能为空!", "提示信息"); return(false); } if (this.cbb_status.Text == "") { MessageBox.Show("状态不能为空!", "提示信息"); return(false); } if (this.de_createdate.Text == "") { MessageBox.Show("创建时间不能为空!", "提示信息"); return(false); } if (this._enumStatus == StatusClass.AddNew) //新增工作流 { workflowmdl.WORKFLOWNAME = this.te_workflowname.Text; workflowmdl.CREATEDATE = ToolHelper.ConvertToDateTime(this.de_createdate.Text); string status = this.cbb_status.Text; if (status == "未用") { workflowmdl.STATUS = 0; } else { workflowmdl.STATUS = 1; } workflowbll.Add(workflowmdl); return(true); } else if (this._enumStatus == StatusClass.Edit) //修改工作流 { workflowmdl.WORKFLOWNO = this._workflowno; workflowmdl.WORKFLOWNAME = this.te_workflowname.Text; workflowmdl.CREATEDATE = ToolHelper.ConvertToDateTime(this.de_createdate.Text); string status = this.cbb_status.Text; if (status == "未用") { workflowmdl.STATUS = 0; } else { workflowmdl.STATUS = 1; } workflowbll.Update(workflowmdl); return(true); } return(true); } catch (Exception exception) { MessageBox.Show("保存失败!", exception.Message); return(false); } }
/// <summary> /// 保存数据方法 /// </summary> /// <returns></returns> private bool saveData() { try { BLL.WORKFLOWSET workflowsetbll = new BLL.WORKFLOWSET(); Model.WORKFLOWSET workflowsetmdl = new Model.WORKFLOWSET(); BLL.WORKNODE worknodeBll = new BLL.WORKNODE(); Model.WORKNODE worknodeMdl = new Model.WORKNODE(); BLL.WORKFLOW workflowBll = new BLL.WORKFLOW(); Model.WORKFLOW workflowMdl = new Model.WORKFLOW(); if (this.cbb_nodename.Text == "") { MessageBox.Show("工作节点不能为空!", "提示信息"); return(false); } if (this.cbb_nodeorder.Text == "") { MessageBox.Show("节点顺序不能为空!", "提示信息"); return(false); } if (this.de_begintime.Text == "") { MessageBox.Show("开始日期不能为空!", "提示信息"); return(false); } if (this.de_endtime.Text == "") { MessageBox.Show("截止日期不能为空!", "提示信息"); return(false); } if (this._enumStatus == StatusClass.AddNew) //新增工作流节点 { //获取工作流编号 workflowMdl = workflowBll.GetModel(workflowsetaddMdl.WORKFLOWNAME); int workflowno = workflowMdl.WORKFLOWNO; workflowsetmdl.WORKFLOWNO = workflowno; //获取工作节点编号 worknodeMdl = worknodeBll.GetModel(this.cbb_nodename.Text); workflowsetmdl.NODENO = worknodeMdl.NODENO; workflowsetmdl.NODEORDER = ToolHelper.ConvertToInt(this.cbb_nodeorder.Text); workflowsetmdl.BEGINTIME = ToolHelper.ConvertToDateTime(this.de_begintime.Text); workflowsetmdl.ENDTIME = ToolHelper.ConvertToDateTime(this.de_endtime.Text); workflowsetbll.Add(workflowsetmdl); return(true); } else if (this._enumStatus == StatusClass.Edit) //修改工作节点 { //获取工作流编号 workflowMdl = workflowBll.GetModel(workflowsetaddMdl.WORKFLOWNAME); int workflowno = workflowMdl.WORKFLOWNO; workflowsetmdl.WORKFLOWNO = workflowno; worknodeMdl = worknodeBll.GetModel(this.cbb_nodename.Text); workflowsetmdl.NODENO = worknodeMdl.NODENO; workflowsetmdl.NODEORDER = ToolHelper.ConvertToInt(this.cbb_nodeorder.Text); workflowsetmdl.BEGINTIME = ToolHelper.ConvertToDateTime(this.de_begintime.Text); workflowsetmdl.ENDTIME = ToolHelper.ConvertToDateTime(this.de_endtime.Text); workflowsetmdl.SETNO = setno; workflowsetbll.Update(workflowsetmdl); return(true); } return(true); } catch (Exception exception) { MessageBox.Show("保存失败!", exception.Message); return(false); } }