Пример #1
0
 public ActionResult LoadEwalletActivityPartial()
 {
     User _User = (User)Session["User"];
     Api.Invitation.Invitation ApiInvitation = new Api.Invitation.Invitation(); 
     Api.Affiliates.Affiliates ApiAffiliates = new Api.Affiliates.Affiliates();
     List<Domain.Socioboard.Domain.Invitation> lstInvite = (List<Domain.Socioboard.Domain.Invitation>)(new JavaScriptSerializer().Deserialize(ApiInvitation.GetInvitedDataOfAcceotedUser(_User.Id.ToString()), typeof(List<Domain.Socioboard.Domain.Invitation>)));
     return PartialView("_EwalletActivityPartial", lstInvite);
 }
Пример #2
0
        public ActionResult SMSServices()
        {
            User _User = (User)Session["User"];

            Api.Invitation.Invitation ApiInvitation = new Api.Invitation.Invitation();
            List <Domain.Socioboard.Domain.Invitation> lstInvite = (List <Domain.Socioboard.Domain.Invitation>)(new JavaScriptSerializer().Deserialize(ApiInvitation.GetAllInvitedDataOfUser(_User.Id.ToString()), typeof(List <Domain.Socioboard.Domain.Invitation>)));

            return(View("Affiliates", lstInvite));
        }
Пример #3
0
        public ActionResult LoadEwalletActivityPartial()
        {
            User _User = (User)Session["User"];

            Api.Invitation.Invitation ApiInvitation = new Api.Invitation.Invitation();
            Api.Affiliates.Affiliates ApiAffiliates = new Api.Affiliates.Affiliates();
            List <Domain.Socioboard.Domain.Invitation> lstInvite = (List <Domain.Socioboard.Domain.Invitation>)(new JavaScriptSerializer().Deserialize(ApiInvitation.GetInvitedDataOfAcceotedUser(_User.Id.ToString()), typeof(List <Domain.Socioboard.Domain.Invitation>)));

            return(PartialView("_EwalletActivityPartial", lstInvite));
        }
Пример #4
0
 public ActionResult LoadEwalletActivityPartial()
 {
     string datetime = Helper.Extensions.ToClientTime(DateTime.UtcNow);
     //string datetime = Request.Form["localtime"].ToString();
     ViewBag.datetime = datetime;
     User _User = (User)Session["User"];
     Api.Invitation.Invitation ApiInvitation = new Api.Invitation.Invitation();
     Api.Affiliates.Affiliates ApiAffiliates = new Api.Affiliates.Affiliates();
     List<Domain.Socioboard.Domain.Invitation> lstInvite = (List<Domain.Socioboard.Domain.Invitation>)(new JavaScriptSerializer().Deserialize(ApiInvitation.GetInvitedDataOfAcceotedUser(_User.Id.ToString()), typeof(List<Domain.Socioboard.Domain.Invitation>)));
     return PartialView("_EwalletActivityPartial", lstInvite);
 }
Пример #5
0
 public ActionResult Affiliates()
 {
     if (Session["Paid_User"] != null && Session["Paid_User"].ToString() == "Unpaid")
     {
         return(RedirectToAction("Billing", "PersonalSetting"));
     }
     else
     {
         User _User = (User)Session["User"];
         Api.Invitation.Invitation ApiInvitation = new Api.Invitation.Invitation();
         List <Domain.Socioboard.Domain.Invitation> lstInvite = (List <Domain.Socioboard.Domain.Invitation>)(new JavaScriptSerializer().Deserialize(ApiInvitation.GetAllInvitedDataOfUser(_User.Id.ToString()), typeof(List <Domain.Socioboard.Domain.Invitation>)));
         return(View("Affiliates", lstInvite));
     }
 }
Пример #6
0
        public ActionResult LoadEwalletActivityPartial()
        {
            string datetime = Helper.Extensions.ToClientTime(DateTime.UtcNow);

            //string datetime = Request.Form["localtime"].ToString();
            ViewBag.datetime = datetime;
            User _User = (User)Session["User"];

            Api.Invitation.Invitation ApiInvitation = new Api.Invitation.Invitation();
            Api.Affiliates.Affiliates ApiAffiliates = new Api.Affiliates.Affiliates();
            List <Domain.Socioboard.Domain.Invitation> lstInvite = (List <Domain.Socioboard.Domain.Invitation>)(new JavaScriptSerializer().Deserialize(ApiInvitation.GetInvitedDataOfAcceotedUser(_User.Id.ToString()), typeof(List <Domain.Socioboard.Domain.Invitation>)));

            return(PartialView("_EwalletActivityPartial", lstInvite));
        }
