コード例 #1
0
        public object SendSponsorEmailOnFreeUpgrade(object[] objValue)
        {
            StringBuilder sb = new StringBuilder();
            UserRegistration objUserReg = new UserRegistration();
            BillingResource objBillingResource = new BillingResource();
            BillingHistory objBilling = new BillingHistory();
            EmailManager objEmailManager = new EmailManager();
            TributePackage objpackage = new TributePackage();
            // return objBillingResource.InsertRecord(objValue);
            UserCreditcardDetails objCCdetail = new UserCreditcardDetails();
            SessionValue objUser = new SessionValue();
            Tributes objTribute = new Tributes();
            String[] SponsorNameandMsgForEmail;

            object identity = new object();
            //using (TransactionScope trans = new TransactionScope())
            //{
            //    identity = objBillingResource.InsertRecord(objValue);
            //    //Transaction Commited
            //    trans.Complete();
            //}
            objUserReg = (UserRegistration)objValue[0];
            if (objValue.Length > 1)
            {
                objUser = (SessionValue)objValue[1];
                objTribute = (Tributes)objValue[2];
                objpackage = (TributePackage)objValue[3];
                SponsorNameandMsgForEmail = (String[])objValue[4];
                // Send the email to all the adminstrator

                if (objpackage.IsSponserHide)
                {
                    if (SponsorNameandMsgForEmail[0] != string.Empty)
                    {
                        objEmailManager.SendSponsorMailsWithMessage(SponsorNameandMsgForEmail[0], SponsorNameandMsgForEmail[1], objTribute.TributeId, objTribute.TypeDescription, objTribute.TributeName, objTribute.TributeUrl, objpackage.EndDate != null ? DateTime.Parse(objpackage.EndDate.ToString()).ToString("MMMM dd, yyyy") : "Never", objpackage.PackageId);
                    }
                 /* commented by Mohit  else if (objpackage.IsSponsor)
                    {
                        objEmailManager.SendSponsorMails(objUser.UserType == 1 ? objUser.UserName : objUser.FirstName, objUser.UserEmail, objTribute.TributeId, objTribute.TypeDescription, objTribute.TributeName, objTribute.TributeUrl, objpackage.EndDate != null ? DateTime.Parse(objpackage.EndDate.ToString()).ToString("MMMM dd, yyyy") : "Never", objpackage.PackageId);
                    } */
                    else
                    {
                        objEmailManager.SendSponsorMails("An anonymous person has", "Your " + WebConfig.ApplicationWord + "<" + WebConfig.NoreplyEmail + ">", objTribute.TributeId, objTribute.TypeDescription, objTribute.TributeName, objTribute.TributeUrl, objpackage.EndDate != null ? DateTime.Parse(objpackage.EndDate.ToString()).ToString("MMMM dd, yyyy") : "Never", objpackage.PackageId);
                    }
                    //objEmailManager.SendSponsorMails(objUser.UserName, objUser.UserEmail, objTribute.TributeId, objTribute.TypeDescription, objTribute.TributeName, objTribute.TributeUrl, objUserReg.UserCreditcardDetails.ExpirationDate.ToString("MMMM dd, yyyy"), objpackage.PackageId);

                }
            }

            return identity;
        }
コード例 #2
0
        public void GetCreditCardDetails(object[] objValue)
        {
            UserRegistration objUserReg = (UserRegistration)objValue[0];
            try
            {
                object[] objParam = { objUserReg.Users.UserId };
                DataSet _objDataSet = GetDataSet("usp_GetCreditcardDetails", objParam);
                if (_objDataSet.Tables[0].Rows.Count > 0)
                {
                    UserCreditcardDetails objCarddetails = new UserCreditcardDetails();
                    objCarddetails.CreditCardId = int.Parse(_objDataSet.Tables[0].Rows[0][UserCreditcardDetails.CardDetais.CreditCardId.ToString()].ToString());
                    objCarddetails.UserId = int.Parse(_objDataSet.Tables[0].Rows[0][UserCreditcardDetails.CardDetais.UserId.ToString()].ToString());
                    objCarddetails.CreditCardType = _objDataSet.Tables[0].Rows[0][UserCreditcardDetails.CardDetais.CreditCardType.ToString()].ToString();
                    objCarddetails.CreditCardNo = _objDataSet.Tables[0].Rows[0][UserCreditcardDetails.CardDetais.CreditCardNo.ToString()].ToString();
                    objCarddetails.CardholdersName = _objDataSet.Tables[0].Rows[0][UserCreditcardDetails.CardDetais.CardholdersName.ToString()].ToString();
                    objCarddetails.ExpirationDate = DateTime.Parse(_objDataSet.Tables[0].Rows[0][UserCreditcardDetails.CardDetais.ExpirationDate.ToString()].ToString());
                    objCarddetails.Address = _objDataSet.Tables[0].Rows[0][UserCreditcardDetails.CardDetais.Address.ToString()].ToString();
                    objCarddetails.City = _objDataSet.Tables[0].Rows[0][UserCreditcardDetails.CardDetais.City.ToString()].ToString();
                    objCarddetails.Zip = _objDataSet.Tables[0].Rows[0][UserCreditcardDetails.CardDetais.Zip.ToString()].ToString();
                    if (!(_objDataSet.Tables[0].Rows[0][UserCreditcardDetails.CardDetais.State.ToString()].ToString().Equals("")))
                        objCarddetails.State = int.Parse(_objDataSet.Tables[0].Rows[0][UserCreditcardDetails.CardDetais.State.ToString()].ToString());
                    else
                        objCarddetails.State = null;

                    objCarddetails.Country = int.Parse(_objDataSet.Tables[0].Rows[0][UserCreditcardDetails.CardDetais.Country.ToString()].ToString());
                    objCarddetails.Telephone = _objDataSet.Tables[0].Rows[0][UserCreditcardDetails.CardDetais.Telephone.ToString()].ToString();
                    objCarddetails.CVC = _objDataSet.Tables[0].Rows[0]["CVC"].ToString();
                    objCarddetails.SponsorEmailAddress = _objDataSet.Tables[0].Rows[0]["SponsorEmailAddress"].ToString();
                    objUserReg.UserCreditcardDetails = objCarddetails;
                }
            }
            catch (System.Data.SqlClient.SqlException sqlEx)
            {
                if (sqlEx.Number >= 50000)
                {
                    Errors objError = new Errors();
                    objError.ErrorMessage = sqlEx.Message;
                    objUserReg.CustomError = objError;
                }
            }
        }
コード例 #3
0
        public object InsertCreditPointCCDetails(object[] objValue)
        {
            StringBuilder sb = new StringBuilder();
            UserRegistration objUserReg = new UserRegistration();
            BillingResource objBillingResource = new BillingResource();
            BillingHistory objBilling = new BillingHistory();
            EmailManager objEmailManager = new EmailManager();
            TributePackage objpackage = new TributePackage();
            // return objBillingResource.InsertRecord(objValue);
            UserCreditcardDetails objCCdetail = new UserCreditcardDetails();
            SessionValue objUser = new SessionValue();
            Tributes objTribute = new Tributes();

            object identity = new object();
            using (TransactionScope trans = new TransactionScope())
            {
                identity = objBillingResource.InsertRecord(objValue);
                //Transaction Commited
                trans.Complete();
            }
            return identity;
        }