protected virtual void DispatcheredLoginControlConnected(object sender, EventArgs e) { ScreenControl s; #if !KAC s = new OperatorSymmaryDemoScreen(GlobalObjects.CasEnvironment.Operators[0]); #else s = new OperatorSummaryScreen(GlobalObjects.CasEnvironment.Operators[0]); #endif #if RELEASE try { #endif referenceLoginControl.DisplayObject( new ReferenceEventArgs(s, ReflectionTypes.DisplayInNew, GlobalObjects.CasEnvironment.Operators[0].Name)); //referenceLoginControl.DisplayObject( // new ReferenceEventArgs(new DispatcheredAircraftCollectionScreen(), ReflectionTypes.DisplayInNew, // "Operators")); #if RELEASE } catch { throw new Exception("Failed to connect to database. See UILoginPage.dispatcheredLoginControl_Connected"); } #endif }
protected virtual void DispatcheredLoginControlConnected(object sender, EventArgs e) { ScreenControl s; var isCAA = (bool)sender; if (isCAA) { if (GlobalObjects.CaaEnvironment.IdentityUser.OperatorId <= 0) { s = new OperatorSymmaryCAADemoScreen(GlobalObjects.CaaEnvironment.Operators[0]); } else { var op = GlobalObjects.CaaEnvironment.AllOperators.FirstOrDefault(i => i.ItemId == GlobalObjects.CaaEnvironment.IdentityUser.OperatorId); if (op != null) { s = new CurrentOperatorSymmaryCAADemoScreen(op); } else { throw new Exception("Operator not found!"); } } } else { s = new OperatorSymmaryDemoScreen(GlobalObjects.CasEnvironment.Operators[0]); } #if RELEASE try { #endif referenceLoginControl.DisplayObject( new ReferenceEventArgs(s, ReflectionTypes.DisplayInNew, GlobalObjects.CasEnvironment?.Operators[0].Name ?? "CAA")); //referenceLoginControl.DisplayObject( // new ReferenceEventArgs(new DispatcheredAircraftCollectionScreen(), ReflectionTypes.DisplayInNew, // "Operators")); #if RELEASE } catch { throw new Exception("Failed to connect to database. See UILoginPage.dispatcheredLoginControl_Connected"); } #endif }