/// <summary> /// 将页面值塞入到实体中 /// </summary> private QCScoreType_DataEntity SetEntity() { string messagestr = ""; if (this.txttypename.Text.Trim() == "") { messagestr += "请填写项目名称!"; } if (this.txttypeinstruction.Text.Trim() == "") { messagestr += "请填写项目说明!"; } if (this.cmbtypecategory.SelectedIndex == -1) { messagestr += "请选择项目类型!"; } if (messagestr != "") { m_app.CustomMessageBox.MessageShow(messagestr); return(null); } QCScoreType_DataEntity scoreType = new QCScoreType_DataEntity(); scoreType.Typename = this.txttypename.Text; scoreType.Typeinstruction = this.txttypeinstruction.Text; scoreType.Typecategory = this.cmbtypecategory.SelectedIndex; scoreType.Typeorder = (int)this.txttypeorder.Value; scoreType.Typememo = this.txttypememo.Text; return(scoreType); }
private void btnSave_Click(object sender, EventArgs e) { QCScoreType_DataEntity socretypeentity = SetEntity(); if (socretypeentity == null) { return; } string edittype = ""; //表示为新增 if (m_ScoreType == null) { edittype = "0"; } else { edittype = "1"; socretypeentity.Typecode = m_ScoreType.Typecode; } SqlManger m_sqlmanger = new SqlManger(m_app); m_sqlmanger.EditQCTypeScore(edittype, socretypeentity); m_app.CustomMessageBox.MessageShow("保存成功!"); ISRefresh = true; this.Close(); }
/// <summary> /// 将实体中值填写到页面中 /// </summary> /// <param name="scoreType"></param> private void BinPageByEntity(QCScoreType_DataEntity scoreType) { if (scoreType != null) { this.txttypename.Text = scoreType.Typename; this.txttypeinstruction.Text = scoreType.Typeinstruction; this.cmbtypecategory.SelectedIndex = scoreType.Typecategory; this.txttypeorder.Value = scoreType.Typeorder; this.txttypememo.Text = scoreType.Typememo; } }
/// <summary> /// 大项目代码实体赋值 /// </summary> /// <param name="dataRow"></param> /// <returns></returns> private QCScoreType_DataEntity FillQCTypeValue2Entity(DataRow dataRow) { QCScoreType_DataEntity scoreType = null; if (dataRow != null) { scoreType = new QCScoreType_DataEntity(); scoreType.Typecode = dataRow["TypeCode"].ToString(); scoreType.Typename = dataRow["TypeName"].ToString(); scoreType.Typeinstruction = dataRow["TypeInstruction"].ToString(); scoreType.Typecategory = int.Parse(dataRow["TypeCategory"].ToString()); scoreType.Typeorder = int.Parse(dataRow["TypeOrder"].ToString()); scoreType.Typememo = dataRow["TypeMemo"].ToString(); } return(scoreType); }
private void simpleButton1_Click(object sender, EventArgs e) { m_scoretype = null; BindDataSource(); }