///<summary>Constructs the ObjFormEhrMeasures fro use with late binding.</summary> private static void constructObjFormEhrMeasuresHelper() { string dllPathEHR=ODFileUtils.CombinePaths(Application.StartupPath,"EHR.dll"); ObjFormEhrMeasures=null; AssemblyEHR=null; if(File.Exists(dllPathEHR)) {//EHR.dll is available, so load it up AssemblyEHR=Assembly.LoadFile(dllPathEHR); Type type=AssemblyEHR.GetType("EHR.FormEhrMeasures");//namespace.class ObjFormEhrMeasures=Activator.CreateInstance(type); return; } #if EHRTEST ObjFormEhrMeasures=new FormEhrMeasures(); #endif }
public static bool QuarterlyKeyIsValid(string year, string quarter, string practiceTitle, string qkey) { try{ #if EHRTEST //This pattern allows the code to compile without having the EHR code available. return(FormEhrMeasures.QuarterlyKeyIsValid(year, quarter, practiceTitle, qkey)); #else constructObjFormEhrMeasuresHelper(); Type type = AssemblyEHR.GetType("EHR.FormEhrMeasures"); //namespace.class object[] args = new object[] { year, quarter, practiceTitle, qkey }; return((bool)type.InvokeMember("QuarterlyKeyIsValid", System.Reflection.BindingFlags.InvokeMethod, null, ObjFormEhrMeasures, args)); #endif } catch { return(false); } }
public static bool ProvKeyIsValid(string lName, string fName, bool hasReportAccess, string provKey) { try{ #if EHRTEST //This pattern allows the code to compile without having the EHR code available. return(FormEhrMeasures.ProvKeyIsValid(lName, fName, hasReportAccess, provKey)); #else constructObjFormEhrMeasuresHelper(); Type type = AssemblyEHR.GetType("EHR.FormEhrMeasures"); //namespace.class object[] args = new object[] { lName, fName, hasReportAccess, provKey }; return((bool)type.InvokeMember("ProvKeyIsValid", System.Reflection.BindingFlags.InvokeMethod, null, ObjFormEhrMeasures, args)); #endif } catch { return(false); } }