Esempio n. 1
0
        public Tributes(int tributeID, string tributeName, int tributeType, string welcomeMessage, string tributeImage, string tributeUrl, int themeId, string city, int state, int country, bool isPrivate, bool isOrderDVDChecked, bool isMemTributeBoxChecked, bool isActive, bool isDeleted, DateTime date1, DateTime date2, string attribute1, string attribute2, int createdBy, DateTime createdDate, int modifiedBy, DateTime modifiedDate, Errors customErrors, string tributePackageType, int linkMemTributeId)
        {
            this.TributeId = tributeID;
            this.TributeName = tributeName;
            this.TributeType = tributeType;
            this.WelcomeMessage = welcomeMessage;
            this.TributeImage = tributeImage;
            this.TributeUrl = tributeUrl;
            this.ThemeId = themeId;
            this.City = city;
            this.State = state;
            this.Country = country;
            this.IsPrivate = isPrivate;
            this.IsOrderDVDChecked = isOrderDVDChecked;
            this.IsMemTributeBoxChecked = isMemTributeBoxChecked;
            this.IsActive = isActive;
            this.IsDeleted = isDeleted;
            this.Date1 = date1;
            this.Date2 = date2;
            this.Attribute1 = attribute1;
            this.Attribute2 = attribute2;
            this.CreatedBy = createdBy;
            this.CreatedDate = createdDate;
            this.ModifiedBy = modifiedBy;
            this.ModifiedDate = modifiedDate;
            this.CustomError = customErrors;
            this.TributePackageType = tributePackageType;

            //Added for linked memorial tribute for video tribute
            this.LinkMemTributeId = linkMemTributeId;
        }
 public GenralUserInfo(string _UserName,string _Password)
 {
     _ObjErrors = new Errors();
     _ObjUser = new UserInfo();
     _ObjUser.UserName = _UserName;
     _ObjUser.UserPassword = _Password;
 }
