Exemplo n.º 1
0
 /// <summary>
 /// 删除数据方法
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 private bool deleteData(int id)
 {
     try
     {
         BLL.STUDENT_JOBSTATUS stujobstatusBll = new BLL.STUDENT_JOBSTATUS();
         stujobstatusBll.Delete(id);
         return(true);
     }
     catch (Exception exception)
     {
         MessageBox.Show("删除失败!", exception.Message);
         return(false);
     }
 }
Exemplo n.º 2
0
        private void readData()
        {
            BLL.STUDENT_JOBSTATUS   stujobstatusBll = new BLL.STUDENT_JOBSTATUS();
            Model.STUDENT_JOBSTATUS stujobstatusMdl = new Model.STUDENT_JOBSTATUS();

            BLL.STUDENT_INFO   studentBll = new BLL.STUDENT_INFO();
            Model.STUDENT_INFO studentMdl = new Model.STUDENT_INFO();

            if (this._statusno > 0 || this._stuno.Length > 0)
            {
                stujobstatusMdl = stujobstatusBll.GetModel(_statusno);
                if (stujobstatusMdl == null)   //新增就业记录功能时
                {
                    blankData();
                    studentMdl           = studentBll.GetModel(_stuno, "1");
                    this.te_stuno.Text   = studentMdl.STUNO;
                    this.te_stuname.Text = studentMdl.NAME;
                }
                else                   //修改就业记录功能时
                {
                    stujobstatusMdl      = stujobstatusBll.GetModel(this._statusno);
                    this.te_stuno.Text   = stujobstatusMdl.STUNO;
                    studentMdl           = studentBll.GetModel(stujobstatusMdl.STUNO, "1");
                    this.te_stuname.Text = studentMdl.NAME;

                    BLL.ENTERPRISE_INFO   entBll = new BLL.ENTERPRISE_INFO();
                    Model.ENTERPRISE_INFO entMdl = new Model.ENTERPRISE_INFO();
                    entMdl = entBll.GetModel((int)stujobstatusMdl.ENTNO);
                    this.cbb_entname.Text = entMdl.ENTNAME;
                    this.te_jobtitle.Text = stujobstatusMdl.JOBTITLE;
                    this.te_salary.Text   = stujobstatusMdl.SALARY.ToString();
                    this.cbb_status.Text  = stujobstatusMdl.STATUS;
                    if (stujobstatusMdl.IF_CURRENT == 0)
                    {
                        this.cbb_ifcurrent.Text = "未就业";
                    }
                    else
                    {
                        this.cbb_ifcurrent.Text = "已就业";
                    }
                    this.dt_statustime.Text = stujobstatusMdl.STATUSTIME.ToString();
                    this.te_memo.Text       = stujobstatusMdl.MEMO;
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// flag:1——根据学生学号查询;2——根据输入条件查询
        /// </summary>
        /// <param name="flag"></param>
        private void readData(int flag, string stuno)
        {
            string condition = "";

            BLL.STUDENT_JOBSTATUS stujobstatusBll = new BLL.STUDENT_JOBSTATUS();
            if (flag == 1)
            {
                condition += " and B.stuno = '" + stuno + "'";
                this.gridControl1.DataSource = stujobstatusBll.GetList(condition).Tables[0];
            }
            else if (flag == 2)
            {
                if (this.te_stuno.Text.Length > 0)
                {
                    condition += " and B.stuno like '%" + this.te_stuno.Text + "%'";
                }

                if (this.te_stuname.Text.Length > 0)
                {
                    condition += " and B.name like '%" + this.te_stuname.Text + "%'";
                }

                if (this.cbb_ifcurrent.SelectedIndex != -1)
                {
                    if (this.cbb_ifcurrent.Text == "已就业")
                    {
                        condition += " and A.IF_CURRENT = 1 ";
                    }
                    else
                    {
                        condition += " and A.IF_CURRENT = 0 ";
                    }
                }
                condition += " order by STATUSTIME";
                this.gridControl1.DataSource = stujobstatusBll.GetList(condition, 1).Tables[0];
            }

            this.gridView1.BestFitColumns();
            DBUtility.ToolHelper.DrawRowIndicator(gridView1, 40);
            DBUtility.ToolHelper.SetLineColorofGridView(this.gridView1);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 保存方法
        /// </summary>
        /// <returns></returns>
        private bool saveData()
        {
            try
            {
                BLL.STUDENT_JOBSTATUS   stujobstatusBll = new BLL.STUDENT_JOBSTATUS();
                Model.STUDENT_JOBSTATUS stujobstatusMdl = new Model.STUDENT_JOBSTATUS();

                if (this.cbb_entname.SelectedIndex != -1)
                {
                    BLL.ENTERPRISE_INFO   entBll = new BLL.ENTERPRISE_INFO();
                    Model.ENTERPRISE_INFO entMdl = new Model.ENTERPRISE_INFO();
                    entMdl = entBll.GetModel(this.cbb_entname.Properties.Items[this.cbb_entname.SelectedIndex].ToString());
                    stujobstatusMdl.ENTNO = entMdl.ENTNO;
                }
                else
                {
                    stujobstatusMdl.ENTNO = 1;
                }
                stujobstatusMdl.STUNO    = this.te_stuno.Text;
                stujobstatusMdl.JOBTITLE = this.te_jobtitle.Text;
                stujobstatusMdl.SALARY   = ToolHelper.ConvertToInt(this.te_salary.Text);
                stujobstatusMdl.STATUS   = this.cbb_status.Text;
                if (this.cbb_ifcurrent.Text == "未就业")
                {
                    stujobstatusMdl.IF_CURRENT = 0;
                }
                else
                {
                    stujobstatusMdl.IF_CURRENT = 1;
                }
                stujobstatusMdl.STATUSTIME = ToolHelper.ConvertToDateTime(this.dt_statustime.Value);
                stujobstatusMdl.MEMO       = this.te_memo.Text;


                if (this.cbb_status.Text == "")
                {
                    MessageBox.Show("就业状态不能为空!", "提示信息");
                    return(false);
                }

                if (this.cbb_ifcurrent.Text == "")
                {
                    MessageBox.Show("是否就业不能为空!", "提示信息");
                    return(false);
                }

                if (this._enumStatus == StatusClass.AddNew)  //新增班级
                {
                    stujobstatusBll.Add(stujobstatusMdl);
                    return(true);
                }
                else if (this._enumStatus == StatusClass.Edit)  //修改班级
                {
                    stujobstatusMdl.STATUSNO = this._statusno;
                    stujobstatusBll.Update(stujobstatusMdl);
                    return(true);
                }
                return(true);
            }
            catch (Exception exception)
            {
                MessageBox.Show("保存失败!", exception.Message);
                return(false);
            }
        }