public override void Execute(INotification notification) { UsersProxy usersProxy = (UsersProxy)Facade.RetrieveProxy(UsersProxy.NAME); LoginVO user = (LoginVO)notification.Body; //if(usersProxy.CheckLogin(userInfo)) //{ // SendNotification(LoginFacade.LOGIN_SUCCESSFUL, null, null); //} //else //{ // SendNotification(LoginFacade.LOGIN_FAIL, null, null); //} GameMain.instance.bmob.Login <LoginVO>(user.username, user.password, (resp, exception) => { if (exception != null) { string info = "登录失败, 失败原因为: " + exception.Message; SendNotification(LoginFacade.LOGIN_FAIL, info, null); return; } string msg = "登录成功, @" + resp.username + "$[" + resp.sessionToken + "]"; SendNotification(LoginFacade.LOGIN_SUCCESSFUL, msg, null); }); }
public AddNewOfferViewModel() { //ustawianie początkowych wartości dla dat _startDate = DateTime.Now; _endDate = DateTime.Now; AddCommand = new DelegateCommand(async x => await AddAsync()); usersProxy = new UsersProxy(); offersProxy = new OffersProxy(); }
public HistoryViewModel() { this.offersProxy = new OffersProxy(); this.offerInfoesProxy = new OfferInfoesProxy(); this.placesProxy = new PlacesProxy(); this.addressesProxy = new AddressesProxy(); this.usersProxy = new UsersProxy(); CurrentOffersList = null; (App.Current as App).Login += (x, e) => { CurrentOffersList = null; OnPropertyChanged(nameof(CurrentOffersList)); }; }
public override void Execute(INotification notification) { UsersProxy usersProxy = (UsersProxy)Facade.RetrieveProxy(UsersProxy.NAME); LoginVO userInfo = (LoginVO)notification.Body; if (usersProxy.CheckLogin(userInfo)) { SendNotification(LoginFacade.LOGIN_SUCCESSFUL, null, null); } else { SendNotification(LoginFacade.LOGIN_FAIL, null, null); } }
public OffersViewModel() { RemoveCommand = new DelegateCommand(async x => await RemoveAsync()); EditCommand = new DelegateCommand(x => Edit()); this.offersProxy = new OffersProxy(); this.offerInfoesProxy = new OfferInfoesProxy(); this.PlacesProxy = new PlacesProxy(); this.addressesProxy = new AddressesProxy(); this.usersProxy = new UsersProxy(); CurrentOffersList = null; (App.Current as App).Login += (x, e) => { CurrentOffersList = null; OnPropertyChanged(nameof(CurrentOffersList)); }; }
public override void Execute(INotification notification) { UsersProxy usersProxy = (UsersProxy)Facade.RetrieveProxy(UsersProxy.NAME); LoginVO user = (LoginVO)notification.Body; GameMain.instance.bmob.Signup <LoginVO>(user, (resp, exception) => { if (exception != null) { string info = "注册失败, 失败原因为: " + exception.Message; SendNotification(LoginFacade.LOGIN_SUCCESSFUL, info, null); return; } string msg = "注册成功!"; SendNotification(LoginFacade.LOGIN_SUCCESSFUL, msg, null); }); }