private string value_Validate(string name, VarientType type, string value)
        {
            GlobalVarients gvs = new GlobalVarients();

            gvs.Add(new GlobalVarient(name, type, value));

            ScriptHelper sh = new ScriptHelper();

            sh.AddScript(sh.VarientString(gvs));
            sh.References.Add(ExecutePath + "UFIDA.U8.UAP.Services.ReportData.dll");
            sh.References.Add(ExecutePath + "UFIDA.U8.UAP.Services.ReportElements.dll");
            sh.References.Add(ExecutePath + "UFIDA.U8.UAP.Services.ReportFilterService.dll");
            sh.OutputAssembly = null;
            CompilerResults cr = sh.Compile();

            if (cr.Errors.Count > 0)
            {
                return(UFIDA.U8.UAP.Services.ReportResource.U8ResService.GetResString("U8.UAP.Services.ReportElements.Tx10", System.Threading.Thread.CurrentThread.CurrentUICulture.Name));
            }

            try
            {
                ITest test = ((ITest)ScriptHelper.FindInterface(cr.CompiledAssembly, "UFIDA.U8.UAP.Services.DynamicReportComponent.DRCtmp.Global"));
                test.DataHelper = _datahelper;
                test.Test();
            }
            catch
            {
                return(UFIDA.U8.UAP.Services.ReportResource.U8ResService.GetResString("U8.UAP.Services.ReportElements.Tx11", System.Threading.Thread.CurrentThread.CurrentUICulture.Name));
            }
            return("");
        }
Beispiel #2
0
        public object ExecuteScalar(string sql, VarientType type)
        {
            DataSet ds = _datahelper.Exec(sql);

            if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
            {
                if (type == VarientType.SQL_DateTime)
                {
                    return(NullValue.DateTime);
                }
                else if (type == VarientType.SQL_Decimal)
                {
                    return(NullValue.Decimal);
                }
                else
                {
                    return(NullValue.String);
                }
            }
            else
            {
                return(ds.Tables[0].Rows[0][0]);
            }
        }
Beispiel #3
0
 private GlobalVarient(SerializationInfo info, StreamingContext context)
 {
     _name  = info.GetString("Name");
     _type  = (VarientType)info.GetValue("Type", typeof(VarientType));
     _value = info.GetString("Value");
 }
Beispiel #4
0
 public GlobalVarient(GlobalVarient gv)
 {
     _name  = gv.Name;
     _type  = gv.Type;
     _value = gv.Value;
 }
Beispiel #5
0
 public GlobalVarient(string name, VarientType type, string value)
 {
     _name  = name;
     _type  = type;
     _value = value;
 }