Exemplo n.º 1
0
        // for fb
        public Account(ITradelrRepository repository, string email, string loginPage, AccountPlanType plan, string affiliate)
        {
            this.repository = repository;
            this.email      = email;
            this.loginPage  = loginPage;
            this.plan       = plan;
            this.affiliate  = affiliate;

            // create subdomain entry
            mastersubdomain = new MASTERsubdomain
            {
                flags                   = 0,
                name                    = loginPage,
                total_outofstock        = 0,
                total_contacts_public   = 0,
                total_contacts_private  = 0,
                total_contacts_staff    = 0,
                total_invoices_sent     = 0,
                total_invoices_received = 0,
                total_orders_sent       = 0,
                total_orders_received   = 0,
                total_products_mine     = 0,
                uniqueid                = Utility.GetRandomString(10),
                accountType             = plan.ToString(),
                accountTypeStatus       = (int)AccountPlanPaymentStatus.TRIAL,                 // start date for 30-day trial campaign
                trialExpiry             = DateTime.UtcNow.AddDays(30),
                affiliateID             = AffiliateUtil.GenerateAffiliateID()
            };
        }
Exemplo n.º 2
0
        public ActionResult GenerateAffiliateID()
        {
            foreach (var d in db.MASTERsubdomains)
            {
                d.affiliateID = AffiliateUtil.GenerateAffiliateID();
                repository.Save();
            }

            return(Content("done"));
        }