Пример #7
0
 public ActionResult Affiliates()
 {
     if (Session["Paid_User"] != null && Session["Paid_User"].ToString() == "Unpaid")
     {
         return RedirectToAction("Billing", "PersonalSetting");
     }
     else
     {
         User _User = (User)Session["User"];
         Api.Invitation.Invitation ApiInvitation = new Api.Invitation.Invitation();
         List<Domain.Socioboard.Domain.Invitation> lstInvite = (List<Domain.Socioboard.Domain.Invitation>)(new JavaScriptSerializer().Deserialize(ApiInvitation.GetAllInvitedDataOfUser(_User.Id.ToString()), typeof(List<Domain.Socioboard.Domain.Invitation>)));
         return View("Affiliates", lstInvite);
     }
 }
        public ActionResult UpgradeAccountSuccessful()
        {
            User   objUser     = (User)Session["User"];
            string paidamount  = (string)Session["PaymentAmount"];
            string accountType = (string)Session["AccountType"];

            objUser.PaymentStatus = "Paid";
            objUser.AccountType   = accountType;
            Api.User.User ApiobjUser = new Api.User.User();
            Api.PaymentTransaction.PaymentTransaction objApiPaymentTransaction = new Api.PaymentTransaction.PaymentTransaction();
            if (DateTime.Compare(objUser.ExpiryDate, DateTime.Now) > 0)
            {
                objUser.ExpiryDate = objUser.ExpiryDate.AddDays(30);
            }
            else
            {
                objUser.ExpiryDate = DateTime.Now.AddDays(30);
            }
            int    i = ApiobjUser.UpdateUserAccountInfoByUserId(objUser.Id.ToString(), objUser.AccountType, objUser.ExpiryDate, objUser.PaymentStatus);
            string res_PaymentTransaction = objApiPaymentTransaction.SavePayPalTransaction(objUser.Id.ToString(), paidamount);
            int    ret = ApiobjUser.UpdatePaymentandEwalletStatusByUserId(objUser.Id.ToString(), Session["Ewallet"].ToString(), accountType, "paid");

            objUser.Ewallet          = Session["Ewallet"].ToString();
            objUser.ActivationStatus = "paid";
            Session["User"]          = objUser;
            Api.Invitation.Invitation ApiInvitation = new Api.Invitation.Invitation();
            try
            {
                Domain.Socioboard.Domain.Invitation _Invitation = (Domain.Socioboard.Domain.Invitation)(new JavaScriptSerializer().Deserialize(ApiInvitation.UserInvitedInfo(objUser.Id.ToString()), typeof(Domain.Socioboard.Domain.Invitation)));
                if (_Invitation != null)
                {
                    User  newUser = (User)(new JavaScriptSerializer().Deserialize(ApiobjUser.getUsersById(_Invitation.SenderUserId.ToString()), typeof(User)));
                    float bonus   = (float.Parse(paidamount) * Payment.ReferedAmountDetails(accountType)) / 100;
                    newUser.Ewallet = (float.Parse(newUser.Ewallet) + bonus).ToString();
                    int ret1 = ApiobjUser.UpdatePaymentandEwalletStatusByUserId(newUser.Id.ToString(), newUser.Ewallet, newUser.AccountType, newUser.PaymentStatus);
                    Api.Affiliates.Affiliates ApiAffiliates = new Api.Affiliates.Affiliates();
                    ApiAffiliates.AddAffiliateDetail(newUser.Id.ToString(), objUser.Id.ToString(), DateTime.Now, bonus.ToString());
                }
            }
            catch (Exception ex) { }
            Session["Paid_User"] = "******";
            return(RedirectToAction("Index", "Home"));
        }
Пример #9
0
        public ActionResult InviteFriendByEmail(string EmailId)
        {
            string ret   = string.Empty;
            User   _User = (User)Session["User"];

            Api.User.User             ApiUser       = new Api.User.User();
            Api.Invitation.Invitation ApiInvitation = new Api.Invitation.Invitation();
            //if (ApiUser.CheckEmailId(EmailId) == "NotExist")
            //{
            //if (!ApiInvitation.IsFriendAlreadydInvited(_User.Id.ToString(), EmailId))
            //{
            ret = ApiInvitation.SendInvitationMail(_User.EmailId, _User.UserName, EmailId);
            //}
            //else
            //{
            //    ret = EmailId + " is already Invited";
            //}
            //}
            //else {
            //    ret = EmailId + " is already registered";
            //}
            return(Content(ret));
        }
