/// <summary> /// 查询数据 /// </summary> private void readData() { if (this._entno > 0) { BLL.ENTERPRISE_INFO entBll = new BLL.ENTERPRISE_INFO(); Model.ENTERPRISE_INFO entMdl = new Model.ENTERPRISE_INFO(); entMdl = entBll.GetModel(_entno); if (entMdl == null) //新增专业功能时 { blankData(); } else //修改专业功能时 { this.te_entname.Text = entMdl.ENTNAME; this.te_entaddr.Text = entMdl.ENTADDRESS; this.te_linker1.Text = entMdl.LINKER1; this.te_phone1.Text = entMdl.PHONE1; this.te_linker2.Text = entMdl.LINKER2; this.te_phone2.Text = entMdl.PHONE2; this.te_linker3.Text = entMdl.LINKER3; this.te_phone3.Text = entMdl.PHONE3; this.te_memo.Text = entMdl.MEMO; this.te_demand.Text = entMdl.DEMAND; } } }
/// <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> /// <returns></returns> private bool saveData() { try { BLL.ENTERPRISE_INFO entBll = new BLL.ENTERPRISE_INFO(); Model.ENTERPRISE_INFO entMdl = new Model.ENTERPRISE_INFO(); if (this.te_entname.Text == "") { MessageBox.Show("企业名称不能为空!", "提示信息"); return(false); } if (this._enumStatus == StatusClass.AddNew) //新增专业 { entMdl.ENTNAME = te_entname.Text; entMdl.ENTADDRESS = te_entaddr.Text; entMdl.LINKER1 = te_linker1.Text; entMdl.LINKER2 = te_linker2.Text; entMdl.LINKER3 = te_linker3.Text; entMdl.PHONE1 = te_phone1.Text; entMdl.PHONE2 = te_phone2.Text; entMdl.PHONE3 = te_phone2.Text; entMdl.MEMO = te_memo.Text; entMdl.DEMAND = te_demand.Text; entBll.Add(entMdl); return(true); } else if (this._enumStatus == StatusClass.Edit) //修改专业 { entMdl.ENTNO = this._entno; entMdl.ENTNAME = te_entname.Text; entMdl.ENTADDRESS = te_entaddr.Text; entMdl.LINKER1 = te_linker1.Text; entMdl.LINKER2 = te_linker2.Text; entMdl.LINKER3 = te_linker3.Text; entMdl.PHONE1 = te_phone1.Text; entMdl.PHONE2 = te_phone2.Text; entMdl.PHONE3 = te_phone2.Text; entMdl.MEMO = te_memo.Text; entMdl.DEMAND = te_demand.Text; entBll.Update(entMdl); return(true); } return(true); } catch (Exception exception) { MessageBox.Show("保存失败!", exception.Message); return(false); } }
/// <summary> /// 初始化所有用人单位列表 /// </summary> private void init_ent() { Student.BLL.ENTERPRISE_INFO entBll = new BLL.ENTERPRISE_INFO(); DataSet ds = entBll.GetAllList(); this.cbb_ent.Properties.Items.Clear(); cbb_ent.EditValue = null; cbb_ent.Properties.NullText = "--请选择--"; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string entName = ds.Tables[0].Rows[i]["ENTNAME"].ToString(); this.cbb_ent.Properties.Items.Add(entName); } //this.cbb_ent.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; }
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; } } }
/// <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); } }