Esempio n. 3
0
        public void CheckLogin(object[] objValue)
        {
            GeneralUser objUser = (GeneralUser)objValue[0];
            try
            {

                object[] objParam = { null, objUser.CustomUsers.Password.ToString() };
                DataSet ds = GetDataSet("ValidateUser", objParam);
                // ds.Tables[0].
                int count = ds.Tables[0].Rows.Count;
                if (count > 0)
                {
                    UserRole objuserrole = new UserRole();
                    objuserrole.roles = ds.Tables[0].Rows[0][1].ToString();

                    objUser.CustomUserRole = objuserrole;

                }
            }
            catch (System.Data.SqlClient.SqlException sqlEx)
            {
                if (sqlEx.Number >= 50000)
                {
                    Errors objError = new Errors();
                    objError.ErrorMessage = sqlEx.Message;
                    objUser.CustomError = objError;
                }
            }
        }
        public void Delete(object[] Params)
        {
            UserRegistration objUserReg = (UserRegistration)Params[0];
            try
            {
                //string[] strParam = {
                //                        UserCreditcardDetails.CardDetais.UserId.ToString()
                //                };

                //DbType[] enumDbType ={
                //                    DbType.Int32
                //                 };

                object[] objValue ={
                                    objUserReg.UserCreditcardDetails.UserId,
                    objUserReg.UserCreditcardDetails.CreditCardId
                                   };
                base.Delete("usp_DeleteCreditCardDetails", objValue);

            }
            catch (System.Data.SqlClient.SqlException sqlEx)
            {
                if (sqlEx.Number >= 50000)
                {
                    Errors objError = new Errors();
                    objError.ErrorMessage = sqlEx.Message;
                    objUserReg.CustomError = objError;
                }
            }
        }
        public void CreateCouponDetails(object[] objTributes)
        {
            Coupons objcoupons = (Coupons)objTributes[0];
            object Identity = new object();
            if (!Equals(objTributes, null))
            {
                try
                {

                    string[] strTributeParams ={"CouponName",
                                                "CouponDenomination",
                                                "IsPercentage",
                                                "ApplicableFromDate",
                                                "ExpiryDate",
                                                "MaxNoOfUses",
                                                "NoOfCoupons",
                                                "CreatedBy",
                        "CouponPackage"
                                                };
                    DbType[] dbType ={
                                            DbType.String,
                                            DbType.Decimal,
                                            DbType.Boolean,
                                            DbType.DateTime,
                                            DbType.DateTime,
                                            DbType.Int64,
                                            DbType.Int64,
                                            DbType.Int64,DbType.Int64

                        };
                    Couponmaster objCouponMaster = objcoupons.CouponMaster;
                    object[] objValue ={
                        objCouponMaster.CouponName,objCouponMaster.CouponDenomination,objCouponMaster.IsPercentage,
                        objCouponMaster.ApplicableFromDate,objCouponMaster.ExpiryDate,objCouponMaster.MaxNoOfUses,
                        objCouponMaster.NoOfCoupons,objCouponMaster.CreatedBy,objCouponMaster.CouponPackage
                                         };
                    Identity = InsertDataAndReturnId("usp_CreateCouponDetails", strTributeParams, dbType, objValue);
                    InsertCoupons(objTributes, Identity.ToString());

                }
                catch (System.Data.SqlClient.SqlException sqlEx)
                {
                    if (sqlEx.Number > 50000)
                    {
                        Errors errors = new Errors();
                        errors.ErrorMessage = sqlEx.Message;
                        objcoupons.CustomError = errors;
                    }
                }
            }
        }
 public int ChangeEmailPassword(object[] objValue)
 {
     GenralUserInfo _objGenralUserInfo = (GenralUserInfo)objValue[0];
     int _count = 0;
     try
     {
         _count = int.Parse(SaveEmailAndPassword(objValue).ToString());
     }
     catch (System.Data.SqlClient.SqlException sqlEx)
     {
         if (sqlEx.Number >= 50000)
         {
             Errors objError = new Errors();
             objError.ErrorMessage = sqlEx.Message;
             _objGenralUserInfo.CustomError = objError;
         }
     }
     return _count;
 }
        public void ChangeEmailPassword(GenralUserInfo _objGenralUserInfo)
        {
            UserInfoResource objUser = new UserInfoResource();
            object[] param = { _objGenralUserInfo };
            string usermail = GetEmail(_objGenralUserInfo.RecentUsers.UserID);
            try
            {
                string _EmailBody = string.Empty;
                string _Subject = string.Empty;
                if (objUser.ChangeEmailPassword(param) > 0)
                {
                    EmailMessages objEmail = EmailMessages.Instance;
                    //string _EmailBody = GetEmailBodyOnEmailAndPasswordChanged(_objGenralUserInfo.RecentUsers);
                    MailBodies objMail = new MailBodies();
                    if ((_objGenralUserInfo.RecentUsers.UserEmail.Length != 0) && (_objGenralUserInfo.RecentUsers.UserPassword.Length > 0))
                    {
                        _Subject = "Your Tribute Password and Email Reminder";
                        _EmailBody = objMail.ChangeEmailPassword(_objGenralUserInfo.RecentUsers.UserName, _objGenralUserInfo.RecentUsers.UserEmail, _objGenralUserInfo.RecentUsers.UserPassword);

                    }
                    else if ((_objGenralUserInfo.RecentUsers.UserEmail.Length == 0) && (_objGenralUserInfo.RecentUsers.UserPassword.Length != 0))
                    {
                        _Subject = "Your Tribute Password Reminder";
                        _EmailBody = objMail.ForgetPassword(_objGenralUserInfo.RecentUsers.UserName, _objGenralUserInfo.RecentUsers.UserPassword);
                    }
                    else if ((_objGenralUserInfo.RecentUsers.UserEmail.Length != 0) && (_objGenralUserInfo.RecentUsers.UserPassword.Length == 0))
                    {
                        _Subject = "Your Tribute Email Reminder";
                        _EmailBody = objMail.ChangeEmail(_objGenralUserInfo.RecentUsers.UserName, _objGenralUserInfo.RecentUsers.UserEmail);
                    }

                    bool val = objEmail.SendMessages(ForgetPassAdmin, usermail, _Subject, _EmailBody, EmailMessages.TextFormat.Html.ToString());

                }
            }
            catch (Exception ex)
            {
                Errors objError = new Errors();
                objError.ErrorMessage = ex.Message;
                _objGenralUserInfo.CustomError = objError;
            }
        }
        public Stories ClaculateAge(Stories objStory)
        {
            Stories objStoryDetail = new Stories ();

            try
            {
                if (objStory != null)
                {
                    object[] objStoryParam = { objStory.Date1, objStory.Date2,objStory.Age,0 ,0};

                    if (objStoryParam != null)
                    {
                        DataSet dsStory = new DataSet();

                        dsStory = GetDataSet("uspCalculateAge", objStoryParam);
                        objStoryDetail.Age = dsStory.Tables[0].Rows[0][0].ToString(); //int.Parse (dsStory.Tables[0].Rows[0][0].ToString());
                    }
                }

            }
            catch (System.Data.SqlClient.SqlException sqlEx)
            {
                if (sqlEx.Number >= 50000)
                {
                    Errors objError = new Errors();
                    objError.ErrorMessage = sqlEx.Message;
                    objStory.CustomError = objError;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return objStoryDetail;
        }
        public object InsertCurrentCreditPoints(object[] objTributes)
        {
            object Identity = new object();
            CreditPointTransaction objCreditTrandetails = (CreditPointTransaction)objTributes[0];
            string confirmationId = objTributes[1].ToString();
            if (!Equals(objTributes, null))
            {
                try
                {
                    string[] strTributeParams ={
                                                CreditPointTransaction.CreditPointDetails.UserId.ToString(),
                                                CreditPointTransaction.CreditPointDetails.NetCreditPoints.ToString(),
                                                 CreditPointTransaction.CreditPointDetails.AmountPaid.ToString(),
                                                 CreditPointTransaction.CreditPointDetails.CreditPackageId.ToString(),
                                                CreditPointTransaction.CreditPointDetails.PurchasedDate.ToString(),
                                                CreditPointTransaction.CreditPointDetails.IsDeleted.ToString(),
                                                CreditPointTransaction.CreditPointDetails.ModifiedDate.ToString(),
                                                CreditPointTransaction.CreditPointDetails.CouponId.ToString(),
                                                CreditPointTransaction.CreditPointDetails.CreditCardId.ToString(),
                                                CreditPointTransaction.CreditPointDetails.CreatedDate.ToString(),
                                               CreditPointTransaction.CreditPointDetails.ConfirmationNo.ToString()
                                                };
                    DbType[] dbType ={
                                      DbType.Int64,
                                      DbType.Double,
                                      DbType.Int64,
                                      DbType.Int64,
                                      DbType.DateTime,
                                      DbType.Boolean,
                                      DbType.DateTime,
                                      DbType.Int64,
                                      DbType.Int64,
                                      DbType.DateTime,
                                      DbType.String

                        };
                    object[] objValue ={objCreditTrandetails.UserId,
                        objCreditTrandetails.NetCreditPoints,objCreditTrandetails.AmountPaid,objCreditTrandetails.CreditPackageId,objCreditTrandetails.PurchasedDate,
                        objCreditTrandetails.IsDeleted,objCreditTrandetails.ModifiedDate,objCreditTrandetails.CouponId,objCreditTrandetails.CreditCardId,
                        objCreditTrandetails.CreatedDate,confirmationId
                                         };
                    Identity = base.InsertDataAndReturnId("usp_InsertCurrentCreditPoints", strTributeParams, dbType, objValue);
                }
                catch (System.Data.SqlClient.SqlException sqlEx)
                {
                    if (sqlEx.Number > 50000)
                    {
                        Errors errors = new Errors();
                        errors.ErrorMessage = sqlEx.Message;
                        return Identity;
                    }
                }
            }
            return Identity;
        }
        public void GetTriputePackageInfo(object[] objValue)
        {
            TributePackage objUserReg = (TributePackage)objValue[0];
            try
            {
                object[] objParam = { objUserReg.UserTributeId };
                DataSet _objDataSet = GetDataSet("usp_GetTriputePackageInfo", objParam);
                if (_objDataSet.Tables[0].Rows.Count > 0)
                {
                    if (string.IsNullOrEmpty(_objDataSet.Tables[0].Rows[0]["EndDate"].ToString()))
                        objUserReg.EndDate = null;
                    else
                        objUserReg.EndDate = DateTime.Parse(_objDataSet.Tables[0].Rows[0]["EndDate"].ToString());
                    objUserReg.PackageId = int.Parse(_objDataSet.Tables[0].Rows[0]["PackageId"].ToString());
                    objUserReg.IsSponsor = bool.Parse(_objDataSet.Tables[0].Rows[0]["IsSponsor"].ToString());
                    objUserReg.IsSponserHide = bool.Parse(_objDataSet.Tables[0].Rows[0]["IsSponserHide"].ToString());
                    objUserReg.IsAutomaticRenew = bool.Parse(_objDataSet.Tables[0].Rows[0]["IsAutomaticRenew"].ToString());
                    objUserReg.UserId = int.Parse(_objDataSet.Tables[0].Rows[0]["UserId"].ToString());
                    objUserReg.TributePackageId = int.Parse(_objDataSet.Tables[0].Rows[0]["TributePackageId"].ToString());

                    //
                }
            }
            catch (System.Data.SqlClient.SqlException sqlEx)
            {
                if (sqlEx.Number >= 50000)
                {
                    Errors objError = new Errors();
                    objError.ErrorMessage = sqlEx.Message;
                    objUserReg.CustomError = objError;
                }
            }
        }
 public int GetTributePackageInfo(int tributeId)
 {
     //TributePackage objUserReg = (TributePackage)objValue[0];
     int packageId = 0;
     try
     {
         object[] objParam = { tributeId };
         DataSet _objDataSet = GetDataSet("usp_GetTriputePackageInfo", objParam);
         if (_objDataSet.Tables[0].Rows.Count > 0)
         {
            packageId = int.Parse(_objDataSet.Tables[0].Rows[0]["PackageId"].ToString());
         }
     }
     catch (System.Data.SqlClient.SqlException sqlEx)
     {
         if (sqlEx.Number >= 50000)
         {
             Errors objError = new Errors();
             objError.ErrorMessage = sqlEx.Message;
         }
     }
     return packageId;
 }
 public int GetPackIdonPhotoId(int PhotoId)
 {
     int packageId = 0;
     try
     {
         object[] objParam = { PhotoId };
         DataSet _objDataSet = GetDataSet("usp_GetPackIdonPhotoId", objParam);
         if (_objDataSet.Tables[0].Rows.Count > 0)
         {
             packageId = int.Parse(_objDataSet.Tables[0].Rows[0]["PackageId"].ToString());
         }
     }
     catch (System.Data.SqlClient.SqlException sqlEx)
     {
         if (sqlEx.Number >= 50000)
         {
             Errors objError = new Errors();
             objError.ErrorMessage = sqlEx.Message;
         }
     }
     return packageId;
 }
        public void UpdateRecord(object[] Params)
        {
            UserRegistration objUserReg = (UserRegistration)Params[0];
            try
            {
                string[] strParam = {
                                        UserCreditcardDetails.CardDetais.UserId.ToString(),
                                        UserCreditcardDetails.CardDetais.CreditCardType.ToString(),
                                       UserCreditcardDetails.CardDetais.CreditCardNo.ToString(),
                                       UserCreditcardDetails.CardDetais.CardholdersName.ToString(),
                                       UserCreditcardDetails.CardDetais.ExpirationDate.ToString(),
                                       UserCreditcardDetails.CardDetais.Address.ToString(),
                                       UserCreditcardDetails.CardDetais.Zip.ToString(),
                                       UserCreditcardDetails.CardDetais.State.ToString(),
                                       UserCreditcardDetails.CardDetais.Country.ToString(),
                                       UserCreditcardDetails.CardDetais.Telephone.ToString(),
                                       UserCreditcardDetails.CardDetais.CreditCardId.ToString(),
                                        "CVC",
                                        UserCreditcardDetails.CardDetais.City.ToString()

                                };

                DbType[] enumDbType ={
                                    DbType.Int32,
                                    DbType.String,
                                    DbType.String,
                                    DbType.String,
                                    DbType.DateTime,
                                    DbType.String,
                                    DbType.String,
                                    DbType.Int32,
                                    DbType.Int32,
                                    DbType.String,
                                    DbType.Int32,DbType.String,
                                    DbType.String
                                 };

                object[] objValue ={
                                    objUserReg.UserCreditcardDetails.UserId,
                   objUserReg.UserCreditcardDetails.CreditCardType,
                   objUserReg.UserCreditcardDetails.CreditCardNo,
                   objUserReg.UserCreditcardDetails.CardholdersName,
                   objUserReg.UserCreditcardDetails.ExpirationDate,
                   objUserReg.UserCreditcardDetails.Address,
                   objUserReg.UserCreditcardDetails.Zip,
                   objUserReg.UserCreditcardDetails.State,
                   objUserReg.UserCreditcardDetails.Country,
                   objUserReg.UserCreditcardDetails.Telephone,
                   objUserReg.UserCreditcardDetails.CreditCardId,
                   objUserReg.UserCreditcardDetails.CVC,
                       objUserReg.UserCreditcardDetails.City
                                   };
                base.UpdateRecordMinusIovs("usp_UpdateCreditCardDetails", strParam, enumDbType, objValue);

            }
            catch (System.Data.SqlClient.SqlException sqlEx)
            {
                if (sqlEx.Number >= 50000)
                {
                    Errors objError = new Errors();
                    objError.ErrorMessage = sqlEx.Message;
                    objUserReg.CustomError = objError;
                }
            }
        }
Esempio n. 14
0
        public Tributes(int tributeID, string tributeName, int tributeType, string welcomeMessage, string tributeImage, string tributeUrl, int themeId, string city, int state, int country, bool isPrivate, bool isOrderDVDChecked, bool isMemTributeBoxChecked, bool isActive, bool isDeleted, DateTime date1, DateTime date2, string attribute1, string attribute2, int createdBy, DateTime createdDate, int modifiedBy, DateTime modifiedDate, Errors customErrors, string tributePackageType, int linkMemTributeId, string PostMessage, string MessageWithoutHtml, string TributeFirstName, string TributeLastName, DateTime? MessageCreatedDate, DateTime? MessageModifiedDate, int MessageAddedModifiedBy)
        {
            this.TributeId = tributeID;
            this.TributeName = tributeName;
            this.TributeType = tributeType;
            this.WelcomeMessage = welcomeMessage;
            this.TributeImage = tributeImage;
            this.TributeUrl = tributeUrl;
            this.ThemeId = themeId;
            this.City = city;
            this.State = state;
            this.Country = country;
            this.IsPrivate = isPrivate;
            this.IsOrderDVDChecked = isOrderDVDChecked;
            this.IsMemTributeBoxChecked = isMemTributeBoxChecked;
            this.IsActive = isActive;
            this.IsDeleted = isDeleted;
            this.Date1 = date1;
            this.Date2 = date2;
            this.Attribute1 = attribute1;
            this.Attribute2 = attribute2;
            this.CreatedBy = createdBy;
            this.CreatedDate = createdDate;
            this.ModifiedBy = modifiedBy;
            this.ModifiedDate = modifiedDate;
            this.CustomError = customErrors;
            this.TributePackageType = tributePackageType;

            //Added for linked memorial tribute for video tribute
            this.LinkMemTributeId = linkMemTributeId;
            this.PostMessage = PostMessage;
            this.MessageWithoutHtml = MessageWithoutHtml;

            //YT enhancement phase 1: 26-11-2012

            this.TributeFirstName = TributeFirstName;
            this.TributeLastName = TributeLastName;

            //YT enhancement phase 1: 26-11-2012
            this.MessageCreatedDate = MessageCreatedDate;
            this.MessageModifiedDate = MessageModifiedDate;
            this.MessageAddedModifiedBy = MessageAddedModifiedBy;
        }
        /// <summary>
        /// Update Auto renew.
        /// </summary>
        /// <param name="Params"></param>
        public void UpdateAutoRenew(object[] Params)
        {
            TributePackage objUserReg = (TributePackage)Params[0];
            try
            {
                string[] strParam = {
                                       "TributePackageId","IsAutomaticRenew"
                               };

                DbType[] enumDbType ={
                                   DbType.Int32,
                   DbType.Boolean
                                };

                object[] objValue ={
                                    objUserReg.TributePackageId, objUserReg.IsAutomaticRenew
                                   };
                base.UpdateRecord("usp_UpdateAutoRenew", strParam, enumDbType, objValue);

            }
            catch (System.Data.SqlClient.SqlException sqlEx)
            {
                if (sqlEx.Number >= 50000)
                {
                    Errors objError = new Errors();
                    objError.ErrorMessage = sqlEx.Message;
                    objUserReg.CustomError = objError;
                }
            }
        }
        public int InsertDummyBusinessUser(String DummyUser)
        {
            bool userNameExists = false;
            int UserId = -1;

            try
            {

                object[] objParam = { DummyUser };
                DataSet _objDataSet = GetDataSet("usp_AvailableUser", objParam);
                int count = _objDataSet.Tables[0].Rows.Count;
                if (count > 0)
                {
                    String UserName = _objDataSet.Tables[0].Rows[0][0].ToString();
                    if (UserName != "0")
                    {
                        userNameExists = true;

                        object[] objParam1 ={ DummyUser,
                                            "zSpeN+GdR0Ey9VrM9QyvUA==",
                                     null
                                   };
                        //DataSet _objDataSet = GetDataSet("usp_ValidateUser", objParam);
                        DataSet _objDataSet1 = GetDataSetWithoutCheckingIOVS("usp_ValidateWebsiteUser", objParam1);
                        // ds.Tables[0].
                        if (_objDataSet1.Tables[0].Rows.Count > 0)
                        {
                            UserId = (int)_objDataSet1.Tables[0].Rows[0]["UserId"];
                        }

                    }

                }
            }
            catch (System.Data.SqlClient.SqlException sqlEx)
            {
                if (sqlEx.Number >= 50000)
                {
                    Errors objError = new Errors();
                    objError.ErrorMessage = sqlEx.Message;
                    //objUser.CustomError = objError;
                    userNameExists = false;
                }
            }
            /////////////////////////////////////////////////////////////////
            if (!userNameExists)
            {
                TributesPortal.BusinessEntities.Users objUsers = new TributesPortal.BusinessEntities.Users();
                UserRegistration objUserReg = new UserRegistration();

                objUsers.CountryName = "India";
                objUsers.Email = "*****@*****.**";
                objUsers.FacebookUid = null;
                objUsers.FirstName = "tajinder";
                objUsers.LastName = "kaur";
                objUsers.Password = "******";
                objUsers.City = "Delhi";
                objUsers.UserName = DummyUser;
                objUsers.UserType = 2;
                objUsers.UserImage = null;
                objUsers.Country = null;
                objUsers.State = null;
                objUsers.AllowIncomingMsg = false;
                objUsers.VerificationCode = "";

                TributesPortal.BusinessEntities.UserBusiness objUserBusiness = new TributesPortal.BusinessEntities.UserBusiness();
                objUserBusiness.BusinessAddress = "optimus";
                objUserBusiness.BusinessType = 1;
                objUserBusiness.City = "Delhi";
                objUserBusiness.CompanyName = "optimus";
                objUserBusiness.Country = "India";
                objUserBusiness.Email = "*****@*****.**";
                objUserBusiness.Phone = "9911089140";
                objUserBusiness.Website = "www.yourtribute.com";
                objUserBusiness.ZipCode = "201301";

                objUserReg.Users = objUsers;
                objUserReg.UserBusiness = objUserBusiness;

                try
                {
                    string[] strParam = {
                                    Users.UserEnum.UserName.ToString(),
                                    Users.UserEnum.Password.ToString(),
                                    Users.UserEnum.FirstName.ToString(),
                                    Users.UserEnum.LastName.ToString(),
                                    Users.UserEnum.Email.ToString(),
                                    Users.UserEnum.VerificationCode.ToString(),
                                    Users.UserEnum.AllowIncomingMsg.ToString(),
                                    Users.UserEnum.City.ToString(),
                                    Users.UserEnum.State.ToString(),
                                    Users.UserEnum.Country.ToString(),
                                    Users.UserEnum.UserImage.ToString(),
                                    Users.UserEnum.UserType.ToString(),
                                    Users.UserEnum.FacebookUid.ToString()
                                };

                    DbType[] enumDbType ={
                                    DbType.String,
                                    DbType.String,
                                    DbType.String,
                                    DbType.String,
                                    DbType.String,
                                    DbType.String,
                                    DbType.Boolean,
                                    DbType.String,
                                    DbType.Int32,
                                    DbType.Int32,
                                    DbType.String,
                                    DbType.Int32,
                                    DbType.Int64
                                 };
                    if (objUserReg.Users.State == -1)
                    {
                        objUserReg.Users.State = null;
                    }

                    object[] objValue ={
                                        objUserReg.Users.UserName.ToString(),
                                        objUserReg.Users.Password.ToString(),
                                        objUserReg.Users.FirstName.ToString(),
                                        objUserReg.Users.LastName.ToString(),
                                        objUserReg.Users.Email.ToString(),
                                        objUserReg.Users.VerificationCode.ToString(),
                                        objUserReg.Users.AllowIncomingMsg.ToString(),
                                        objUserReg.Users.City.ToString(),
                                        objUserReg.Users.State,
                                        objUserReg.Users.Country,
                                        objUserReg.Users.UserImage,
                                        objUserReg.Users.UserType,
                                        objUserReg.Users.FacebookUid
                                   };

                    DataSet _objDataSet1 = GetDataSetWithoutCheckingIOVS("usp_SaveUserPersonalAccount", objValue);
                    // ds.Tables[0].
                    int count1 = _objDataSet1.Tables[0].Rows.Count;
                    if (count1 > 0)
                    {
                        UserId = (int)_objDataSet1.Tables[0].Rows[0]["UserId"];
                        objUserReg.Users.UserId = UserId;
                    }
                    string[] strParam1 = {
                                    UserBusiness.UserRegistrationEnum.UserId.ToString(),
                                    UserBusiness.UserRegistrationEnum.Website.ToString(),
                                    UserBusiness.UserRegistrationEnum.CompanyName.ToString(),
                                    UserBusiness.UserRegistrationEnum.BusinessType.ToString(),
                                    UserBusiness.UserRegistrationEnum.BusinessAddress.ToString(),
                                    UserBusiness.UserRegistrationEnum.ZipCode.ToString(),
                                    "Phone"

                                };

                    DbType[] enumDbType1 ={
                                    DbType.Int64,
                                    DbType.String,
                                    DbType.String,
                                    DbType.Int64,
                                    DbType.String,
                                    DbType.String,
                                    DbType.String
                                 };

                    object[] objValue1 ={
                                    (Int64)objUserReg.Users.UserId,
                                    objUserReg.UserBusiness.Website.ToString(),
                                    objUserReg.UserBusiness.CompanyName.ToString(),
                                    objUserReg.UserBusiness.BusinessType.ToString(),
                                    objUserReg.UserBusiness.BusinessAddress.ToString(),
                                    objUserReg.UserBusiness.ZipCode.ToString(),
                                    objUserReg.UserBusiness.Phone.ToString()
                               };
                    //base.InsertRecord("usp_SaveUserBusinessAccount", strParam, enumDbType, objValue);
                    base.InsertRecordMinusIovs("usp_SaveUserBusinessAccount", strParam1, enumDbType1, objValue1);
                    //UserId = objUserReg.Users.UserId;
                }
                catch (System.Data.SqlClient.SqlException sqlEx)
                {
                    if (sqlEx.Number >= 50000)
                    {
                        Errors objError = new Errors();

                        objUserReg.CustomError = objError;
                        return -1;
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }

            return UserId;
        }
        //[TestMethod()]
        //insert a user if it does not exist
        public int InsertDummyUser(String DummyUser)
        {
            bool userNameExists = false;
            int UserId = -1;
            try
            {

                object[] objParam = { DummyUser };
                DataSet _objDataSet = GetDataSet("usp_AvailableUser", objParam);
                int count = _objDataSet.Tables[0].Rows.Count;
                if (count > 0)
                {
                    String UserName = _objDataSet.Tables[0].Rows[0][0].ToString();
                    if (UserName != "0")
                    {
                        userNameExists = true;

                        object[] objParam1 ={ DummyUser,
                                            "zSpeN+GdR0Ey9VrM9QyvUA==",
                                     null
                                   };
                        //DataSet _objDataSet = GetDataSet("usp_ValidateUser", objParam);
                        DataSet _objDataSet1 = GetDataSetWithoutCheckingIOVS("usp_ValidateWebsiteUser", objParam1);
                        // ds.Tables[0].
                        if (_objDataSet1.Tables[0].Rows.Count > 0)
                        {
                            UserId = (int)_objDataSet1.Tables[0].Rows[0]["UserId"];
                        }

                    }

                }
            }
            catch (System.Data.SqlClient.SqlException sqlEx)
            {
                if (sqlEx.Number >= 50000)
                {
                    Errors objError = new Errors();
                    objError.ErrorMessage = sqlEx.Message;
                    //objUser.CustomError = objError;
                    userNameExists = false;
                }
            }
            /////////////////////////////////////////////////////////////////
            if (!userNameExists)
            {
                object[] objValue ={
                                            DummyUser,
                                            "zSpeN+GdR0Ey9VrM9QyvUA==",//objUserReg.Users.Password.ToString(),
                                            "Tajinder",
                                            "Kaur",//objUserReg.Users.LastName.ToString(),
                                            "*****@*****.**",//objUserReg.Users.Email.ToString(),
                                            "",//objUserReg.Users.VerificationCode.ToString(),
                                            "False",//objUserReg.Users.AllowIncomingMsg.ToString(),
                                            "Delhi",//objUserReg.Users.City.ToString(),
                                            null,//objUserReg.Users.State,
                                            null,//objUserReg.Users.Country,
                                            null,//objUserReg.Users.UserImage,
                                            1,//objUserReg.Users.UserType,
                                            null,//objUserReg.Users.FacebookUid
                                       };
                //Identity = base.InsertDataAndReturnIdMinusIOVS("usp_SaveUserPersonalAccount", strParam, enumDbType, objValue);

                DataSet _objDataSet1 = GetDataSetWithoutCheckingIOVS("usp_SaveUserPersonalAccount", objValue);
                // ds.Tables[0].
                int count1 = _objDataSet1.Tables[0].Rows.Count;
                if (count1 > 0)
                {
                    UserId = (int)_objDataSet1.Tables[0].Rows[0]["UserId"];
                    String UserName = _objDataSet1.Tables[0].Rows[0]["UserName"].ToString();
                }
            }
            return UserId;
        }
        /// <summary>
        /// by Ud: Get the UserId of the user.
        /// </summary>
        /// <param name="DummyUser"></param>
        /// <returns></returns>
        public int GetUserId(String DummyUser)
        {
            int UserId = -1;
            try
            {

                object[] objParam = { DummyUser };
                DataSet _objDataSet = GetDataSet("usp_AvailableUser", objParam);
                int count = _objDataSet.Tables[0].Rows.Count;
                if (count > 0)
                {
                    String UserName = _objDataSet.Tables[0].Rows[0][0].ToString();
                    if (UserName != "0")
                    {
                        object[] objParam1 ={ DummyUser,
                                            "pF+30xcCC/6QBQ0cwBd0Nw==",
                                     null
                                   };
                        //DataSet _objDataSet = GetDataSet("usp_ValidateUser", objParam);
                        DataSet _objDataSet1 = GetDataSetWithoutCheckingIOVS("usp_ValidateWebsiteUser", objParam1);
                        // ds.Tables[0].
                        if (_objDataSet1.Tables[0].Rows.Count > 0)
                        {
                            UserId = (int)_objDataSet1.Tables[0].Rows[0]["UserId"];
                        }
                    }
                }
            }
            catch (System.Data.SqlClient.SqlException sqlEx)
            {
                if (sqlEx.Number >= 50000)
                {
                    Errors objError = new Errors();
                    objError.ErrorMessage = sqlEx.Message;
                    //objUser.CustomError = objError;

                }
            }
            return UserId;
        }
        public void UserAvailabilityTest()
        {
            UserInfoManager target = new UserInfoManager(); // TODO: Initialize to an appropriate value
            //UserRegistration _objUserRegistration = null; // TODO: Initialize to an appropriate value
            // target.UserAvailability(_objUserRegistration);
            //Assert.Inconclusive("A method that does not return a value cannot be verified.");
            bool userNameExists = false;
            try
            {
                InsertDummyUser("tj_op");
                object[] objParam = { "tj_op" };
                DataSet _objDataSet = GetDataSet("usp_AvailableUser", objParam);
                int count = _objDataSet.Tables[0].Rows.Count;
                if (count > 0)
                {
                    String UserName = _objDataSet.Tables[0].Rows[0][0].ToString();
                    if (UserName != "0")
                    {
                        userNameExists = true;
                    }

                }
            }
            catch (System.Data.SqlClient.SqlException sqlEx)
            {
                if (sqlEx.Number >= 50000)
                {
                    Errors objError = new Errors();
                    objError.ErrorMessage = sqlEx.Message;
                    //objUser.CustomError = objError;
                    userNameExists = false;
                }
            }

            Assert.AreEqual(true, userNameExists);
        }
        public void SavePersonalAccountTest()
        {
            UserInfoManager target = new UserInfoManager(); // TODO: Initialize to an appropriate value
            UserRegistration _UserRegistration = new UserRegistration(); // TODO: Initialize to an appropriate value
            //object expected = null; // TODO: Initialize to an appropriate value
            //object actual;

            bool userNameExists = false;
            int UserId = -1;
            String DummyUser = "******";
            try
            {

                object[] objParam = { DummyUser };
                DataSet _objDataSet = GetDataSet("usp_AvailableUser", objParam);
                int count = _objDataSet.Tables[0].Rows.Count;
                if (count > 0)
                {
                    String UserName = _objDataSet.Tables[0].Rows[0][0].ToString();
                    if (UserName != "0")
                    {
                        userNameExists = true;

                        object[] objParam1 ={ DummyUser,
                                            "zSpeN+GdR0Ey9VrM9QyvUA==",
                                     null
                                   };
                        //DataSet _objDataSet = GetDataSet("usp_ValidateUser", objParam);
                        DataSet _objDataSet1 = GetDataSetWithoutCheckingIOVS("usp_ValidateWebsiteUser", objParam1);
                        // ds.Tables[0].
                        if (_objDataSet1.Tables[0].Rows.Count > 0)
                        {
                            UserId = (int)_objDataSet1.Tables[0].Rows[0]["UserId"];
                        }

                    }

                }
            }
            catch (System.Data.SqlClient.SqlException sqlEx)
            {
                if (sqlEx.Number >= 50000)
                {
                    Errors objError = new Errors();
                    objError.ErrorMessage = sqlEx.Message;
                    //objUser.CustomError = objError;
                    userNameExists = false;
                }
            }
            /////////////////////////////////////////////////////////////////
            if (!userNameExists)
            {
                TributesPortal.BusinessEntities.Users objUsers = new TributesPortal.BusinessEntities.Users();

                objUsers.CountryName = "India";
                objUsers.Email = "*****@*****.**";
                objUsers.FacebookUid = null;
                objUsers.FirstName = "tajinder";
                objUsers.LastName = "kaur";
                objUsers.Password = "******";
                objUsers.City = "Delhi";
                objUsers.UserName = DummyUser;
                objUsers.UserType = 2;
                objUsers.UserImage = null;
                objUsers.Country = null;
                objUsers.State = null;
                objUsers.AllowIncomingMsg = false;
                objUsers.VerificationCode = "";

                TributesPortal.BusinessEntities.UserBusiness objUserBusiness = new TributesPortal.BusinessEntities.UserBusiness();
                objUserBusiness.BusinessAddress = "optimus";
                objUserBusiness.BusinessType = 1;
                objUserBusiness.City = "Delhi";
                objUserBusiness.CompanyName = "optimus";
                objUserBusiness.Country = "India";
                objUserBusiness.Email = "*****@*****.**";
                objUserBusiness.Phone = "9911089140";
                objUserBusiness.Website = "www.yourtribute.com";
                objUserBusiness.ZipCode = "201301";

                _UserRegistration.Users = objUsers;
                _UserRegistration.UserBusiness = objUserBusiness;

                object UserId1 = target.SavePersonalAccount(_UserRegistration);
                UserId = (int)UserId1;
                //Assert.AreEqual(expected, actual);
                //Assert.Inconclusive("Verify the correctness of this test method.");
            }
            Assert.AreEqual(true, UserId > 0);
        }
 public object InsertPackageDetails(object[] objTributes)
 {
     object Identity = new object();
     TributePackage tributes = (TributePackage)objTributes[0];
     string confirmationId = objTributes[1].ToString();
     if (!Equals(objTributes, null))
     {
         try
         {
             string[] strTributeParams ={
                                         TributePackage.PackageTribute.UserId.ToString(),
                                         TributePackage.PackageTribute.UserTributeId.ToString(),
                                         TributePackage.PackageTribute.StartDate.ToString(),
                                         TributePackage.PackageTribute.EndDate.ToString(),
                                         TributePackage.PackageTribute.IsAutomaticRenew.ToString(),
                                         TributePackage.PackageTribute.AmountPaid.ToString(),
                                         TributePackage.PackageTribute.PackageId.ToString(),
                                         TributePackage.PackageTribute.CouponId.ToString(),
                                         TributePackage.PackageTribute.IsSponsor.ToString(),
                                         TributePackage.PackageTribute.IsSponserHide.ToString(),
                                         TributePackage.PackageTribute.CreditCardId.ToString(),
                 "PaymentConfirmation"
                                         };
             DbType[] dbType ={
                               DbType.Int64,
                               DbType.Int64,
                               DbType.DateTime,
                               DbType.DateTime,
                               DbType.Boolean,
                               DbType.Currency,
                               DbType.Int64,
                               DbType.Int64,
                               DbType.Boolean,
                               DbType.Boolean,
                               DbType.Int64,
                               DbType.String
                 };
             object[] objValue ={tributes.UserId,
                 tributes.UserTributeId,tributes.StartDate,tributes.EndDate,tributes.IsAutomaticRenew,
                 tributes.AmountPaid,tributes.PackageId,tributes.CouponId,tributes.IsSponsor,
                 tributes.IsSponserHide,tributes.CreditCardId,confirmationId
                                  };
             Identity = base.InsertDataAndReturnId("InsertPackageDetails", strTributeParams, dbType, objValue);
         }
         catch (System.Data.SqlClient.SqlException sqlEx)
         {
             if (sqlEx.Number > 50000)
             {
                 Errors errors = new Errors();
                 errors.ErrorMessage = sqlEx.Message;
                 tributes.CustomError = errors;
                 return Identity;
             }
         }
     }
     return Identity;
 }
Esempio n. 22
0
        /// <summary>
        /// This method will update the tribute detail
        /// </summary>
        /// 
        /// <param name="objTribute">Stories object which contain the Tribute detail which user want to update
        /// </param>
        public void UpdateTributeDetail(Stories objTribute)
        {
            try
            {
                if (objTribute != null)
                {
                    //sets the parameters
                    string[] strParam = { Stories.StoriesEnum.TributeId.ToString(),
                                          Stories.StoriesEnum.TributeName.ToString(),
                                          Stories.StoriesEnum.TributeImage.ToString(),
                                          Stories.StoriesEnum.City.ToString(),
                                          Stories.StoriesEnum.State.ToString(),
                                          Stories.StoriesEnum.Country.ToString(),
                                          Stories.StoriesEnum.Date1.ToString(),
                                          Stories.StoriesEnum.Date2.ToString(),
                                          Stories.StoriesEnum.ModifiedBy.ToString(),
                                          Stories.StoriesEnum.ModifiedDate.ToString(),
                                        };

                    //sets the types of parameters
                    DbType[] enumType = { DbType.Int64,
                                          DbType.String,
                                          DbType.String,
                                          DbType.String,
                                          DbType.Int64,
                                          DbType.Int64,
                                          DbType.DateTime,
                                          DbType.DateTime,
                                          DbType.Int64,
                                          DbType.DateTime,
                                        };

                    object[] objTributeVal = { objTribute.TributeId,
                                               objTribute.TributeName,
                                               objTribute.TributeImage,
                                               objTribute.City,
                                               objTribute.State,
                                               objTribute.Country,
                                               objTribute.Date1,
                                               objTribute.Date2,
                                               objTribute.ModifiedBy,
                                               objTribute.ModifiedDate
                                             };
                    UpdateRecord("usp_UpdateTributeDetail", strParam, enumType, objTributeVal);
                }
            }
            catch (System.Data.SqlClient.SqlException sqlEx)
            {
                if (sqlEx.Number >= 50000)
                {
                    Errors objError = new Errors();
                    objError.ErrorMessage = sqlEx.Message;
                    objTribute.CustomError = objError;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public object InsertRecord(object[] Params)
        {
            object Identity = new object();
            UserRegistration objUserReg = (UserRegistration)Params[0];
            try
            {

                string[] strParam = {
                                       UserCreditcardDetails.CardDetais.UserId.ToString(),
                                       UserCreditcardDetails.CardDetais.CardholdersName.ToString(),
                                       UserCreditcardDetails.CardDetais.CreditCardType.ToString(),
                                       UserCreditcardDetails.CardDetais.CreditCardNo.ToString(),
                                       UserCreditcardDetails.CardDetais.ExpirationDate.ToString(),
                                       UserCreditcardDetails.CardDetais.Address.ToString(),
                                       UserCreditcardDetails.CardDetais.City.ToString(),
                                       UserCreditcardDetails.CardDetais.Zip.ToString(),
                                       UserCreditcardDetails.CardDetais.State.ToString(),
                                       UserCreditcardDetails.CardDetais.Country.ToString(),
                                       UserCreditcardDetails.CardDetais.Telephone.ToString(),
                                       UserCreditcardDetails.CardDetais.IsCardDetailsReusable.ToString(),
                                       "NotifyBeforeRenew","CVC",
                //    "SponsorEmailAddress"
                                       UserCreditcardDetails.CardDetais.SponsorEmailAddress.ToString()
                                };
                DbType[] enumDbType ={
                                    DbType.Int32,
                                    DbType.String,
                                    DbType.String,
                                    DbType.String,
                                    DbType.DateTime,
                                    DbType.String,
                                    DbType.String,
                                    DbType.String,
                                    DbType.Int32,
                                    DbType.Int32,
                                    DbType.String,
                                    DbType.Boolean,
                                    DbType.Boolean, DbType.String, DbType.String
                                 };
                object[] objValue ={
                                    objUserReg.UserCreditcardDetails.UserId,
                                    objUserReg.UserCreditcardDetails.CardholdersName,
                                    objUserReg.UserCreditcardDetails.CreditCardType,
                                    objUserReg.UserCreditcardDetails.CreditCardNo,
                                    objUserReg.UserCreditcardDetails.ExpirationDate,
                                    objUserReg.UserCreditcardDetails.Address,
                                    objUserReg.UserCreditcardDetails.City,
                                    objUserReg.UserCreditcardDetails.Zip,
                                    objUserReg.UserCreditcardDetails.State,
                                    objUserReg.UserCreditcardDetails.Country,
                                    objUserReg.UserCreditcardDetails.Telephone,
                                    objUserReg.UserCreditcardDetails.IsCardDetailsReusable,
                                    objUserReg.UserCreditcardDetails.NotifyBeforeRenew,objUserReg.UserCreditcardDetails.CVC,
                                    objUserReg.UserCreditcardDetails.SponsorEmailAddress
                                   };
                // base.UpdateRecord("usp_InsertCreditCardDetails", strParam, enumDbType, objValue);
                Identity = base.InsertDataAndReturnIdMinusIOVS("usp_InsertCreditCardDetails", strParam, enumDbType, objValue);

            }
            catch (System.Data.SqlClient.SqlException sqlEx)
            {
                if (sqlEx.Number >= 50000)
                {
                    Errors objError = new Errors();
                    objError.ErrorMessage = sqlEx.Message;
                    objUserReg.CustomError = objError;
                    return Identity;
                }
            }
            return Identity;
        }
Esempio n. 24
0
        //UpdateObituaryDetail
        public void UpdateObituaryDetail(Stories objsTribute)
        {
            try
            {
                if (objsTribute != null)
                {
                    //sets the parameters
                    string[] strParam = { Stories.ObituaryMaintainState.TributeId.ToString(),
                                          Stories.ObituaryMaintainState.PostMessage.ToString(),
                                          Stories.ObituaryMaintainState.MessageWithoutHtml.ToString(),
                                          Stories.ObituaryMaintainState.MessageAddedModifiedBy.ToString(),
                                        };

                    //sets the types of parameters
                    DbType[] enumType = { DbType.Int64,
                                          DbType.String,
                                          DbType.String,
                                          DbType.Int64,
                                        };

                    object[] objTributeVal = { objsTribute.TributeId,
                                               objsTribute.PostMessage,
                                               objsTribute.MessageWithoutHtml,
                                               objsTribute.MessageAddedModifiedBy
                                             };
                    UpdateRecordMinusIovs("usp_UpdateObituaryDetail", strParam, enumType, objTributeVal);
                }
            }
            catch (System.Data.SqlClient.SqlException sqlEx)
            {
                if (sqlEx.Number >= 50000)
                {
                    Errors objError = new Errors();
                    objError.ErrorMessage = sqlEx.Message;
                    objsTribute.CustomError = objError;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        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;
                }
            }
        }
Esempio n. 26
0
 /// <summary>
 ///  This method will Add and update the Story detail and also add new topic in the more about section
 /// </summary>
 /// 
 /// <param name="objStory">Stories object which contain the story detail which user want to update
 /// </param>
 public void UpdateStoryDetail(Stories objStory)
 {
     try
     {
         if (objStory != null)
         {
             if (objStory.Operation == "Add")
             {
                 InsertStory(objStory);
             }
             else if (objStory.Operation == "Update")
             {
                 UpdateStory(objStory);
             }
         }
     }
     catch (System.Data.SqlClient.SqlException sqlEx)
     {
         if (sqlEx.Number >= 50000)
         {
             Errors objError = new Errors();
             objError.ErrorMessage = sqlEx.Message;
             objStory.CustomError = objError;
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public void InsertCoupons(object[] objTributes, string Couponid)
        {
            Coupons objcoupons = (Coupons)objTributes[0];
            if (!Equals(objTributes, null))
            {
                try
                {

                    string[] strTributeParams ={"PrimaryCouponID",
                                                "SerialNumber",
                                                "CouponCode"
                                                };
                    DbType[] dbType ={
                                            DbType.Int64,
                                            DbType.Decimal,DbType.String

                        };
                     CouponsAvailable objCouponAv = objcoupons.Couponsavailable;
                    int id= int.Parse(Couponid);
                    string[] coupons=objCouponAv.CouponCode.Split(';');
                    for (int i = 0; i < coupons.Length; i++)
                    {
                        object[] objValue ={ id, i, coupons[i] };
                        base.InsertRecord("usp_InsertCoupons", strTributeParams, dbType, objValue);
                    }

                }
                catch (System.Data.SqlClient.SqlException sqlEx)
                {
                    if (sqlEx.Number > 50000)
                    {
                        Errors errors = new Errors();
                        errors.ErrorMessage = sqlEx.Message;
                        objcoupons.CustomError = errors;

                    }
                }
            }
        }
Esempio n. 28
0
        /// <summary>
        /// This method will delete the Topic from the More about section
        /// </summary>
        /// <param name="objStory">stories object which contain the Section id and Userbioagraphy ID
        ///                        of the topic which topic user wants to delete
        /// </param>
        public void DeleteTopic(Stories objStory)
        {
            try
            {
                if (objStory != null)
                {
                    object[] objStoryParam = { objStory.MoreAboutSection[0].SectionId, objStory.MoreAboutSection[0].UserBiographyId };

                    Delete("usp_DeleteTopic", objStoryParam);
                }
            }
            catch (System.Data.SqlClient.SqlException sqlEx)
            {
                if (sqlEx.Number >= 50000)
                {
                    Errors objError = new Errors();
                    objError.ErrorMessage = sqlEx.Message;
                    objStory.CustomError = objError;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public void DeleteCoupons(object[] objTributes)
        {
            Couponmaster tributes = (Couponmaster)objTributes[0];
            if (!Equals(objTributes, null))
            {
                try
                {

                    string[] strTributeParams ={
                                                "Userid" ,"CouponID"
                                                };
                    DbType[] dbType ={
                                      DbType.Int64,
                                      DbType.Int64

                        };
                    object[] objValue ={tributes.ModifiedBy,tributes.PrimaryCouponID
                                         };
                    base.UpdateRecord("usp_DeteleCoupons", strTributeParams, dbType, objValue);

                }
                catch (System.Data.SqlClient.SqlException sqlEx)
                {
                    if (sqlEx.Number > 50000)
                    {
                        Errors errors = new Errors();
                        errors.ErrorMessage = sqlEx.Message;

                    }
                }
            }
        }
        public void GetCreditPointCount(object[] objValue)
        {
            UserRegistration objUserReg = (UserRegistration)objValue[0];
            try
            {
                object[] objParam = { objUserReg.Users.UserId };
                DataSet _objDataSet = GetDataSet("usp_GetCreditCount", objParam);

                if (_objDataSet.Tables[0].Rows.Count != 0)
                {
                    CreditPointTransaction objTranDetails = new CreditPointTransaction();
                    objTranDetails.TransactionId = !string.IsNullOrEmpty(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.TransactionId.ToString()].ToString()) ? Convert.ToInt32(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.TransactionId.ToString()].ToString()) : 0;
                    objTranDetails.UserId = !string.IsNullOrEmpty(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.UserId.ToString()].ToString()) ? Convert.ToInt32(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.UserId.ToString()].ToString()) : 0;
                    objTranDetails.NetCreditPoints = !string.IsNullOrEmpty(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.NetCreditPoints.ToString()].ToString()) ? Convert.ToDouble(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.NetCreditPoints.ToString()].ToString()) : 0;
                    objTranDetails.AmountPaid = !string.IsNullOrEmpty(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.AmountPaid.ToString()].ToString()) ? Convert.ToInt32(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.AmountPaid.ToString()].ToString()) : 0;
                    objTranDetails.CreditPackageId = !string.IsNullOrEmpty(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.CreditPackageId.ToString()].ToString()) ? Convert.ToInt32(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.CreditPackageId.ToString()].ToString()) : 0;
                    objTranDetails.PurchasedDate = DateTime.Parse(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.PurchasedDate.ToString()].ToString());
                    objTranDetails.IsDeleted = !string.IsNullOrEmpty(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.IsDeleted.ToString()].ToString()) ? bool.Parse(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.IsDeleted.ToString()].ToString()) : false;
                    if (!(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.ModifiedDate.ToString()] == null || _objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.ModifiedDate.ToString()].ToString() == ""))
                    {
                        objTranDetails.ModifiedDate = DateTime.Parse(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.ModifiedDate.ToString()].ToString());
                    }
                    if (!(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.CouponId.ToString()] == null || _objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.CouponId.ToString()].ToString() == ""))
                    {
                        objTranDetails.CouponId = Convert.ToInt32(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.CouponId.ToString()].ToString());
                    }
                    if (!(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.CreditCardId.ToString()] == null || _objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.CreditCardId.ToString()].ToString() == ""))
                    {
                        objTranDetails.CreditCardId = Convert.ToInt32(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.CreditCardId.ToString()].ToString());
                    }
                    if (!(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.CreatedDate.ToString()] == null || _objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.CreatedDate.ToString()].ToString() == ""))
                    {
                        objTranDetails.CreatedDate = DateTime.Parse(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.CreatedDate.ToString()].ToString());
                    }
                    if (!(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.ConfirmationNo.ToString()] == null || _objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.ConfirmationNo.ToString()].ToString() == ""))
                    {
                        objTranDetails.ConfirmationNo = Convert.ToInt32(_objDataSet.Tables[0].Rows[0][CreditPointTransaction.CreditPointDetails.ConfirmationNo.ToString()].ToString());
                    }
                    else
                        objTranDetails.ConfirmationNo = 0;
                    objUserReg.CreditPointTransaction = objTranDetails;
                }
            }
            catch (System.Data.SqlClient.SqlException sqlEx)
            {
                if (sqlEx.Number >= 50000)
                {
                    Errors objError = new Errors();
                    objError.ErrorMessage = sqlEx.Message;
                    objUserReg.CustomError = objError;
                }
            }
        }