Пример #10
0
        public ActionResult Signup()
        {
            logger.Error("Register");
            User _user = (User)Session["User"];

            Domain.Socioboard.Domain.User user = new Domain.Socioboard.Domain.User();
            Session["AjaxLogin"] = "******";
            string retmsg = string.Empty;

            try
            {
                System.IO.StreamReader sr = new System.IO.StreamReader(Request.InputStream);
                string line = "";
                line = sr.ReadToEnd();
                JObject jo = JObject.Parse(line);
                user.PaymentStatus = "unpaid";

                user.AccountType = Server.UrlDecode((string)jo["package"]);
                user.CreateDate  = DateTime.Now;
                user.ExpiryDate  = DateTime.Now.AddDays(30);
                user.Id          = Guid.NewGuid();
                user.UserName    = Server.UrlDecode((string)jo["firstname"]) + " " + Server.UrlDecode((string)jo["lastname"]);
                user.EmailId     = Server.UrlDecode((string)jo["email"]);
                user.Password    = Server.UrlDecode((string)jo["password"]);
                user.UserStatus  = 1;
                if (_user != null)
                {
                    if (_user.ActivationStatus == "1") //If Login from Facebook, then ActivationStatus would be 1, refer to FacebookManager Controller
                    {
                        user.ActivationStatus = "1";
                        user.SocialLogin      = _user.SocialLogin;
                        user.ProfileUrl       = _user.ProfileUrl;
                    }
                    else
                    {
                        user.ActivationStatus = "0";
                    }
                }
                else
                {
                    user.ActivationStatus = "0";
                }
                string        firstName  = Server.UrlDecode((string)jo["firstname"]);
                string        lastName   = Server.UrlDecode((string)jo["lastname"]);
                Api.User.User objApiUser = new Api.User.User();
                //string res_Registration = objApiUser.Register(user.EmailId, user.Password, user.AccountType, user.UserName, user.ActivationStatus);
                string res_Registration = string.Empty;
                if (Session["twitterlogin"] != null)
                {
                    if ((string)Session["twitterlogin"] == "twitterlogin")
                    {
                        res_Registration = objApiUser.RegisterbyTwitter(user.EmailId, user.Password, user.AccountType, user.UserName, user.SocialLogin, user.ProfileUrl, user.ActivationStatus);
                    }
                    else
                    {
                        res_Registration = objApiUser.Register(user.EmailId, user.Password, user.AccountType, user.UserName, user.ActivationStatus);
                    }
                }
                else
                {
                    res_Registration = objApiUser.Register(user.EmailId, user.Password, user.AccountType, user.UserName, user.ActivationStatus);
                }
                logger.Error("res_Registration: " + res_Registration);
                if (res_Registration != "Email Already Exists")
                {
                    if (user != null)
                    {
                        Api.User.User obj = new Api.User.User();
                        user            = (User)(new JavaScriptSerializer().Deserialize(obj.Login(user.EmailId, user.Password), typeof(User)));
                        Session["User"] = user;
                        if (Session["fblogin"] != null)
                        {
                            string accesstoken = (string)Session["AccesstokenFblogin"];
                            Api.Facebook.Facebook objfacebook = new Api.Facebook.Facebook();
                            Api.Groups.Groups     objgroup    = new Api.Groups.Groups();
                            //Domain.Socioboard.Domain.Groups group = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(objgroup.GetGroupDetailsByUserId(user.Id.ToString()), typeof(Domain.Socioboard.Domain.Groups)));
                            Groups obpgrp = (Groups)(new JavaScriptSerializer().Deserialize(objgroup.GetGroupDeUserId(user.Id.ToString()), typeof(Groups)));
                            objfacebook.AddFacebookAccountWithloginAsync(accesstoken, user.Id.ToString(), obpgrp.Id.ToString());
                        }
                        if (Session["googlepluslogin"] != null)
                        {
                            string accesstoken             = (string)Session["AccesstokenFblogin"];
                            Api.Youtube.Youtube objYoutube = new Api.Youtube.Youtube();
                            Api.Groups.Groups   objgroup   = new Api.Groups.Groups();
                            //Domain.Socioboard.Domain.Groups group = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(objgroup.GetGroupDetailsByUserId(user.Id.ToString()), typeof(Domain.Socioboard.Domain.Groups)));
                            Groups grp = (Groups)(new JavaScriptSerializer().Deserialize(objgroup.GetGroupDeUserId(user.Id.ToString()), typeof(Groups)));
                            objYoutube.AddYoutubeAccountwithLoginAsync(ConfigurationManager.AppSettings["YtconsumerKey"], ConfigurationManager.AppSettings["YtconsumerSecret"], ConfigurationManager.AppSettings["Ytredirect_uri"], user.Id.ToString(), grp.Id.ToString(), accesstoken);
                        }
                        retmsg = "user";
                    }

                    //Domain.Socioboard.Domain.Invitation _Invitation = (Domain.Socioboard.Domain.Invitation)Session["InvitationInfo"];
                    Api.Invitation.Invitation ApiInvitation = new Api.Invitation.Invitation();
                    if (Session["InvitationCode"] != null)
                    {
                        string invitationcode = Session["InvitationCode"].ToString();
                        ApiInvitation.AddInvitationInfoBycode(invitationcode, user.EmailId, user.Id.ToString());
                    }

                    //if (_Invitation != null)
                    //{
                    //    if (user.EmailId == _Invitation.FriendEmail)
                    //    {
                    //        string ret = ApiInvitation.UpdateInvitatoinStatus(_Invitation.Id.ToString(), user.Id.ToString());
                    //    }
                    //}
                }
                else
                {
                    retmsg = "Email Already Exists";
                }
                //return Content(retmsg);
                Session.Abandon();
                Session.Clear();
                Session.RemoveAll();
            }
            catch (Exception ex)
            {
                //logger.Error(ex.StackTrace);
                Console.WriteLine(ex.StackTrace);
            }
            //return View("_RegistrationPartial");



            return(Content(retmsg));
        }
