Exemplo n.º 1
0
 public bool ActivateTrialAccount(Account accObj)
 {
     Account acc = context.Accounts.FirstOrDefault(a => a.ID == accObj.ID);
     if (acc != null)
     {
         if (acc.TrialEnds == null)
         {
             acc.TrialEnds = DateTime.Now.AddDays(CCGlobalValues.trialPeriod);
             context.SaveChanges();
             return true;
         }
         else
         {
             return false;
         }
     }
     else
     {
         return false;
     }
 }
        public void CheckAcccountStatus(Account accountObj)
        {
            var folderList = CCFolderRepository.CCFolders.Where(f => f.AccountGUID == accountObj.AccountGUID).ToList();

            accountObj.isOverFlow = false;

            foreach (var fold in folderList)
            {
                int FolderItemCount = CCItemRepository.CCContacts.Where(i => i.FolderID == fold.FolderID).Count();

                LimitationsViewModel limitationsObj = new LimitationsViewModel();
                HelperFunctions HF = new HelperFunctions();
                limitationsObj = HF.updateAccountLimitations(accountObj);

                if ((FolderItemCount > limitationsObj.maxItemCountPerFolder) | (fold.isOverFlow == true))
                {
                    accountObj.isOverFlow = true;
                }
            }
            accountRepo.SaveAccount(accountObj);
        }
Exemplo n.º 3
0
 public Account SaveAccount(Account accObj)
 {
     if (accObj.ID == 0)
     {
         context.Accounts.Add(accObj);
         context.SaveChanges();
     }
     else
     {
         var acc = context.Accounts.FirstOrDefault(a => a.ID == accObj.ID);
         acc.AccountName = accObj.AccountName;
         acc.AdditionalDiscount = accObj.AdditionalDiscount;
         acc.PlanID = accObj.PlanID;
         //acc.ConnectionString = accObj.ConnectionString;
         acc.TablePrefix = accObj.TablePrefix;
         acc.StripeCustomerID = accObj.StripeCustomerID;
         acc.LastModifiedDate = DateTime.Now;
         acc.HasPurchased = accObj.HasPurchased;
         acc.isPaymentIssue = accObj.isPaymentIssue;
         acc.isOverFlow = accObj.isOverFlow;
         context.SaveChanges();
     }
     return accObj;
 }
