public ActionResult UserProfile(string userName)
        {
            ClientDetailInfo clientDetailInfo = repo.getOneUserDetailInfo(userName);

            //  Client loginUser = context.Clients.Find(User.Identity.Name);
            //ViewBag.loginUserProfile = loginUser.profile;
            ViewBag.interests = repo.getAllInterests();
            return(View(clientDetailInfo));
        }
        public ActionResult UploadProfileImage(HttpPostedFileBase photo, ClientDetailInfo updateClientInfo)
        {
            string message = updateUserProfile(photo, updateClientInfo.client.UserName);

            ViewBag.Message = message;
            return(RedirectToAction("UserProfile", new
            {
                userName = updateClientInfo.client
                           .UserName
            }));
        }
Пример #3
0
        //get one client Detial Info, including interests
        public ClientDetailInfo getOneUserDetailInfo(string id)
        {
            Client        client    = db.Clients.Find(id);
            List <string> interests = new List <string>();

            interests = (from c_i in db.ClientInterests where c_i.UserName == client.UserName
                         select c_i.Interest1.interest1).ToList();

            ClientDetailInfo ClientDetailinfo = new ClientDetailInfo(client, interests);

            return(ClientDetailinfo);
        }
        public ActionResult UserProfile(Client client, HttpPostedFileBase photo, string[] interests, string country, string state)
        {
            if (photo != null)
            {
                updateUserProfile(photo, client.UserName);
                if (!updateUserProfile(photo, client.UserName).Contains("successful"))
                {
                    ViewBag.uploadPhotoError = updateUserProfile(photo, client.UserName);

                    ClientDetailInfo clientDetailInfo = repo.getOneUserDetailInfo(client.UserName);
                    ViewBag.interests = repo.getAllInterests();
                    return(View(clientDetailInfo));
                }
            }

            repo.updatgeProfile(client, interests, country, state);

            return(RedirectToAction("UserProfile", new { userName = client.UserName }));
        }
Пример #5
0
 public void AddClient(ClientDetailInfo client)
 {
     _clientList.Add(client);
 }