Пример #11
0
 public ActionResult InviteFriendByEmail(string EmailId)
 {
     string ret = string.Empty;
     User _User = (User)Session["User"];
     Api.User.User ApiUser = new Api.User.User();
     Api.Invitation.Invitation ApiInvitation = new Api.Invitation.Invitation();
     if (ApiUser.CheckEmailId(EmailId) == "NotExist")
     {
         //if (!ApiInvitation.IsFriendAlreadydInvited(_User.Id.ToString(), EmailId))
         //{
         ret = ApiInvitation.SendInvitationMail(_User.EmailId, _User.UserName, EmailId);
         //}
         //else
         //{
         //    ret = EmailId + " is already Invited";
         //}
     }
     else
     {
         ret = EmailId + " is already registered";
     }
     return Content(ret);
 }
Пример #12
0
        public ActionResult Signup()
        {
            logger.Error("Register");
            User _user = (User)Session["User"];

            Domain.Socioboard.Domain.User user = new Domain.Socioboard.Domain.User();
            Session["AjaxLogin"] = "******";
            string retmsg = string.Empty;

            try
            {
                System.IO.StreamReader sr = new System.IO.StreamReader(Request.InputStream);
                string line = "";
                line = sr.ReadToEnd();
                JObject jo = JObject.Parse(line);
                user.PaymentStatus = "unpaid";
                //if (!string.IsNullOrEmpty(Request.QueryString["type"]))
                //{
                //    user.AccountType = Request.QueryString["type"];

                //    ViewBag.DropDownList1 = Request.QueryString["type"];
                //}
                //else
                //{
                //    user.AccountType = "Free";
                //}
                user.AccountType = Server.UrlDecode((string)jo["package"]);
                user.CreateDate  = DateTime.Now;
                user.ExpiryDate  = DateTime.Now.AddMonths(1);
                user.Id          = Guid.NewGuid();
                user.UserName    = Server.UrlDecode((string)jo["firstname"]) + " " + Server.UrlDecode((string)jo["lastname"]);
                user.EmailId     = Server.UrlDecode((string)jo["email"]);
                user.Password    = Server.UrlDecode((string)jo["password"]);
                user.UserStatus  = 1;
                if (_user != null)
                {
                    if (_user.ActivationStatus == "1") //If Login from Facebook, then ActivationStatus would be 1, refer to FacebookManager Controller
                    {
                        user.ActivationStatus = "1";
                    }
                    else
                    {
                        user.ActivationStatus = "0";
                    }
                }
                else
                {
                    user.ActivationStatus = "0";
                }
                string        firstName        = Server.UrlDecode((string)jo["firstname"]);
                string        lastName         = Server.UrlDecode((string)jo["lastname"]);
                Api.User.User objApiUser       = new Api.User.User();
                string        res_Registration = objApiUser.Register(user.EmailId, user.Password, user.AccountType, user.UserName, user.ActivationStatus);
                logger.Error("res_Registration: " + res_Registration);
                if (res_Registration != "Email Already Exists")
                {
                    if (user != null)
                    {
                        Api.User.User obj = new Api.User.User();
                        user            = (User)(new JavaScriptSerializer().Deserialize(obj.Login(user.EmailId, user.Password), typeof(User)));
                        Session["User"] = user;
                        retmsg          = "user";
                    }

                    //Domain.Socioboard.Domain.Invitation _Invitation = (Domain.Socioboard.Domain.Invitation)Session["InvitationInfo"];
                    Api.Invitation.Invitation ApiInvitation = new Api.Invitation.Invitation();
                    //if (Session["InvitationCode"] != null)
                    //{
                    //    string invitationcode = Session["InvitationCode"].ToString();
                    //    ApiInvitation.AddInvitationInfoBycode(invitationcode, user.EmailId, user.Id.ToString());

                    //}

                    //if (_Invitation != null)
                    //{
                    //    if (user.EmailId == _Invitation.FriendEmail)
                    //    {
                    //        string ret = ApiInvitation.UpdateInvitatoinStatus(_Invitation.Id.ToString(), user.Id.ToString());
                    //    }
                    //}
                }
                else
                {
                    retmsg = "Email Already Exists";
                }
                //return Content(retmsg);
            }
            catch (Exception ex)
            {
                //logger.Error(ex.StackTrace);
                Console.WriteLine(ex.StackTrace);
            }
            //return View("_RegistrationPartial");



            return(Content(retmsg));
        }
