예제 #1
0
        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;
        }
예제 #2
0
 public KUserView GetBalance(KUser arg)
 {
     return new KUserView
     {
         Mobile = arg.Mobile,
         Balance = _service.GetBalance(arg.Mobile)
     };
 }
예제 #3
0
 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));
 }