public KUser CreateUser(TwilioRequest trequest) { var u = new KUser { Mobile = trequest.From, Email = _bodyParser.GetSwitchValue("#EMAIL",trequest.Body) }; //var uid = (long)_session.Save(u); u = _session.Get<KUser>((long)_session.Save(u)); var l = new Ledger { KUserId = u.KUserId, MessageSid = trequest.MessageSid, Money = 10, Description = "Opening bonus", TransactionType = "CR" }; _session.Save(l); return u; }
public KUserView GetBalance(KUser arg) { return new KUserView { Mobile = arg.Mobile, Balance = _service.GetBalance(arg.Mobile) }; }
public KUser CreateUser(string mobile) { var u = new KUser { Mobile = String.Format("+1{0:##########}", mobile), }; //_kUserFetcher.GetKUser((long)_session.Save(u)); var ue = _session.QueryOver<KUser>().Where(x => x.Mobile == u.Mobile).List().FirstOrDefault(); return ue ?? _session.Get<KUser>((long)_session.Save(u)); }