Пример #13
0
        public ActionResult Signup()
        {
            logger.Error("Register");
            User _user=(User)Session["User"];
            Domain.Socioboard.Domain.User user = new Domain.Socioboard.Domain.User();
            Session["AjaxLogin"] = "******";
            string retmsg = string.Empty;
            try
            {
                System.IO.StreamReader sr = new System.IO.StreamReader(Request.InputStream);
                string line = "";
                line = sr.ReadToEnd();
                JObject jo = JObject.Parse(line);
                user.PaymentStatus = "unpaid";
                //if (!string.IsNullOrEmpty(Request.QueryString["type"]))
                //{
                //    user.AccountType = Request.QueryString["type"];

                //    ViewBag.DropDownList1 = Request.QueryString["type"];
                //}
                //else
                //{
                //    user.AccountType = "Free";
                //}
                user.AccountType = Server.UrlDecode((string)jo["package"]);
                user.CreateDate = DateTime.Now;
                user.ExpiryDate = DateTime.Now.AddMonths(1);
                user.Id = Guid.NewGuid();
                user.UserName = Server.UrlDecode((string)jo["firstname"]) + " " + Server.UrlDecode((string)jo["lastname"]);
                user.EmailId = Server.UrlDecode((string)jo["email"]);
                user.Password = Server.UrlDecode((string)jo["password"]);
                user.UserStatus = 1;
                if (_user != null)
                {
                    if (_user.ActivationStatus == "1") //If Login from Facebook, then ActivationStatus would be 1, refer to FacebookManager Controller
                    {
                        user.ActivationStatus = "1";
                    }
                    else
                    {
                        user.ActivationStatus = "0";
                    }
                }
                else
                {
                    user.ActivationStatus = "0";
                }
                string firstName = Server.UrlDecode((string)jo["firstname"]);
                string lastName = Server.UrlDecode((string)jo["lastname"]);
                Api.User.User objApiUser = new Api.User.User();
                string res_Registration = objApiUser.Register(user.EmailId, user.Password, user.AccountType, user.UserName, user.ActivationStatus);
                logger.Error("res_Registration: "+res_Registration);
                if (res_Registration != "Email Already Exists")
                {
                    if (user != null)
                    {
                        Api.User.User obj = new Api.User.User();
                        user = (User)(new JavaScriptSerializer().Deserialize(obj.Login(user.EmailId, user.Password), typeof(User)));
                        Session["User"] = user;
                        retmsg = "user";
                    }

                    //Domain.Socioboard.Domain.Invitation _Invitation = (Domain.Socioboard.Domain.Invitation)Session["InvitationInfo"];
                    Api.Invitation.Invitation ApiInvitation = new Api.Invitation.Invitation();
                    //if (Session["InvitationCode"] != null)
                    //{
                    //    string invitationcode = Session["InvitationCode"].ToString();
                    //    ApiInvitation.AddInvitationInfoBycode(invitationcode, user.EmailId, user.Id.ToString());

                    //}
                    
                    //if (_Invitation != null)
                    //{
                    //    if (user.EmailId == _Invitation.FriendEmail)
                    //    {
                    //        string ret = ApiInvitation.UpdateInvitatoinStatus(_Invitation.Id.ToString(), user.Id.ToString());
                    //    }
                    //}

                }
                else
                {
                    retmsg = "Email Already Exists";
                }
                //return Content(retmsg);

            }
            catch (Exception ex)
            {
                //logger.Error(ex.StackTrace);
                Console.WriteLine(ex.StackTrace);
            }
            //return View("_RegistrationPartial");
            
            
           
            return Content(retmsg);
        }
 public ActionResult UpgradeAccountSuccessful()
 {
     User objUser = (User)Session["User"];
     string paidamount = (string)Session["PaymentAmount"];
     string accountType = (string)Session["AccountType"];
     objUser.PaymentStatus = "Paid";
     objUser.AccountType = accountType;
     Api.User.User ApiobjUser = new Api.User.User();
     Api.PaymentTransaction.PaymentTransaction objApiPaymentTransaction = new Api.PaymentTransaction.PaymentTransaction();
     if (DateTime.Compare(objUser.ExpiryDate, DateTime.Now) > 0)
     {
         objUser.ExpiryDate = objUser.ExpiryDate.AddDays(30);
     }
     else
     {
         objUser.ExpiryDate = DateTime.Now.AddDays(30);
     }
     string i = ApiobjUser.UpdateUserAccountInfoByUserId(objUser.Id.ToString(), objUser.AccountType, objUser.ExpiryDate, objUser.PaymentStatus, Session["access_token"].ToString());
     string res_PaymentTransaction = objApiPaymentTransaction.SavePayPalTransaction(objUser.Id.ToString(), paidamount);
     string ret = ApiobjUser.UpdatePaymentandEwalletStatusByUserId(objUser.Id.ToString(), Session["Ewallet"].ToString(), accountType, "paid", Session["access_token"].ToString());
     objUser.Ewallet = Session["Ewallet"].ToString();
     objUser.ActivationStatus = "paid";
     Session["User"] = objUser;
     Api.Invitation.Invitation ApiInvitation = new Api.Invitation.Invitation();
     try
     {
         Domain.Socioboard.Domain.Invitation _Invitation = (Domain.Socioboard.Domain.Invitation)(new JavaScriptSerializer().Deserialize(ApiInvitation.UserInvitedInfo(objUser.Id.ToString()), typeof(Domain.Socioboard.Domain.Invitation)));
         if (_Invitation != null)
         {
             User newUser = (User)(new JavaScriptSerializer().Deserialize(ApiobjUser.getUsersById(_Invitation.SenderUserId.ToString(), Session["access_token"].ToString()), typeof(User)));
             decimal bonus = (decimal.Parse(paidamount, CultureInfo.InvariantCulture.NumberFormat) * Payment.ReferedAmountDetails(accountType)) / 100;
             newUser.Ewallet = (decimal.Parse(newUser.Ewallet, CultureInfo.InvariantCulture.NumberFormat) + bonus).ToString();
             string ret1 = ApiobjUser.UpdatePaymentandEwalletStatusByUserId(newUser.Id.ToString(), newUser.Ewallet, newUser.AccountType, newUser.PaymentStatus, Session["access_token"].ToString());
             Api.Affiliates.Affiliates ApiAffiliates = new Api.Affiliates.Affiliates();
             ApiAffiliates.AddAffiliateDetail(newUser.Id.ToString(), objUser.Id.ToString(), DateTime.Now, bonus.ToString());
         }
     }
     catch (Exception ex) { }
     Session["Paid_User"] = "******";
     return RedirectToAction("Index", "Home");
 }
        public ActionResult PaymentSuccessful()
        {
            User objUser = (User)Session["User"];
            objUser.PaymentStatus = "Paid";
            string paidamount = (string)Session["PaymentAmount"];
            string UpgradeType = (string)Session["UpgradeType"];

            Api.User.User ApiobjUser = new Api.User.User();
    
            if (DateTime.Compare(objUser.ExpiryDate, DateTime.Now) > 0)
            {
                if (UpgradeType == "MonthlyUpgrade")
                {
                    objUser.ExpiryDate = objUser.ExpiryDate.AddDays(30);
                }
                else if (UpgradeType == "YearlyUpgrade")
                {
                    objUser.ExpiryDate = objUser.ExpiryDate.AddDays(365);
                } 
            }
            else
            {
                if (UpgradeType == "MonthlyUpgrade")
                {
                    objUser.ExpiryDate = DateTime.Now.AddDays(30);
                }
                else if (UpgradeType == "YearlyUpgrade")
                {
                    objUser.ExpiryDate = DateTime.Now.AddDays(365);
                } 
            }

            //Change Payment status to 1
            ApiobjUser.changePaymentStatus(objUser.Id.ToString(), "paid",Session["access_token"].ToString());

            //Update Paymenttransaction table
            Api.PaymentTransaction.PaymentTransaction objApiPaymentTransaction = new Api.PaymentTransaction.PaymentTransaction();

            string res_PaymentTransaction = objApiPaymentTransaction.SavePayPalTransaction(objUser.Id.ToString(), paidamount);

            string ret = ApiobjUser.UpdatePaymentandEwalletStatusByUserId(objUser.Id.ToString(), Session["Ewallet"].ToString(), objUser.AccountType, "paid", Session["access_token"].ToString());
            objUser.Ewallet = Session["Ewallet"].ToString();
            objUser.ActivationStatus = "paid";
            Session["User"] = objUser;
            
            Api.Invitation.Invitation ApiInvitation = new Api.Invitation.Invitation();
            try {
                Domain.Socioboard.Domain.Invitation _Invitation = (Domain.Socioboard.Domain.Invitation)(new JavaScriptSerializer().Deserialize(ApiInvitation.UserInvitedInfo(objUser.Id.ToString()), typeof(Domain.Socioboard.Domain.Invitation)));
                if (_Invitation != null)
                {
                    User newUser = (User)(new JavaScriptSerializer().Deserialize(ApiobjUser.getUsersById(_Invitation.SenderUserId.ToString(), Session["access_token"].ToString()), typeof(User)));
                    float bonus = (float.Parse(paidamount) * Payment.ReferedAmountDetails(objUser.AccountType)) / 100;
                    newUser.Ewallet = (float.Parse(newUser.Ewallet) + bonus).ToString();
                    string ret1 = ApiobjUser.UpdatePaymentandEwalletStatusByUserId(newUser.Id.ToString(), newUser.Ewallet, newUser.AccountType, newUser.PaymentStatus, Session["access_token"].ToString());
                    Api.Affiliates.Affiliates ApiAffiliates = new Api.Affiliates.Affiliates();
                    ApiAffiliates.AddAffiliateDetail(newUser.Id.ToString(), objUser.Id.ToString(), DateTime.Now, bonus.ToString());
                }
            }
            catch(Exception ex){}

            if (res_PaymentTransaction=="Success")
            {
                RedirectToAction("Index", "Home");
            }

            return RedirectToAction("Index", "Home");
        }
