public async Task <IActionResult> AgencyPaymentSuccessful()
        {
            Domain.Socioboard.Models.AgencyUser   _AgencyUser = HttpContext.Session.GetObjectFromJson <Domain.Socioboard.Models.AgencyUser>("AgencyUser");
            List <KeyValuePair <string, string> > Parameters  = new List <KeyValuePair <string, string> >();

            Parameters.Add(new KeyValuePair <string, string>("userName", _AgencyUser.userName));
            Parameters.Add(new KeyValuePair <string, string>("planType", _AgencyUser.planType));
            Parameters.Add(new KeyValuePair <string, string>("phnNumber", _AgencyUser.phnNumber));
            Parameters.Add(new KeyValuePair <string, string>("message", _AgencyUser.message));
            Parameters.Add(new KeyValuePair <string, string>("email", _AgencyUser.email));
            Parameters.Add(new KeyValuePair <string, string>("company", _AgencyUser.company));
            Parameters.Add(new KeyValuePair <string, string>("amount", _AgencyUser.amount.ToString()));

            HttpResponseMessage response = await WebApiReq.PostReq("/api/AgencyUser/UpdateUserInfo", Parameters, "", "", _appSettings.ApiDomain);

            if (response.IsSuccessStatusCode)
            {
                try
                {
                    string returndata = await response.Content.ReadAsStringAsync();

                    return(Content(""));
                }
                catch { }
            }
            return(Content(""));
        }
        public IActionResult UpdateUserInfo(Domain.Socioboard.Models.AgencyUser _AgencyUser)
        {
            Model.DatabaseRepository dbr = new Model.DatabaseRepository(_logger, _appEnv);
            _AgencyUser.createdDate = DateTime.UtcNow;
            int SavedStatus = dbr.Add <Domain.Socioboard.Models.AgencyUser>(_AgencyUser);

            if (SavedStatus == 1 && _AgencyUser != null)
            {
                try
                {
                    string path = _appEnv.WebRootPath + "\\views\\mailtemplates\\plan.html";
                    string html = System.IO.File.ReadAllText(path);
                    html = html.Replace("[FirstName]", _AgencyUser.userName);
                    html = html.Replace("[AccountType]", _AgencyUser.planType.ToString());
                    _emailSender.SendMailSendGrid(_appSettings.frommail, "", _AgencyUser.email, "", "", "You requested for Demo plan", html, _appSettings.SendgridUserName, _appSettings.SendGridPassword);
                    Mailforsocioboard(_AgencyUser);
                    return(Ok("Demo Requested Added"));
                }
                catch (Exception ex)
                {
                    return(Ok("Issue while sending mail."));
                }
            }
            else
            {
                return(Ok("problem while saving,pls try after some time"));
            }
        }
        public ActionResult Mailforsocioboard(Domain.Socioboard.Models.AgencyUser _AgencyUser)
        {
            string path = _appEnv.WebRootPath + "\\views\\mailtemplates\\registrationmail.html";
            string html = System.IO.File.ReadAllText(path);

            html = html.Replace("[FirstName]", _AgencyUser.userName);
            html = html.Replace("[AccountType]", _AgencyUser.planType.ToString());
            _emailSender.SendMail("", "", "*****@*****.**", "", "", "Customer requested for demo enterprise plan ", html, _appSettings.ZohoMailUserName, _appSettings.ZohoMailPassword);
            return(Ok("Mail Sent Successfully."));
        }
 public async Task <IActionResult> AgencyPlan(string firstName, string lastName, string company, string emailId, string phoneNumber, string message, string demoPlanType, string amount)
 {
     Domain.Socioboard.Models.AgencyUser _AgencyUser = new Domain.Socioboard.Models.AgencyUser();
     _AgencyUser.userName  = firstName + " " + lastName;
     _AgencyUser.company   = company;
     _AgencyUser.email     = emailId;
     _AgencyUser.message   = message;
     _AgencyUser.phnNumber = phoneNumber;
     _AgencyUser.planType  = demoPlanType;
     _AgencyUser.amount    = double.Parse(amount);
     HttpContext.Session.SetObjectAsJson("AgencyUser", _AgencyUser);
     return(Content(Helpers.Payment.AgencyPayment(amount, demoPlanType, firstName + " " + lastName, phoneNumber, emailId, "USD", _appSettings.paypalemail, _appSettings.callBackUrl, _appSettings.failUrl, _appSettings.AgencycallBackUrl, _appSettings.cancelurl, "", "", _appSettings.PaypalURL)));
 }