public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
		{
			SharpQuerySchemaClassCollection tmp= value as SharpQuerySchemaClassCollection;
			
			if (destinationType == typeof (ParameterCollection)) {
				ParameterCollection a = new ParameterCollection();
				foreach (SharpQueryParameter par in tmp){
					SqlParameter reportPar =  new SqlParameter (par.Name,
					                               par.DataType,					                
					                               String.Empty,
					                               par.Type);
					reportPar.ParameterValue = par.Value.ToString();
					a.Add(reportPar);
				}
				return a;
			}
			return base.ConvertTo(context, culture, value, destinationType);
		}
示例#2
0
		SqlParameterCollection CreateSqlParameters(IProcedure procedure)
		{
			SqlParameterCollection col = new SqlParameterCollection();
			SqlParameter par = null;
			foreach (var element in procedure.Items) {
				DbType dbType = TypeHelpers.DbTypeFromStringRepresenation(element.DataType);
				par	 = new SqlParameter(element.Name,dbType,"",ParameterDirection.Input);
				
				if (element.ParameterMode == ParameterMode.In) {
					par.ParameterDirection = ParameterDirection.Input;
					
				} else if (element.ParameterMode == ParameterMode. InOut){
					par.ParameterDirection = ParameterDirection.InputOutput;
				}
				col.Add(par);
			}
			return col;
		}
示例#3
0
		private static void SetSqlParam (IReportModel model,SqlParameter param)
		{
			var p = model.ReportSettings.SqlParameters.Find(param.ParameterName);
			if (p != null) {
				p.ParameterValue = param.ParameterValue;
			}
		}
示例#4
0
		private static void SetSqlParam (IReportModel model,SqlParameter param)
		{
			Console.WriteLine("ReportEngine:SetSqlparameters");
			var p = model.ReportSettings.SqlParameters.Find(param.ParameterName);
			if (p != null) {
				p.ParameterValue = param.ParameterValue;
			}
		}