Пример #1
0
        public object doUnpublish(ProfileViewModel profileViewModel)
        {
            var usernameSession = HttpContext.Session.GetString(Startup.Username_sess);

            if (!string.IsNullOrEmpty(usernameSession))
            {
                if (profileBusiness.UnPublishProfileService(profileViewModel, usernameSession))
                {
                    ModelState.Clear();
                    showprofile(profileViewModel);//fetch profile data after save
                    ViewBag.SuccessRegister = "Profile has been unpublished successfully.";
                }
                else
                {
                    ViewBag.ErrorRegister = "Some problem occurred while unpublishing profile!";
                }
            }
            else
            {
                ViewBag.ErrorRegister = "Your session has expired!";
            }
            return(View("~/Views/Profile/ProfileView.cshtml", profileViewModel));
        }