Exemplo n.º 4
0
 public bool UpdateAccountInfo(Account accObj)
 {
     Account acc = context.Accounts.FirstOrDefault(a => a.ID == accObj.ID);
     if (acc != null)
     {
         acc.AccountName = accObj.AccountName;
         acc.AdditionalDiscount = accObj.AdditionalDiscount;
         acc.PlanID = accObj.PlanID;
        // acc.ConnectionString = accObj.ConnectionString;
         acc.TablePrefix = accObj.TablePrefix;
         acc.StripeCustomerID = accObj.StripeCustomerID;
         acc.BusinessAddress = accObj.BusinessAddress;
         acc.TimeZone = accObj.TimeZone;
         acc.LastModifiedDate = DateTime.Now;
         acc.HasPurchased = accObj.HasPurchased;
         acc.isOverFlow = accObj.isOverFlow;
         context.SaveChanges();
         return true;
     }
     else
     {
         return false;
     }
 }
        public int checkToFreezeAccount(Account acc)
        {
            var folderList = CCFolderRepository.CCFolders.Where(f => f.AccountGUID == acc.AccountGUID).ToList();

            foreach(var fold in folderList)
            {
                int FolderItemCount = CCItemRepository.CCContacts.Where(i => i.FolderID == fold.FolderID).Count();

                LimitationsViewModel limitationsObj = new LimitationsViewModel();
                HelperFunctions HF = new HelperFunctions();
                limitationsObj = HF.updateAccountLimitations(acc);

                if ((FolderItemCount > limitationsObj.maxItemCountPerFolder) | (fold.isOverFlow == true))
                {
                    return 1;
                }
            }
            return 0;
        }
        public Account checkAccountTrialExpiryForAccount(Account acc)
        {
            try
            {
                if ((acc.TrialEnds <= DateTime.Now.Date) & (acc.HasPurchased == false) & (acc.isOverFlow != false))
                {
                    bool executeStatus = CCaccountRepo.setAccountStatus(true, acc.ID);
                    acc = CCaccountRepo.Accounts.FirstOrDefault(a => a.ID == acc.ID);
                    var user = CCUserRepository.Users.FirstOrDefault(u => u.AccountID == acc.ID);
                    var notifObj = new Notification()
                    {
                        Subject = "Corporate contacts Trial End!",
                        RecipientAddress = user.Email,
                        //RecipientAddress = "*****@*****.**",
                        // Message = "Hello, \n\n" + user.FullName + " \nAccount successfully created.\nPlease click the link below to activate your account.\n\n" + Request.Url.GetLeftPart(UriPartial.Authority) + "/VerifyUserAccount/VerifyEmailAddress?GUID=" + user.GUID + "\n\nCorporate Contacts Team"
                        Message = "Dear " + user.FullName + ",\n"
                        + "This email is generated automatically by the system to notify you that your Trial Period for the registered Account '" + acc.AccountName + "' is over. Please contact one of our Support Staff "
                        + " on [email protected] to help you get back on track or you could simply log in back to your account and purchase a plan of your choice and cotninue enjoying with corporate-contacts.\n\n"

                        //Message = "<div><center> <table border='0' cellpadding='0' cellspacing='0' height='100%' width='100%'> <tbody><tr> <td align='center' valign='top'><table border='0' cellpadding='0' cellspacing='0' width='600'> <tbody><tr> </tr><tr> <td align='center' valign='top'><table border='0' cellpadding='0' cellspacing='0' width='100%'> <tbody><tr> <td align='center' valign='top'><table border='0' cellpadding='0' cellspacing='0' width='600'> <tbody><tr> <td align='center' valign='top' width='600' style='padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;border-top:1px solid #cccccc;border-right:1px solid #cccccc;border-left:1px solid #cccccc;background-color:#ffffff'><img src='http://corporate-contacts.com/wp-content/uploads/2014/03/CorporateContactslogo3a2.png' style='max-width: 450px;margin-top: 20px;' alt='Dyn'></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr> <td align='center' valign='top' style='border-left:1px solid #cccccc;border-right:1px solid #cccccc;background-color:#ffffff'><table border='0' cellpadding='0' cellspacing='0' width='100%' style='background-color:#ffffff'> <tbody><tr> <td align='center' valign='top'><table border='0' cellpadding='0' cellspacing='0' width='100%'> <tbody><tr> <td valign='top' style='padding-top:20px;padding-right:30px;padding-left:30px'><table align='left' border='0' cellpadding='0' cellspacing='0'> <tbody><tr> <td valign='top' style='color:#444444;font-family:Helvetica;font-size:16px;line-height:125%;text-align:left;padding-bottom:20px'><p>Dear " + user.FullName + "</p><p>Thank you for registering with Corporate Contacts. You have created a new account</p><p><strong>Login Email :</strong> " + user.Email + "</p><p>You still need to <a>Click Here</a> to Activate your account or Please follow the link below:</p><p><a style='text-decoration:underline;color:#0066cc' href='" + Request.Url.GetLeftPart(UriPartial.Authority) + "/VerifyUserAccount/VerifyEmailAddress?GUID=" + user.GUID + "' target='_blank'>" + Request.Url.GetLeftPart(UriPartial.Authority) + "/VerifyUserAccount/VerifyEmailAddress?GUID=" + user.GUID + "</a></p><p>If you did not sign up for this account, this will be the onlycommunication you will receive. All non-confirmed accounts areautomatically deleted after 48 hours and no addresses are kept on file. Weapologize for any inconvenience this correspondence may have caused and weassure you that it was only sent at the request of someone visiting oursite requesting an account.</p><p>If you need help, you can find it here: <a href='http://support.corporate-contacts.com'>support.corporate-contacts.com</a></p><p>Regards,<br><a style='text-decoration:underline;color:#0066cc' href='http://corporate-contacts.com/' target='_blank'>The Corporate Contacts team</a></p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr> <td align='center' valign='top' style='border-left:1px solid #cccccc;border-right:1px solid #cccccc'><table border='0' cellpadding='0' cellspacing='0' width='100%' style='background-color: #209FD1;'> <tbody><tr> <td align='center' valign='bottom'><table border='0' cellpadding='0' cellspacing='0' width='600'> <tbody><tr> <td valign='bottom' width='600' style='padding-top:0px;padding-right:20px;padding-left:20px;padding-bottom:10px'><table align='left' border='0' cellpadding='0' cellspacing='0' width='100%'> <tbody><tr> <td valign='bottom' style='color:#ffffff;padding-top:10px;font-family:Helvetica;font-size:12px;line-height:150%;text-align:left'>Corporate Contacts Ltd.<br>Beverley, UK, HU17 0LD<br>Manchester, NH 03101</td><td valign='bottom' style='color:#ffffff;padding-top:10px;font-family:Helvetica;font-size:12px;line-height:150%;text-align:left'>Phone: +44 1482 869700<br>E-Mail: [email protected]</td></tr></tbody></table> </td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></center></div>"
                    };
                    notifManager.SendNotification(notifObj);
                }
            }
            catch (Exception ex)
            { }

            return acc;
        }
        public List<NotificationListViewModel> generateNotificationList(Account accountObj)
        {
            List<NotificationListViewModel> notificationList = new List<NotificationListViewModel>();

            //Get Trial Period Details
            DateTime trialEndDate = (DateTime)accountRepo.Accounts.FirstOrDefault(a => a.AccountGUID == accountObj.AccountGUID).TrialEnds;
            double timeRemaining = (trialEndDate - DateTime.Now.Date).TotalDays;

            NotificationListViewModel NF1 = new NotificationListViewModel();

            if(accountObj.HasPurchased != true)
            {
                if (timeRemaining > 0)
                    NF1.NotificationMsg = "Your trial account expires in " + timeRemaining + " Days.";
                else
                    NF1.NotificationMsg = "Your account has been expired. Please purchase to continue using Corporate Contacts";
                NF1.url = "/Admin/BillingOptions/1";
                NF1.NotificationType = "Account";
                NF1.priority = 10;

                notificationList.Add(NF1);
            }

            //Get No. of Connection Details & Get Folder Item Count Details
            var accDetails = accountRepo.Accounts.Where(aguid => aguid.AccountGUID == accountObj.AccountGUID).FirstOrDefault();
            var planLeval = planRepository.Plans.Where(pid => pid.ID == accDetails.PlanID).FirstOrDefault().PlanLevel;
            var featureQuality = featureRepository.Features.Where(pid => pid.PlanLevel == planLeval & pid.Type == "Max Items per Folder").FirstOrDefault();
            var savedQuality = purchRepository.Purchases.Where(fid => fid.FeatureID == featureQuality.ID && fid.AccountGUID == accountObj.AccountGUID).FirstOrDefault();
            if (savedQuality != null)
            {
                var quantitySaved = (savedQuality.Quantity) / (featureQuality.Quantity);
                var purchasedConnectionCount = (int)(quantitySaved * 5);
                var availableConnectionCount = (int)(quantitySaved * 5) - (int)CCConnectionRepository.CCSubscriptions.Where(C => C.AccountGUID == accountObj.AccountGUID).Count();

                if (((((double)purchasedConnectionCount - (double)availableConnectionCount) / (double)purchasedConnectionCount) * 100) > 70)
                {
                    NotificationListViewModel NF2 = new NotificationListViewModel();
                    NF2.NotificationMsg = "You have used " + ((double)purchasedConnectionCount - (double)availableConnectionCount) + " of your " + ((double)purchasedConnectionCount) + " account Connections.";
                    NF2.url = "/Admin/BillingOptions/1";
                    NF2.NotificationType = "Account";
                    NF2.priority = 7;

                    notificationList.Add(NF2);
                }

                var maxItemCountPerFolder = featureQuality.Quantity;

                var folderList = CCFolderRepository.CCFolders.Where(f => f.AccountGUID == accountObj.AccountGUID).ToList();

                NotificationListViewModel[] NFArray = new NotificationListViewModel[folderList.Count];
                int c = 0;

                foreach (var fold in folderList)
                {
                    var itemCount = CCItemRepository.CCContacts.Where(i => i.FolderID == fold.FolderID & i.isDeleted == false).Count();
                    if (((((double)itemCount) / (double)maxItemCountPerFolder) * 100) > 70)
                    {
                        NFArray[c] = new NotificationListViewModel();
                        NFArray[c].NotificationMsg = "Folder '" + fold.Name + "' has almost reached its Max Item Count.";
                        NFArray[c].url = "/Admin/BillingOptions/1";
                        NFArray[c].NotificationType = "Account";
                        NFArray[c].priority = 5;
                        c++;
                    }

                }

                foreach (var noti in NFArray)
                {
                    if(noti != null)
                        notificationList.Add(noti);
                }
            }
            return notificationList;
        }
        public LimitationsViewModel updateAccountLimitations(Account accountObj)
        {
            LimitationsViewModel limitationsObj = new LimitationsViewModel();
            var accDetails = accountRepo.Accounts.Where(aguid => aguid.AccountGUID == accountObj.AccountGUID).FirstOrDefault();
            var planLeval = planRepository.Plans.Where(pid => pid.ID == accDetails.PlanID).FirstOrDefault().PlanLevel;
            var featureQuality = featureRepository.Features.Where(pid => pid.PlanLevel == planLeval & pid.Type == "Max Items per Folder").FirstOrDefault();
            var savedQuality = purchRepository.Purchases.Where(fid => fid.FeatureID == featureQuality.ID && fid.AccountGUID == accountObj.AccountGUID).FirstOrDefault();

            var folderList = CCFolderRepository.CCFolders.Where(f => f.AccountGUID == accountObj.AccountGUID).ToList();
            limitationsObj.folderList = new List<FolderDetailsWithItemCount>();
            foreach (var fold in folderList)
            {
                FolderDetailsWithItemCount foldC = new FolderDetailsWithItemCount();
                foldC.fold = fold;
                foldC.itemCount = CCItemRepository.CCContacts.Where(i => i.FolderID == fold.FolderID & i.isDeleted == false).Count();
                limitationsObj.folderList.Add(foldC);
            }

            if (savedQuality != null)
            {
                var quantitySaved = (savedQuality.Quantity) / (featureQuality.Quantity);
                limitationsObj.purchasedConnectionCount = (int)(quantitySaved * 5);
                limitationsObj.availableCconnectionCount = (int)(quantitySaved * 5) - (int)CCConnectionRepository.CCSubscriptions.Where(C => C.AccountGUID == accountObj.AccountGUID).Count();
                limitationsObj.maxItemCountPerFolder = featureQuality.Quantity;
                if (featureRepository.Features.Where(pid => pid.PlanLevel == planLeval & pid.Type == "Sync Calendar").FirstOrDefault().Quantity == 0)
                    limitationsObj.isCalendarSyncAvailable = false;
                else
                    limitationsObj.isCalendarSyncAvailable = true;

            }

            return limitationsObj;
        }
        public ActionResult EditAccountInfor(AccountInfomationViewModel accountinfor)
        {
            User userObj = (User)Session["user"];
            if (userObj != null)
            {
                if (userObj.PrimaryUser == false)
                    return RedirectToAction("Index", "Admin");
                Account account = new Account();
                account = accountRepo.Accounts.Where(id => id.ID == userObj.AccountID).FirstOrDefault();
                account.TimeZone = accountinfor.TimeZone;
                account.BusinessAddress = accountinfor.BillingAddress;

                var res = accountRepo.UpdateAccountInfo(account);
                if (res) { Session["timeZone"] = accountinfor.TimeZone; }
            }

            return RedirectToAction("AccountOptions", "Admin");
        }
