Exemple #1
0
        /// <summary>
        /// 删除数据方法
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        private bool deleteData(decimal setno)
        {
            try
            {
                int               nodeno, workflowno;
                BLL.WORKFLOWSET   workflowsetBll = new BLL.WORKFLOWSET();
                Model.WORKFLOWSET workflowsetMdl = new Model.WORKFLOWSET();

                BLL.STU_WORKFLOW stu_workflowBll = new BLL.STU_WORKFLOW();

                workflowsetMdl = workflowsetBll.GetModel(setno);
                nodeno         = (int)workflowsetMdl.NODENO;
                workflowno     = (int)workflowsetMdl.WORKFLOWNO;

                int recordCount = stu_workflowBll.GetRecordCount("and STU_WORKFLOW.nodeno = " + nodeno.ToString() + " and TEA_STU.workflowno = " + workflowno.ToString());
                if (recordCount > 0)
                {
                    MessageBox.Show("该设置信息已经被使用,不能被删除!", "提示信息");
                    return(false);
                }
                else
                {
                    workflowsetBll.Delete(setno);
                    return(true);
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show("删除失败!", exception.Message);
                return(false);
            }
        }
Exemple #2
0
        /// <summary>
        /// 保存方法
        /// </summary>
        private bool saveData()
        {
            BLL.STU_WORKFLOW stuworkflowBll = new BLL.STU_WORKFLOW();

            if (!ToolHelper.IsNumeric(this.te_grade.Text))
            {
                MessageBox.Show("成绩必须为数值!", "提示信息");
                return(false);
            }

            if (this.te_grade.Text.Length <= 0)
            {
                MessageBox.Show("成绩不能为空!", "提示信息");
                return(false);
            }

            float grade = ToolHelper.ConvertToFloat(this.te_grade.Text);

            if (grade < 0 || grade > 100)
            {
                MessageBox.Show("成绩不合法,请核查!", "提示信息");
                return(false);
            }

            BLL.ENTERPRISE_INFO   enterpriseBll = new BLL.ENTERPRISE_INFO();
            Model.ENTERPRISE_INFO enterpriseMdl = new Model.ENTERPRISE_INFO();

            if (this.cbb_ent.SelectedIndex != -1)
            {
                string entname = this.cbb_ent.Properties.Items[this.cbb_ent.SelectedIndex].ToString();

                enterpriseMdl = enterpriseBll.GetModel(entname);
                int entno = (int)enterpriseMdl.ENTNO;
                stuworkflowBll.Update(grade, _execno, entno);
            }
            else
            {
                string entname = this.cbb_ent.EditValue.ToString();
                if (entname.Length > 0)
                {
                    enterpriseMdl = enterpriseBll.GetModel(entname);
                    if (enterpriseMdl == null)
                    {
                        MessageBox.Show("该企业不存在,请添加该企业信息!", "提示信息");
                        return(false);
                    }
                    else
                    {
                        int entno = (int)enterpriseMdl.ENTNO;
                        stuworkflowBll.Update(grade, _execno, entno);
                    }
                }
                else
                {
                    stuworkflowBll.Update(grade, _execno);
                }
            }
            return(true);
        }
        /// <summary>
        /// 查询数据方法
        /// </summary>
        private void readData()
        {
            string condition = "";

            if (this.cbb_Term.SelectedIndex != -1)
            {
                string termname = this.cbb_Term.Properties.Items[this.cbb_Term.SelectedIndex].ToString();
                condition += " and E.TERMNAME like '%" + termname + "%' ";
            }

            if (this.cbb_Workflow.SelectedIndex != -1)
            {
                string workflowname = this.cbb_Workflow.Properties.Items[this.cbb_Workflow.SelectedIndex].ToString();
                condition += " and F.WORKFLOWNAME like '%" + workflowname + "%' ";
            }

            if (this.cbb_Node.SelectedIndex != -1)
            {
                string nodename = this.cbb_Node.Properties.Items[this.cbb_Node.SelectedIndex].ToString();
                condition += " and G.NODENAME like '%" + nodename + "%' ";
            }

            if (this.cbb_Teacher.SelectedIndex != -1)
            {
                string teachername = this.cbb_Teacher.Properties.Items[this.cbb_Teacher.SelectedIndex].ToString();
                condition += " and D.NAME like '%" + teachername + "%' ";
            }

            if (this.cbb_Class.SelectedIndex != -1)
            {
                string classname = this.cbb_Class.Properties.Items[this.cbb_Class.SelectedIndex].ToString();
                condition += " and H.CLASSNAME like '%" + classname + "%' ";
            }

            if (this.cbb_Stuno.SelectedIndex != -1)
            {
                string stuno = this.cbb_Stuno.Properties.Items[this.cbb_Stuno.SelectedIndex].ToString();
                condition += " and C.STUNO like '%" + stuno + "%' ";
            }

            if (this.te_studentname.Text.Length > 0)
            {
                string stuname = this.te_studentname.Text;
                condition += " and C.NAME like '%" + stuname + "%' ";
            }

            if (this.ce_In.Checked == true && this.ce_Out.Checked == false)
            {
                condition += " and left(I.ENTNAME,2) like '%校内%'";
            }
            else if (this.ce_In.Checked == false && this.ce_Out.Checked == true)
            {
                condition += " and left(I.ENTNAME,2) not like '%校内%'";
            }

            BLL.STU_WORKFLOW stuworkflowBll = new BLL.STU_WORKFLOW();
            this.gridControl1.DataSource = stuworkflowBll.GetList(condition).Tables[0];
            this.gridView1.BestFitColumns();
            DBUtility.ToolHelper.DrawRowIndicator(gridView1, 50);
            DBUtility.ToolHelper.SetLineColorofGridView(this.gridView1);
        }