private void ShowInfo(int id) { WFunctionStepBB functionStepBB = new WFunctionStepBB(); vWFunctionStepData model = new vWFunctionStepData(); try { model = functionStepBB.GetVModel(id); this.functionNo.Text = model.functionNo; this.stepNo.Text = model.stepNo.ToString(); this.seq.Text = model.seq.ToString(); this.stepNm.Text = model.stepNm; this.doEmp.Text = model.doEmp; this.isUseEmpDo.Text = model.isUseEmpDo.ToString(); this.isUseEmpLeaderDo.Text = model.isUseEmpLeaderDo.ToString(); this.condition.Text = model.condition; } finally { functionStepBB.Dispose(); } }
/// <summary> /// �õ�һ����ͼmodel /// </summary> /// <param name="id">����ֵ</param> /// <returns>model</returns> public vWFunctionStepData GetVModel(int id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select * from vWFunctionStep"); strSql.Append(" where id = @id "); SqlParameter[] parameters = { new SqlParameter("@id", SqlDbType.Int) }; parameters[0].Value = id; vWFunctionStepData model = new vWFunctionStepData(); DataSet ds = SqlHelper.ExecuteDataset(this.connection, this.transaction, CommandType.Text, strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { DataRow row = ds.Tables[0].Rows[0]; if (row["id"] != DBNull.Value) { model.id = Convert.ToInt32(row["id"]); } if (row["functionNo"] != DBNull.Value) { model.functionNo = Convert.ToString(row["functionNo"]); } if (row["stepNo"] != DBNull.Value) { model.stepNo = Convert.ToInt32(row["stepNo"]); } if (row["seq"] != DBNull.Value) { model.seq = Convert.ToInt32(row["seq"]); } if (row["stepNm"] != DBNull.Value) { model.stepNm = Convert.ToString(row["stepNm"]); } if (row["doEmp"] != DBNull.Value) { model.doEmp = Convert.ToString(row["doEmp"]); } if (row["isUseEmpDo"] != DBNull.Value) { model.isUseEmpDo = Convert.ToBoolean(row["isUseEmpDo"]); } if (row["isUseEmpLeaderDo"] != DBNull.Value) { model.isUseEmpLeaderDo = Convert.ToBoolean(row["isUseEmpLeaderDo"]); } if (row["condition"] != DBNull.Value) { model.condition = Convert.ToString(row["condition"]); } if (row["remark"] != DBNull.Value) { model.remark = Convert.ToString(row["remark"]); } if (row["coordinateX"] != DBNull.Value) { model.coordinateX = Convert.ToInt32(row["coordinateX"]); } if (row["coordinateY"] != DBNull.Value) { model.coordinateY = Convert.ToInt32(row["coordinateY"]); } if (row["functionNm"] != DBNull.Value) { model.functionNm = Convert.ToString(row["functionNm"]); } if (row["functionUrl"] != DBNull.Value) { model.functionUrl = Convert.ToString(row["functionUrl"]); } if (row["functionChangeUrl"] != DBNull.Value) { model.functionChangeUrl = Convert.ToString(row["functionChangeUrl"]); } if (row["useEmpField"] != DBNull.Value) { model.useEmpField = Convert.ToString(row["useEmpField"]); } if (row["auditEmpIdField"] != DBNull.Value) { model.auditEmpIdField = Convert.ToString(row["auditEmpIdField"]); } if (row["auditDtField"] != DBNull.Value) { model.auditDtField = Convert.ToString(row["auditDtField"]); } if (row["workFlowStateField"] != DBNull.Value) { model.workFlowStateField = Convert.ToString(row["workFlowStateField"]); } if (row["workFlowSeqField"] != DBNull.Value) { model.workFlowSeqField = Convert.ToString(row["workFlowSeqField"]); } if (row["auditMarkField"] != DBNull.Value) { model.auditMarkField = Convert.ToString(row["auditMarkField"]); } if (row["auditDegreeField"] != DBNull.Value) { model.auditDegreeField = Convert.ToString(row["auditDegreeField"]); } if (row["changeWindowHeight"] != DBNull.Value) { model.changeWindowHeight = Convert.ToInt32(row["changeWindowHeight"]); } if (row["changeWindowWidth"] != DBNull.Value) { model.changeWindowWidth = Convert.ToInt32(row["changeWindowWidth"]); } if (row["windowHeight"] != DBNull.Value) { model.windowHeight = Convert.ToInt32(row["windowHeight"]); } if (row["windowWidth"] != DBNull.Value) { model.windowWidth = Convert.ToInt32(row["windowWidth"]); } if (row["isAutoAudit"] != DBNull.Value) { model.isAutoAudit = Convert.ToBoolean(row["isAutoAudit"]); } if (row["isDraw"] != DBNull.Value) { model.isDraw = Convert.ToBoolean(row["isDraw"]); } if (row["workflowNm"] != DBNull.Value) { model.workflowNm = Convert.ToString(row["workflowNm"]); } if (row["workTableNm"] != DBNull.Value) { model.workTableNm = Convert.ToString(row["workTableNm"]); } if (row["recordKeyField"] != DBNull.Value) { model.recordKeyField = Convert.ToString(row["recordKeyField"]); } if (row["keyIsInt"] != DBNull.Value) { model.keyIsInt = Convert.ToBoolean(row["keyIsInt"]); } if (row["titleField"] != DBNull.Value) { model.titleField = Convert.ToString(row["titleField"]); } if (row["itemNo"] != DBNull.Value) { model.itemNo = Convert.ToString(row["itemNo"]); } if (row["isRun"] != DBNull.Value) { model.isRun = Convert.ToBoolean(row["isRun"]); } if (row["stopMark"] != DBNull.Value) { model.stopMark = Convert.ToString(row["stopMark"]); } return model; } else { return null; } }