Exemplo n.º 10
0
        public Account saveFeaturesCommon(string plan, int quantities)
        {
            User userObj = (User)Session["user"];
            Account accountObj = (Account)Session["account"];
            int planLevel = Int32.Parse(plan);
            int existingPlanID = 1;

            //Delete old purchasedfeature
            var purchasedfeatures = purchRepository.Purchases.Where(p => p.AccountGUID == accountObj.AccountGUID).ToList();
            foreach (var purch in purchasedfeatures)
            {
                bool res = purchRepository.DeleteFPurchasedFeature(purch.ID);

            }

            var featuresForPlan = featureRepository.Features.Where(pl => pl.PlanLevel == planLevel).ToList();

            // save default feature
            var featuresForDefaultPlan = featureRepository.Features.Where(pl => pl.PlanLevel == planLevel && pl.Price == 0).ToList();

            foreach (var feat in featuresForDefaultPlan)
            {
                PurchasedFeatures objFeature = new PurchasedFeatures();
                objFeature.AccountGUID = accountObj.AccountGUID;
                objFeature.FeatureID = feat.ID;
                objFeature.ExpiryDate = DateTime.UtcNow;
                objFeature.Enabled = true;

                if (feat.Type == "Max Items per Folder")
                {
                    objFeature.Quantity = (feat.Quantity) * quantities;
                }
                else
                {
                    objFeature.Quantity = feat.Quantity;
                }

                purchRepository.SavePurchase(objFeature);
            }

            //Ajust Folder Fields START

            List<string> needtosave = new List<string>();
            List<CCFolderField> savedobj = new List<CCFolderField>();
            List<CCFolderField> activeFields = new List<CCFolderField>();
            List<CCFolderField> needToInActive = new List<CCFolderField>();

            List<String> objFields = new List<string>();

            if (planLevel == 10)
                objFields = FieldsConfigHelper.GetFieldForContactSimple();
            else if (planLevel == 20)
                objFields = FieldsConfigHelper.GetFieldForContactBusiness();
            else
                objFields = FieldsConfigHelper.GetFieldForContactFull();

            var folderListForAccount = CCFolderRepository.CCFolders.Where(F => F.AccountGUID == accountObj.AccountGUID).ToList();

            foreach (var fold in folderListForAccount.Where(f=>f.Type==1))
            {
                needtosave = CCFieldRepository.IsAvailableField(objFields, fold.FolderID);

                foreach (var field in needtosave)
                {
                    CCFolderField folderField = new CCFolderField();
                    folderField.FieldName = FieldsConfigHelper.GetRealName(field);
                    folderField.FieldType = FieldsConfigHelper.GetVariableType(field);
                    folderField.FolderID = fold.FolderID;
                    folderField.FieldCaption = field;
                    folderField.Restriction = "none";
                    folderField.AccountGUID = accountObj.AccountGUID;
                    folderField.isActive = true;
                    savedobj.Add(folderField);
                }

                var resp = CCFieldRepository.SaveFolderFieldsObj(savedobj);

                foreach (var field in objFields)
                {
                    CCFolderField folderField = CCFieldRepository.CCFolderFields.Where(f => f.FieldCaption == field & f.AccountGUID == accountObj.AccountGUID & f.FolderID == fold.FolderID).FirstOrDefault();
                    activeFields.Add(folderField);
                }

                var fieldList = CCFieldRepository.CCFolderFields.Where(f => f.AccountGUID == accountObj.AccountGUID & f.FolderID == fold.FolderID).ToList();

                var toInActiveList = fieldList.Except(activeFields).ToList();

                int flag = 0;

                foreach (var f1 in fieldList)
                {
                    flag = 0;
                    foreach (var f2 in activeFields)
                    {
                        try
                        {
                            if (f2.FieldID == f1.FieldID)
                            {
                                if (f1.isActive != false)
                                {
                                    flag = 1;
                                    break;
                                }
                                else
                                {
                                    flag = 2;
                                    break;
                                }

                            }
                        }
                        catch (Exception ex)
                        { }

                    }

                    if (flag == 0)
                    {
                        f1.isActive = false;
                        CCFieldRepository.SaveFolderFields(f1);
                    }

                    else if (flag == 2)
                    {
                        f1.isActive = true;
                        CCFieldRepository.SaveFolderFields(f1);
                    }
                }

                // add field into default group
                var defaultGrp = CCGroupRepository.CCGroups.Where(fid => fid.FolderID == fold.FolderID & fid.GroupName == "Default" & fid.AccountGUID == accountObj.AccountGUID).FirstOrDefault();

                if (defaultGrp != null)
                {
                    foreach (var field in resp)
                    {
                        long grpFieldOrder = 0;
                        // get group fileds last order
                        var groupFieldOrder = CCGroupFieldRepository.CCGroupsFields.Where(gid => gid.GroupID == defaultGrp.GroupID & gid.AccountGUID == accountObj.AccountGUID).OrderByDescending(grp => grp.FieldOrder).FirstOrDefault();
                        if (groupFieldOrder != null) { grpFieldOrder = groupFieldOrder.FieldOrder; }

                        CCGroupField objgrpfield = new CCGroupField();
                        objgrpfield.FieldID = field.FieldID;
                        objgrpfield.FieldOrder = grpFieldOrder + 1;
                        objgrpfield.FolderID = defaultGrp.FolderID;
                        objgrpfield.GroupID = defaultGrp.GroupID;
                        objgrpfield.AccountGUID = accountObj.AccountGUID;
                        var aa = CCGroupFieldRepository.SaveGroupField(objgrpfield);
                    }
                }
            }

            //Ajust Folder Fields END

            // change the plain id
            var planid = planRepository.Plans.FirstOrDefault(pl => pl.PlanLevel == planLevel).ID;

            var currentAccount = accountRepo.Accounts.FirstOrDefault(ac => ac.ID == userObj.AccountID);

            Account account = new Account();
            account = currentAccount;
            existingPlanID = account.PlanID;
            account.PlanID = planid;
            account.SyncPeriod = (short)featureRepository.Features.Where(pl => pl.PlanLevel == planLevel && pl.Type == "Sync Period").First().Quantity;
            account = accountRepo.SaveAccount(account);

            return account;
        }