Пример #16
0
        public ActionResult Signup()
        {
            logger.Error("Register");
            User _user = (User)Session["User"];
            Domain.Socioboard.Domain.User user = new Domain.Socioboard.Domain.User();
            Session["AjaxLogin"] = "******";
            string retmsg = string.Empty;
            try
            {
                System.IO.StreamReader sr = new System.IO.StreamReader(Request.InputStream);
                string line = "";
                line = sr.ReadToEnd();
                JObject jo = JObject.Parse(line);
                user.PaymentStatus = "unpaid";

                user.AccountType = Server.UrlDecode((string)jo["package"]);
                user.CreateDate = DateTime.Now;
                user.ExpiryDate = DateTime.Now.AddDays(30);
                user.Id = Guid.NewGuid();
                user.UserName = Server.UrlDecode((string)jo["firstname"]) + " " + Server.UrlDecode((string)jo["lastname"]);
                user.EmailId = Server.UrlDecode((string)jo["email"]);
                user.Password = Server.UrlDecode((string)jo["password"]);
                user.UserStatus = 1;
                if (_user != null)
                {
                    if (_user.ActivationStatus == "1") //If Login from Facebook, then ActivationStatus would be 1, refer to FacebookManager Controller
                    {
                        user.ActivationStatus = "1";
                        user.SocialLogin = _user.SocialLogin;
                        user.ProfileUrl = _user.ProfileUrl;
                    }
                    else
                    {
                        user.ActivationStatus = "0";
                    }
                }
                else
                {
                    user.ActivationStatus = "0";
                }
                string firstName = Server.UrlDecode((string)jo["firstname"]);
                string lastName = Server.UrlDecode((string)jo["lastname"]);
                Api.User.User objApiUser = new Api.User.User();
                //string res_Registration = objApiUser.Register(user.EmailId, user.Password, user.AccountType, user.UserName, user.ActivationStatus);
                string res_Registration = string.Empty;
                if (Session["twitterlogin"] != null)
                {
                    if ((string)Session["twitterlogin"] == "twitterlogin")
                    {
                        res_Registration = objApiUser.RegisterbyTwitter(user.EmailId, user.Password, user.AccountType, user.UserName, user.SocialLogin, user.ProfileUrl, user.ActivationStatus);
                    }
                    else
                    {
                        res_Registration = objApiUser.Register(user.EmailId, user.Password, user.AccountType, user.UserName, user.ActivationStatus);
                    }
                }
                else
                {
                    res_Registration = objApiUser.Register(user.EmailId, user.Password, user.AccountType, user.UserName, user.ActivationStatus);
                }
                logger.Error("res_Registration: " + res_Registration);
                if (res_Registration != "Email Already Exists")
                {
                    if (user != null)
                    {
                        Api.User.User obj = new Api.User.User();
                        user = (User)(new JavaScriptSerializer().Deserialize(obj.Login(user.EmailId, user.Password), typeof(User)));
                        Session["User"] = user;
                        if (Session["fblogin"] != null)
                        {
                            string accesstoken = (string)Session["AccesstokenFblogin"];
                            Api.Facebook.Facebook objfacebook = new Api.Facebook.Facebook();
                            Api.Groups.Groups objgroup = new Api.Groups.Groups();
                            //Domain.Socioboard.Domain.Groups group = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(objgroup.GetGroupDetailsByUserId(user.Id.ToString()), typeof(Domain.Socioboard.Domain.Groups)));
                            Groups obpgrp = (Groups)(new JavaScriptSerializer().Deserialize(objgroup.GetGroupDeUserId(user.Id.ToString()), typeof(Groups)));
                            objfacebook.AddFacebookAccountWithloginAsync(accesstoken, user.Id.ToString(), obpgrp.Id.ToString());
                        }
                        if (Session["googlepluslogin"] != null)
                        {
                            string accesstoken = (string)Session["AccesstokenFblogin"];
                            Api.Youtube.Youtube objYoutube = new Api.Youtube.Youtube();
                            Api.Groups.Groups objgroup = new Api.Groups.Groups();
                            //Domain.Socioboard.Domain.Groups group = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(objgroup.GetGroupDetailsByUserId(user.Id.ToString()), typeof(Domain.Socioboard.Domain.Groups)));
                            Groups grp = (Groups)(new JavaScriptSerializer().Deserialize(objgroup.GetGroupDeUserId(user.Id.ToString()), typeof(Groups)));
                            objYoutube.AddYoutubeAccountwithLoginAsync(ConfigurationManager.AppSettings["YtconsumerKey"], ConfigurationManager.AppSettings["YtconsumerSecret"], ConfigurationManager.AppSettings["Ytredirect_uri"], user.Id.ToString(), grp.Id.ToString(), accesstoken);
                        }
                        retmsg = "user";
                    }

                    //Domain.Socioboard.Domain.Invitation _Invitation = (Domain.Socioboard.Domain.Invitation)Session["InvitationInfo"];
                    Api.Invitation.Invitation ApiInvitation = new Api.Invitation.Invitation();
                    if (Session["InvitationCode"] != null)
                    {
                        string invitationcode = Session["InvitationCode"].ToString();
                        ApiInvitation.AddInvitationInfoBycode(invitationcode, user.EmailId, user.Id.ToString());
                    }

                    //if (_Invitation != null)
                    //{
                    //    if (user.EmailId == _Invitation.FriendEmail)
                    //    {
                    //        string ret = ApiInvitation.UpdateInvitatoinStatus(_Invitation.Id.ToString(), user.Id.ToString());
                    //    }
                    //}

                }
                else
                {
                    retmsg = "Email Already Exists";
                }
                //return Content(retmsg);
                Session.Abandon();
                Session.Clear();
                Session.RemoveAll();
            }
            catch (Exception ex)
            {
                //logger.Error(ex.StackTrace);
                Console.WriteLine(ex.StackTrace);
            }
            //return View("_RegistrationPartial");



            return Content(retmsg);
        }
Пример #17
0
 public ActionResult SMSServices()
 {
     User _User = (User)Session["User"];
     Api.Invitation.Invitation ApiInvitation = new Api.Invitation.Invitation();
     List<Domain.Socioboard.Domain.Invitation> lstInvite = (List<Domain.Socioboard.Domain.Invitation>)(new JavaScriptSerializer().Deserialize(ApiInvitation.GetAllInvitedDataOfUser(_User.Id.ToString()), typeof(List<Domain.Socioboard.Domain.Invitation>)));
     return View("Affiliates", lstInvite);
 }