/// <summary> /// Get all PoE's in descening order /// </summary> /// <returns></returns> public JsonResult GetAllPoEs() { var common = new SignupClient(); var returnValue = common.GetAllPoEs().OrderByDescending(a => a.POEId); return(JsonResponse(returnValue)); }
//public JsonResult Notifications() //{ // if (Session["id"] != null) // { // var commonWcfClient = new CommonWCF.CommonClient(); // var notificationResult = commonWcfClient.GetUserNotifications(int.Parse(Session["id"].ToString()), int.Parse(Session["subid"].ToString())); // } // return JsonResponse(); //} //[SessionExpireFilter] public ActionResult Start(string userId) { //For pipe9 cloud development if (userId != null) { var usr = Convert.ToInt32(DecryptString(userId)); var signUp = new SignupClient(); var suser = signUp.GetUserById(usr); Session["user"] = suser; var loggeduserName = suser.FirstName + " " + suser.LastName; ViewData["username"] = loggeduserName; Session["Uname"] = loggeduserName; Session["emailid"] = suser.EmailAddress; Session["id"] = usr; Session["domain"] = suser.EmailAddress.Split('@')[1]; Session["subid"] = -1; } if (Session["id"] != null) { var commonWcfClient = new CommonWCF.CommonClient(); var notificationResult = commonWcfClient.GetUserNotifications(int.Parse(Session["id"].ToString()), int.Parse(Session["subid"].ToString())); ViewBag.notificationResult = notificationResult; } var common = new CommonClient(); byte[] userImage = common.GetUserPhoto(int.Parse(Session["id"].ToString())).Photo; ViewBag.userImage = userImage; Session["DashboardMappingId"] = null; Session["GivenClick"] = null; return(View()); }
public JsonResult IsExpired(int id) { var trailPrd = int.Parse(ConfigurationManager.AppSettings["trailPrd"].ToString()); var common = new SignupClient(); var network = common.GetNetworkById(id); if (network != null) { if (network.Plan == 1) { if (network.CreatedOn.AddDays(trailPrd) < DateTime.Now) { return(JsonResponse(true)); } else { return(JsonResponse(false)); } } else { return(JsonResponse(false)); } } else { return(JsonResponse(false)); } }
/// <summary> /// Get the selected PoE's /// </summary> /// <param name="poeid">PoEid</param> /// <returns></returns> public JsonResult GetSelectedPoe(int poeid) { var common = new SignupClient(); var returnValue = common.GetAllPoEs().FirstOrDefault(a => a.POEId == poeid); return(JsonResponse(returnValue)); }
public JsonResult GetSelectedPoe() { var common = new SignupClient(); var returnValue = common.GetAllPoEs().FirstOrDefault(a => a.POEId == int.Parse(Session["SelectedPoe"].ToString())); return(JsonResponse(returnValue)); }
public void SetSelectNetwork(int id) { Session["subid"] = id; SignupClient common = new SignupClient(); var network = common.GetNetworkById(id); Session["network"] = network; }
public void SetNetwork(int id, string curl) { Session["subid"] = id; var common = new SignupClient(); var network = common.GetNetworkById(id); Session["network"] = network; Session["SelectedPoe"] = null; Response.Redirect(curl); }
/// <summary> /// Add selected PoE /// </summary> /// <param name="poeId">PoeId</param> /// <param name="plan">Plan ID</param> //[SessionExpireFilter] public void AddSelectedPoe(int poeId, int plan) { if (Session["paidOrTrial"] == "trial" && plan == 2) { if (int.Parse(Session["Mode"].ToString()) == 1) { Session["CurrentMode"] = 2; } } if (plan == 1) { Session["paidOrTrial"] = "trial"; } else if (plan == 2) { Session["paidOrTrial"] = "paid"; } else if (plan == 3) { Session["paidOrTrial"] = "MicrosoftCorprate"; } var subscribedPoes = (POE[])Session["SubscribedPoes"]; var selectedPoesPoes = (POE[])Session["SelectedPoes"]; var common = new SignupClient(); var returnValue = common.GetAllPoEs().FirstOrDefault(a => a.POEId == poeId); if (subscribedPoes != null) { if (subscribedPoes.Count(a => a.POEId == poeId) == 0) { Array.Resize(ref subscribedPoes, subscribedPoes.Length + 1); subscribedPoes[subscribedPoes.Length - 1] = returnValue; if (selectedPoesPoes != null) { Array.Resize(ref selectedPoesPoes, selectedPoesPoes.Length + 1); selectedPoesPoes[selectedPoesPoes.Length - 1] = returnValue; } else { Array.Resize(ref selectedPoesPoes, 1); selectedPoesPoes[0] = returnValue; } } } else { Array.Resize(ref subscribedPoes, 1); subscribedPoes[0] = returnValue; Array.Resize(ref selectedPoesPoes, 1); selectedPoesPoes[0] = returnValue; } Session["SelectedPoes"] = selectedPoesPoes; Session["SubscribedPoes"] = subscribedPoes; }
public ActionResult Login(bool?guest, int?type, int?rfor, int?from, int?fbid, int?poeid, int?poemode, int?poeplan, string poeidstr) { POE[] subscribedPoes = (POE[])Session["SubscribedPoes"]; POE[] selectedPoesPoes = (POE[])Session["SelectedPoes"]; var mode = Session["Mode"]; var plan = Session["paidOrTrial"]; object yammercont = null; if (Session["YammerSignUp"] != null) { yammercont = Session["YammerSignUp"]; } Session.Clear(); ViewBag.errormsg = ""; if (mode != null && int.Parse(mode.ToString()) != 0) { Session["SubscribedPoes"] = subscribedPoes; Session["SelectedPoes"] = selectedPoesPoes; Session["Mode"] = mode; Session["paidOrTrial"] = plan; Session["YammerSignUp"] = yammercont; } if (poemode != null) { Session["Mode"] = poemode; Session["paidOrTrial"] = poeplan == 1 ? "trial" : "paid"; var common = new SignupClient(); var poevalues = poeidstr.Split('$'); var poelist = new POE[poevalues.Length]; var returnValue = common.GetAllPoEs().OrderByDescending(a => a.POEId); for (int i = 0; i < poevalues.Length; i++) { poelist[i] = returnValue.Where(a => a.POEId.Equals(int.Parse(poevalues[i]))).First(); } Session["SubscribedPoes"] = poelist; Session["SelectedPoes"] = poelist; } // Session.Abandon(); if (guest.HasValue) { var request = new LoginRequest { IsGuest = guest.GetValueOrDefault(), Type = type.GetValueOrDefault(), RequestFor = rfor.GetValueOrDefault(), RequestFrom = @from.GetValueOrDefault(), FeedbackId = fbid.GetValueOrDefault(), PoeId = poeid.GetValueOrDefault() }; Session["request"] = request; } return(View()); }
public async Task SignUpWithFacebookAsync(string facebookId, string facebookToken) { LoggerService.Instance.Log("Account.SignUpWithFacebookAsync..."); var error = string.Empty; var success = false; if (!SignedIn) { var response = await SignupClient.SignupWithFacebook(facebookId, facebookToken); if (response != null) { if (response.Success) { var newUser = response.Data.ToObject <User>(); newUser.Name = newUser.FirstName + " " + newUser.LastName; UserInfo = newUser; UserStoreService.Instance.SaveUserCredentials(UserInfo); success = true; await FetchUserCreditsAsync(); } else { error = response.ErrorMessageClean; } } else { error = "There was an error signing up with Facebook"; } } else { error = "Please log out before attempting to sign up"; } if (!string.IsNullOrEmpty(error)) { LoggerService.Instance.Log("ERROR: Account.SignUpWithFacebookAsync: " + error); } else { LoggerService.Instance.Log("Account.SignUpWithFacebookAsync: success"); } OnPropertyChanged("SignedIn"); await Fire_OnSignInComplete(success, error, true, SignInAErrorType.AccountCreationError); }
public JsonResult IsMySubscription(int id) { var common = new SignupClient(); var network = common.GetNetworkById(id); if (network != null && network.EmailId == Session["emailid"].ToString()) { return(JsonResponse(true)); } else { return(JsonResponse(false)); } }
public JsonResult HomeSignUp(string mailid) { // Session["HomeSignUp"] = mailid; // return JsonResponse(mailid); SignupClient common = new SignupClient(); var result = common.CheckEmailId(mailid); if (!result) { Session["HomeSignUp"] = mailid; } return(JsonResponse(result)); }
public JsonResult OwnNetworkUser() { var common = new CommonClient(); var commonSignup = new SignupClient(); if (Session["emailid"] != null) { var ownsub = common.GetOwnNetwork(Session["emailid"].ToString()); return(JsonResponse(ownsub)); } else { return(null); } }
//public void SavePhoto(string imgId) //{ // SignupClient common = new SignupClient(); // byte[] img = null; // if (!string.IsNullOrEmpty(imgId)) // { // var imgHandler = new ImageHandler(); // img = imgHandler.GetImage(imgId, System.Web.HttpContext.Current); // SignUpWCF.User user = new SignUpWCF.User(); // user.UserId = int.Parse(Session["id"].ToString()); // user.Photo = img; // sr.User = user; // common.UpdateUserPhoto(sr); // } //} public JsonResult SavePhoto(string imgId) { SignupClient common = new SignupClient(); // byte[] img = null; if (!string.IsNullOrEmpty(imgId)) { //var imgHandler = new ImageHandler(); //img = imgHandler.GetImage(imgId, System.Web.HttpContext.Current); //img = System.IO.File.ReadAllBytes(imgId); byte[] img = Convert.FromBase64String(imgId.Split(',')[1]); SignUpWCF.User user = new SignUpWCF.User(); user.UserId = int.Parse(Session["id"].ToString()); user.Photo = img; sr.User = user; common.UpdateUserPhoto(sr); } return(JsonResponse(true)); }
public JsonResult GetSubscribedPoes() { if (Session != null && Session["Members"] != null) { Session["Members"] = null; } var common = new SignupClient(); POE[] returnValue = null; if (Session != null && Session["subid"] != null) { if (Session["SubscribedPoes"] == null) { returnValue = common.GetSubscribedPoes(int.Parse(Session["subid"].ToString())); Session["SubscribedPoes"] = returnValue; } } return(JsonResponse(returnValue)); }
public JsonResult GetOwnNetwork() { var common = new CommonClient(); var commonSignup = new SignupClient(); if (Session["emailid"] != null) { var ownsub = common.GetOwnNetwork(Session["emailid"].ToString()); if (ownsub != null) { Session["subid"] = ownsub.Subscriptionid; var network = commonSignup.GetNetworkById(ownsub.Subscriptionid); Session["network"] = network; } return(JsonResponse(ownsub)); } else { return(null); } }
/// <summary> /// Get PoE for Dropdown /// </summary> /// <returns></returns> //[SessionExpireFilter] public JsonResult GetSelectedDropDownPoe() { var common = new SignupClient(); var subscribedPoes = (POE[])Session["SubscribedPoes"]; var OldsubscribedPoes = (POE[])Session["SubscribedPoes"]; if (int.Parse(Session["Mode"].ToString()) != 0) { OldsubscribedPoes = common.GetSubscribedPoes(int.Parse(Session["subid"].ToString())); Session["SelectedPoes"] = null; if (subscribedPoes != null) { var intialSubscriber = subscribedPoes; for (var k = 0; k < subscribedPoes.Length; k++) { for (var l = 0; l < OldsubscribedPoes.Length; l++) { if (subscribedPoes[k].POEId == OldsubscribedPoes[l].POEId) { var poeid = subscribedPoes[k].POEId; intialSubscriber = (from m in intialSubscriber where m.POEId != poeid select m).ToArray(); } } } Session["SelectedPoes"] = intialSubscriber; POE[] allnew = intialSubscriber.Union(OldsubscribedPoes).ToArray(); Session["SelectAllPoe"] = allnew; return(JsonResponse(allnew.Reverse())); } } else { return(JsonResponse(subscribedPoes.Reverse())); } return(null); }
/// <summary> /// Get Selected PoE /// </summary> /// <returns></returns> //[SessionExpireFilter] public JsonResult GetSelectedPoes() { var subscribedPoes = (POE[])Session["SubscribedPoes"]; //if (Session["Subid"] == null || int.Parse(Session["Subid"].ToString()) != -1) //{ if (subscribedPoes != null) { if (Session["PoeAddMode"] != null && int.Parse(Session["PoeAddMode"].ToString()) != 2) { Session["SelectedPoes"] = subscribedPoes; } return(JsonResponse(subscribedPoes.Reverse())); } else { if (int.Parse(Session["Mode"].ToString()) == 1 || int.Parse(Session["Mode"].ToString()) == 2 || int.Parse(Session["Mode"].ToString()) == 4) { var common = new SignupClient(); subscribedPoes = common.GetSubscribedPoes(int.Parse(Session["subid"].ToString())); //var common = new SignupClient(); //subscribedPoes = common.GetSubscribedPoesList(int.Parse(Session["id"].ToString()), int.Parse(Session["subid"].ToString())); Session["SubscribedPoes"] = subscribedPoes; return(JsonResponse(subscribedPoes.Reverse())); } else { return(null); } } //} //else //{ // return null; //} }
private ActionResult AuthenticatedUser(AuthenticationWCF.User loggedinUser) { var trailPrd = int.Parse(ConfigurationManager.AppSettings["trailPrd"].ToString()); var feedback = new FeedbackServiceClient(); var common = new SignupClient(); var suser = common.GetUserById(loggedinUser.UserId); Session["user"] = suser; var loggeduserName = loggedinUser.FirstName + " " + loggedinUser.LastName; ViewData["username"] = loggeduserName; Session["Uname"] = loggeduserName; Session["emailid"] = loggedinUser.EmailAddress; Session["id"] = loggedinUser.UserId; Session["domain"] = loggedinUser.EmailAddress.Split('@')[1]; var request = (LoginRequest)Session["request"]; var userSub = new CommonClient(); var ownsub = userSub.GetMySubscription(Session["emailid"].ToString()).FirstOrDefault(); if (request != null) { if (request.IsGuest) { FeedbackWCF.UserPOEMapping user = new FeedbackWCF.UserPOEMapping(); user = feedback.GetUserdetailsByMappingId(request.RequestFor); CreatedFeedback[] createdFb = new CreatedFeedback[] { new CreatedFeedback { FeedBackId = request.FeedbackId, Teammember = user, } }; Session["CreatedFeedbacks"] = createdFb; Session["SelectedPoe"] = request.PoeId; if (request.Type == 4) { return(RedirectToAction("CustomerFeedback", "Feedback")); } else { Session["errormsg"] = "You don't have the permission"; return(RedirectToAction("Login", "Home")); } } else { Session["errormsg"] = "You don't have the permission"; return(RedirectToAction("Login", "Home")); } } else { CommonClient commonnetwrok = new CommonClient(); CommonWCF.Network networkresult = commonnetwrok.GetDefaultUserSubscription(loggedinUser.EmailAddress); if (networkresult != null) { SignUpWCF.Network network = common.GetNetworkById(networkresult.Subscriptionid); if (network.Plan == 1) { //if (network.CreatedOn.AddDays(trailPrd) < DateTime.Now) //{ // if (network.EmailId == loggedinUser.EmailAddress) // { // return RedirectToAction("Account", "Home"); // } // else // { // var userSubscription = // commonnetwrok.GetUserSubscriptions(loggedinUser.EmailAddress).FirstOrDefault // ( // a => a.Subscriptionid != networkresult.Subscriptionid); // if (userSubscription != null) // { // Session["subid"] = -1;// userSubscription.Subscriptionid; // Session["network"] = null;// userSubscription; // if (Session["Mode"] != null && int.Parse(Session["Mode"].ToString()) == 5 && ownsub != null && Session["SelectedPoes"] != null) // { // Session["subid"] = ownsub.Subscriptionid; // SetSelectNetwork(ownsub.Subscriptionid); // return RedirectToAction("AddMember", "Signup", new { task = "add", resource = "dd" }); // } // else // { // Session["CartList"] = null; // return RedirectToAction("Start", "Home"); // //Response.Redirect("/signup/new/Add"); // } // } // else // { // Session["errormsg"] = "Your Account has been Inactive"; // return RedirectToAction("Login", "Home"); // } // } //} //else //{ Session["subid"] = networkresult.Subscriptionid; Session["network"] = network; if (Session["Mode"] != null && int.Parse(Session["Mode"].ToString()) == 5 && ownsub != null && Session["SelectedPoes"] != null) { SetSelectNetwork(ownsub.Subscriptionid); Session["subid"] = ownsub.Subscriptionid; return(RedirectToAction("AddMember", "Signup", new { task = "add", resource = "dd" })); } else { Session["CartList"] = null; return(RedirectToAction("Start", "Home")); //Response.Redirect("/signup/new/Add"); } // } } else { Session["subid"] = -1; // networkresult.Subscriptionid; Session["network"] = null; // network; if (Session["Mode"] != null && int.Parse(Session["Mode"].ToString()) == 5 && ownsub != null && Session["SelectedPoes"] != null) { SetSelectNetwork(ownsub.Subscriptionid); Session["subid"] = ownsub.Subscriptionid; Session["CartList"] = null; return(RedirectToAction("AddMember", "Signup", new { task = "add", resource = "dd" })); } else { Session["CartList"] = null; return(RedirectToAction("Start", "Home")); //Response.Redirect("/signup/new/Add"); } } } else { Session["errormsg"] = "You don't have the permission"; return(RedirectToAction("Login", "Home")); } } /* ViewData["fullname"] = ((AuthenticationResult)Session["UserDetail"]).currentUser.FirstName + " " + * ((AuthenticationResult)Session["UserDetail"]).currentUser.LastName; * ViewData["userid"] = ((AuthenticationResult)Session["UserDetail"]).currentUser.UserId.ToString().Trim(); * return View("Default");*/ //Response.Redirect("../client/Default.aspx"); }
public async Task SignUpAsync(string userName, string userPassword, string email) { try { LoggerService.Instance.Log("Account.SignUpAsync..."); IsLoading = true; var error = string.Empty; var success = false; if (!SignedIn) { var response = await SignupClient.SignupWithCredentials(userName, email, userPassword); if (response != null) { if (response.Success) { var newUser = response.Data.ToObject <User>(); newUser.Name = newUser.FirstName + " " + newUser.LastName; UserStoreService.Instance.SaveUserCredentials(newUser); UserInfo = newUser; success = true; await FetchUserCreditsAsync(); } else if (response.ErrorCode == ErrorCodes.DATA_ERROR && !userName.Contains(" ")) { error = "Please enter your First and Last Name"; } else if (!string.IsNullOrEmpty(response.ErrorMessageClean)) { error = response.ErrorMessageClean; } } else { error = "There was an error signing up"; } } else { error = "Please log out before attempting to sign up"; } if (!string.IsNullOrEmpty(error)) { LoggerService.Instance.Log("ERROR: Account.SignUpAsync: " + error); } else { LoggerService.Instance.Log("Account.SignUpAsync: success"); FacebookToolsService.Instance.LogCustomEvent("AccountCreated"); } OnPropertyChanged("SignedIn"); await Fire_OnSignInComplete(success, error, true, SignInAErrorType.AccountCreationError); } catch (ThrottleException ex) { await Application.Current.MainPage.DisplayAlert("Error", ex.Message, "OK"); } finally { IsLoading = false; } }
/// <summary> /// Get the newly added PoE's /// </summary> /// <returns></returns> //[SessionExpireFilter] public JsonResult GetNewlyAddedPoes() { var subscribedPoes = (POE[])Session["SelectedPoes"]; if (subscribedPoes != null && subscribedPoes.Length != 0 && int.Parse(Session["Mode"].ToString()) != 0) { if (Session["HomePoeMode"] != null) { var loadallpoe = (POE[])Session["SelectAllPoe"]; return(JsonResponse(loadallpoe.Reverse())); } else if (int.Parse(Session["Mode"].ToString()) != 0 && Session["HomePoeMode"] == null) { var loadallpoe = (POE[])Session["SelectAllPoe"]; var common = new CommonClient(); var mySubscription = common.GetMySubscription(Session["emailid"].ToString()); var length = mySubscription.Count(); if (mySubscription[0].Plan == 1) { return(JsonResponse(loadallpoe.Reverse())); } else { return(JsonResponse(subscribedPoes.Reverse())); } } } else if (int.Parse(Session["Mode"].ToString()) == 2 || (int.Parse(Session["Mode"].ToString()) == 1 && Session["paidOrTrial"] == "trial")) { var common = new SignupClient(); var returnValue = common.GetSubscribedPoes(int.Parse(Session["subid"].ToString())); Session["SelectedPoes"] = returnValue; return(JsonResponse(returnValue)); } else if (Session["HomePoeMode"] != null) { var loadallpoe = (POE[])Session["SelectAllPoe"]; return(JsonResponse(loadallpoe.Reverse())); } else if ((Session["YammerMembers"] != null && Session["paidOrTrial"] == "trial") || (Session["YammerMembers"] != null && Session["paidOrTrial"] == "paid" && Session["CurrentMode"] != null && int.Parse(Session["CurrentMode"].ToString()) == 2)) { var loadallpoe = (POE[])Session["SelectAllPoe"]; return(JsonResponse(loadallpoe.Reverse())); } else if (int.Parse(Session["Mode"].ToString()) == 1 && Session["paidmode"] != null) { var common = new SignupClient(); var returnValue = common.GetSubscribedPoes(int.Parse(Session["subid"].ToString())); Session["SelectedPoes"] = returnValue; return(JsonResponse(returnValue)); } else { var subscribedPoesList = (POE[])Session["SelectedPoes"]; return(JsonResponse(subscribedPoesList.Reverse())); } return(null); }
public JsonResult LoadUserPlan() { Session["Mode"] = 0; SignupClient getalluser = new SignupClient(); var networkdata = getalluser.GetMyAllUsers(int.Parse(Session["id"].ToString()), int.Parse(Session["subid"].ToString())); CommonClient common = new CommonClient(); var returnValue = common.GetMySubscription(Session["emailid"].ToString()).FirstOrDefault(); var planid = 0; if (Session["paidOrTrial"] == null) { planid = returnValue.Plan; if (returnValue.Plan == 2) { Session["paidOrTrial"] = "paid"; } else { Session["paidOrTrial"] = "trial"; if (Session["YammerMembers"] == null) { Session["YammerMembers"] = networkdata; } } } else { if (Session["paidOrTrial"] == "paid") { planid = 2; } else { if (Session["YammerMembers"] == null) { Session["YammerMembers"] = networkdata; } planid = 1; } } var yammerUsrCount = 0; var usercounts = 0; if (Session["YammerMembers"] != null) { UserPOEMapping[] sesiondata = (UserPOEMapping[])Session["YammerMembers"]; for (var i = 0; i < sesiondata.Count(); i++) { for (var j = 0; j < networkdata.Count(); j++) { if (networkdata[j].User.EmailAddress == sesiondata[i].User.EmailAddress) { usercounts = usercounts + 1; break; } } } var subUser = (SignUpWCF.User)Session["user"]; for (var i = 0; i < sesiondata.Count(); i++) { if (sesiondata[i].User.EmailAddress == subUser.EmailAddress) { usercounts = usercounts + 1; break; } } yammerUsrCount = sesiondata.Count(); } var yammerDetail = new NetworkYammerDetail(); yammerDetail.Usercount = networkdata.Count(); yammerDetail.Planid = planid; yammerDetail.yammerUserCount = yammerUsrCount - usercounts; //Session["CartList"] = (networkdata.Count() + yammerUsrCount) - usercounts; return(JsonResponse(yammerDetail)); }