Exemplo n.º 11
0
        public string ChargeFailed(ChargeFailedViewModel request)
        {
            //Occurs whenever a failed charge attempt occurs.
            if (request.type == "charge.failed")
            {
                var accountDetails = new Account();
                var user = new User();

                if ([email protected] != null)
                {
                    accountDetails = CCaccountRepo.Accounts.Where(a => a.StripeCustomerID == [email protected]).First();
                    user = CCUserRepository.Users.FirstOrDefault(u => u.AccountID == accountDetails.ID);
                }
                else
                {
                    user = CCUserRepository.Users.FirstOrDefault(u => u.Email == [email protected]);
                    accountDetails = CCaccountRepo.Accounts.Where(a => a.ID == user.AccountID).First();
                }

                try
                {

                    if ((accountDetails.TrialEnds <= DateTime.Now.Date) & (accountDetails.HasPurchased != false))
                    {

                        accountDetails.isPaymentIssue = true;
                        CCaccountRepo.SaveAccount(accountDetails);
                    }
                        var notifObj = new Notification()
                        {
                            Subject = "Corporate Contacts - Payment Failure",
                            RecipientAddress = user.Email,
                            Message = "<div><center> <table border='0' cellpadding='0' cellspacing='0' height='100%' width='100%'> <tbody><tr> <td align='center' valign='top'><table border='0' cellpadding='0' cellspacing='0' width='600'> <tbody><tr> </tr><tr> <td align='center' valign='top'><table border='0' cellpadding='0' cellspacing='0' width='100%'> <tbody><tr> <td align='center' valign='top'><table border='0' cellpadding='0' cellspacing='0' width='600'> <tbody><tr> <td align='center' valign='top' width='600' style='padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;border-top:1px solid #cccccc;border-right:1px solid #cccccc;border-left:1px solid #cccccc;background-color:#ffffff'><img src='http://corporate-contacts.com/wp-content/uploads/2014/03/CorporateContactslogo3a2.png' style='max-width: 450px;margin-top: 20px;' alt='Dyn'></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr> <td align='center' valign='top' style='border-left:1px solid #cccccc;border-right:1px solid #cccccc;background-color:#ffffff'><table border='0' cellpadding='0' cellspacing='0' width='100%' style='background-color:#ffffff'> <tbody><tr> <td align='center' valign='top'><table border='0' cellpadding='0' cellspacing='0' width='100%'> <tbody><tr> <td valign='top' style='padding-top:20px;padding-right:30px;padding-left:30px'><table align='left' border='0' cellpadding='0' cellspacing='0'> <tbody><tr> <td valign='top' style='color:#444444;font-family:Helvetica;font-size:16px;line-height:125%;text-align:left;padding-bottom:20px'><p>Dear " + user.FullName + "</p><p>We had trouble charging $" + (([email protected]).ToString()).Substring(0, ((([email protected]).ToString()).Length - 2)) + "." + (([email protected]).ToString()).Substring((([email protected]).ToString()).Length - 2) + " from your card **** " + [email protected] + " </p><p>The bank replied with the following details and we would like to share with you in order for you to update the card details accordingly.</p><p>" + [email protected]_message + "</p><p>Regards,<br><a style='text-decoration:underline;color:#0066cc' href='http://corporate-contacts.com/' target='_blank'>The Corporate Contacts team</a></p><p><a href='http://www.support.corporate-contacts.com'>www.support.corporate-contacts.com</a></p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr> <td align='center' valign='top' style='border-left:1px solid #cccccc;border-right:1px solid #cccccc'><table border='0' cellpadding='0' cellspacing='0' width='100%' style='background-color: #209FD1;'> <tbody><tr> <td align='center' valign='bottom'><table border='0' cellpadding='0' cellspacing='0' width='600'> <tbody><tr> <td valign='bottom' width='600' style='padding-top:0px;padding-right:20px;padding-left:20px;padding-bottom:10px'><table align='left' border='0' cellpadding='0' cellspacing='0' width='100%'> <tbody><tr> <td valign='bottom' style='color:#ffffff;padding-top:10px;font-family:Helvetica;font-size:12px;line-height:150%;text-align:left'>Corporate Contacts Ltd.<br>Beverley, UK, HU17 0LD<br>Manchester, NH 03101</td><td valign='bottom' style='color:#ffffff;padding-top:10px;font-family:Helvetica;font-size:12px;line-height:150%;text-align:left'>Phone: +44 1482 869700<br>E-Mail: [email protected]</td></tr></tbody></table> </td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></center></div>"
                            //Message = "Test Email <br/> " + [email protected] + "<br/>" + [email protected] + "<br/>" + [email protected] + "<br/>" + [email protected]_message
                        };
                        notifManager.SendNotification(notifObj);

                }
                catch (StripeException ex)
                {
                    return [email protected] + "Error" + ex.Message;
                }

                return "1-" + accountDetails.AccountName + " / " + user.Email;
            }
            else
            {
                return "0";
            }
        }