protected double GetFromHistory(string key) { int result = 0; cls_IPSIAPI api = new PSI_API.cls_IPSIAPIClass(); var loginInfo = new typLoginInfo { strUser = @"Suser", strPassword = @"Superuser", strUserClass = @"Suser", strView = @"psidisplay" }; try { api.vbLogin(loginInfo); DateTime now = DateTime.Now; var values = api.vbGetStdValues(key, now, "MI5", 13); foreach (PSI_API.typeValue value in values) { if (!IsValueUnknwon(value.Wert)) { api.vbLogout(); return(value.Wert); } } values = api.vbGetStdValues(key, now, "H1", 24); foreach (PSI_API.typeValue value in values) { if (!IsValueUnknwon(value.Wert)) { api.vbLogout(); return(value.Wert); } } api.vbLogout(); } catch (COMException e) { } return(-1); }
protected double GetFromHistory(string key, String mode) { int result = 0; cls_IPSIAPI api = new PSI_API.cls_IPSIAPIClass(); try { var loginInfo = new typLoginInfo { strUser = @"Suser", strPassword = @"Superuser", strUserClass = @"Suser", strView = @"psidisplay" }; api.vbLogin(loginInfo); DateTime now = DateTime.Now; var values = api.vbGetStdValues(key, now, "MI5", 13); foreach (PSI_API.typeValue value in values) { bool isOk = false; if (mode == "general") { isOk = !IsValueUnknwonGeneral(value.Wert); } if (mode == "pik") { isOk = !IsValueUnknwonPIK(value.Wert); } if (mode == "sltm") { isOk = !IsValueUnknwonSLTM(value.Wert); } if (isOk) { api.vbLogout(); return(value.Wert); } } values = api.vbGetStdValues(key, now, "H1", 24); foreach (PSI_API.typeValue value in values) { bool isOk = false; if (mode == "general") { isOk = !IsValueUnknwonGeneral(value.Wert); } if (mode == "pik") { isOk = !IsValueUnknwonPIK(value.Wert); } if (mode == "sltm") { isOk = !IsValueUnknwonSLTM(value.Wert); } if (isOk) { api.vbLogout(); return(value.Wert); } } api.vbLogout(); } catch (COMException e) { } return(-1); }