public virtual bool DeleteAnObjectInTran(object _obj) { bool result; try { bool flag = true; if (_obj == null) { throw new Exception("DeleteAnObjectInTran:实体对象为空"); } DbParameter[] array = null; string text = this.MakeDeleteSql(_obj, out array); this.SetParameterValues(_obj, array); if (DS_SqlHelper.AppDbTransaction == null) { throw new Exception("DeleteAnObjectInTran:DrectSoft.DSSqlHelper.DS_SqlHelper没有创建事务!"); } DS_SqlHelper.ExecuteNonQueryInTran(text, array, CommandType.Text); result = flag; } catch (Exception ex) { throw ex; } return(result); }
public static void InsertConsultationRecordDept(string consultApplySn, string orderValue, string hospitalCode, string departmentCode, string departmentName, string employeeCode, string employeeName, string employeeLevelID, string createUser, string createTime) { try { DS_SqlHelper.CreateSqlHelper(); SqlParameter[] sqlParam = new SqlParameter[] { new SqlParameter("@ConsultA pplySn", SqlDbType.Decimal), new SqlParameter("@OrderValue", SqlDbType.Decimal), new SqlParameter("@HospitalCode", SqlDbType.VarChar), new SqlParameter("@DepartmentCode", SqlDbType.VarChar), new SqlParameter("@DepartmentName", SqlDbType.VarChar), new SqlParameter("@EmployeeCode", SqlDbType.VarChar), new SqlParameter("@EmployeeName", SqlDbType.VarChar), new SqlParameter("@EmployeeLevelID", SqlDbType.VarChar), new SqlParameter("@CreateUser", SqlDbType.VarChar), new SqlParameter("@CreateTime", SqlDbType.VarChar), }; if (consultApplySn.Trim() == "") { sqlParam[0].Value = 0f; } else { sqlParam[0].Value = Convert.ToInt32(consultApplySn); } if (orderValue.Trim() == "") { sqlParam[1].Value = 0; } else { sqlParam[1].Value = Convert.ToInt32(orderValue); } sqlParam[2].Value = hospitalCode; sqlParam[3].Value = departmentCode; sqlParam[4].Value = departmentName; sqlParam[5].Value = employeeCode; sqlParam[6].Value = employeeName; sqlParam[7].Value = employeeLevelID; sqlParam[8].Value = createUser; sqlParam[9].Value = createTime; DS_SqlHelper.ExecuteNonQueryInTran("EMR_CONSULTATION.usp_InsertConsultationRecord", sqlParam, CommandType.StoredProcedure); } catch (Exception) { throw; } }