public static IBusinessLogicLayerPX GetUniqueInstance() { if (uniqueInstance == null) { uniqueInstance = new BusinessLogicLayerPXTest(); } return(uniqueInstance); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.OrderList); bll = BLLBuilder.GetBLLClass(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Get our button from the layout resource, // and attach an event to it //Button button = FindViewById<Button>(Resource.Id.myButton); //button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); }; logicConnection = BLLBuilder.GetBLLClass(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "order" layout resource SetContentView(Resource.Layout.OrderLayout); // Create your application here bll = BLLBuilder.GetBLLClass(); orderId = Intent.GetStringExtra("OrderId"); if (orderId == null) { this.Finish(); } // Create your application here bll = BLLBuilder.GetBLLClass(); }
/// <summary> /// Checks the authentication. /// </summary> /// <param name="getResponse">Function to get the response from the server.</param> /// <param name="proc">Function to execute if the user is authenticated.</param> /// <exception cref="UnauthorizedAccessException">If user is not authenticated.</exception> /// TODO only throw exception when user is not authenticate (only one status code) public static void CheckAuthentication(GetResponse getResponse, AuthorizedProcedure proc, IBusinessLogicLayerPX bll) { var res = getResponse(); var resultMessage = new { message = "" }; var str = res.Content.ReadAsStringAsync().Result; resultMessage = JsonConvert.DeserializeAnonymousType(res.Content.ReadAsStringAsync().Result, resultMessage); if (!res.IsSuccessStatusCode) { bll.ResetUser(); throw new UnauthorizedAccessException(resultMessage.message); } else { proc(res); } }