/// <summary> /// 将手术信息实体中值加载到页面 /// </summary> /// <param name="operInfoEntity"></param> private void SetPageValue(OperInfoEntity operInfoEntity) { if (operInfoEntity == null || operInfoEntity.Id == "") { return; } this.txtID.Text = operInfoEntity.Id.Trim(); this.txtMapID.Text = operInfoEntity.Mapid.Trim(); this.txtName.Text = operInfoEntity.Name.Trim(); this.txtPy.Text = operInfoEntity.Py.Trim(); this.txtWb.Text = operInfoEntity.Wb.Trim(); this.cmbValid.SelectedIndex = operInfoEntity.Valid; this.txtMemo.Text = operInfoEntity.Memo.Trim(); this.lookUpEditorsslb.CodeValue = operInfoEntity.Sslb.ToString().Trim(); }
/// <summary> /// 将页面控件的值加入到实体 /// </summary> /// <returns></returns> private OperInfoEntity SetEntityByPageValue() { OperInfoEntity operInfoEntity = new OperInfoEntity(); operInfoEntity.Id = this.txtID.Text.Trim(); operInfoEntity.Mapid = this.txtMapID.Text.Trim(); operInfoEntity.Name = this.txtName.Text.Trim(); operInfoEntity.Py = this.txtPy.Text.Trim(); operInfoEntity.Wb = this.txtWb.Text.Trim(); operInfoEntity.Valid = 1; //this.cmbValid.SelectedIndex; operInfoEntity.Memo = this.txtMemo.Text.Trim(); operInfoEntity.Sslb = lookUpEditorsslb.CodeValue.Trim(); return(operInfoEntity); }
/// <summary> /// 将gridview中对应行值加载到实体中 /// </summary> /// <param name="dr"></param> /// <returns></returns> private OperInfoEntity SetEntityByDataRow(DataRow dr) { if (dr == null) { return(null); } OperInfoEntity operInfoEntity = new OperInfoEntity(); operInfoEntity.Id = dr["Id"].ToString(); operInfoEntity.Mapid = dr["Mapid"].ToString(); operInfoEntity.Name = dr["Name"].ToString(); operInfoEntity.Py = dr["Py"].ToString(); operInfoEntity.Wb = dr["Wb"].ToString(); operInfoEntity.Valid = Convert.ToInt32(dr["Valid"].ToString() == "" ? "0" : dr["Valid"].ToString()); operInfoEntity.Memo = dr["Memo"].ToString(); operInfoEntity.Sslb = dr["Sslb"].ToString(); return(operInfoEntity); }
/// <summary> /// 保存手术信息 /// </summary> /// <param name="operInfoEntity"></param> /// <returns></returns> private bool SaveOperInfo(OperInfoEntity operInfoEntity) { try { string edittype = ""; if (m_EditState == EditState.Add) { edittype = "1"; } else { edittype = "2"; } m_SqlManager.SaveOperInfo(operInfoEntity, edittype); return(true); } catch (Exception e) { return(false); } }