Пример #1
0
        public ActionResult Default(UserSentTL entity, string ToMsisdn, int creditIndex)
        {
            try
            {
                bool ServiceRequestStatus = false;

                TlGonderModel   model   = new TlGonderModel();
                TLGonderHandler handler = new TLGonderHandler();
                model.serviceData = handler.PrepareData(ToMsisdn, creditIndex);
                model.serviceData = handler.PrepareData(TLGonderHandler.TLGonderMethod.POST);

                if (model.serviceData != null)
                {
                    ServiceRequestStatus = true;
                }

                if (ServiceRequestStatus == true)
                {
                    entity.UserId = UserFb.Data.Id.ToString();
                    repository.SaveAndCommit(entity);

                    return(PartialResultSuccess("RequestSuccess"));
                }
                else
                {
                    return(PartialResultError("SentTLError"));
                }
            }
            catch (Exception)
            {
                return(PartialResultError());
            }
        }
Пример #2
0
        public PartialViewResult Default(string UserId)
        {
            TlGonderModel   model   = new TlGonderModel();
            TLGonderHandler handler = new TLGonderHandler();

            model.serviceData = handler.PrepareData(TLGonderHandler.TLGonderMethod.GET);

            var friend = UserFb.Friends.Where(u => u.UserId == Convert.ToInt32(UserId)).FirstOrDefault();

            ViewBag.FbId          = friend.FbId;
            ViewBag.Picture       = friend.Picture.Data.Url;
            ViewBag.FirstNameView = friend.FirstNameView;
            ViewBag.LastNameView  = friend.LastNameView;
            ViewBag.Msisdn        = friend.Msisdn;

            return(PartialView(model));
        }