예제 #1
0
        //Amended by TBBC on 22 September 2015 for Intro friend package.
        public bool SaveIntroduceFriendforPackage(string strMembershipID, string strIntroducerID, string strPromotionCode, int employeeID)
        {
            bool bolReturn = false;

            ACMSDAL.ConnectionProvider connProvider = new ConnectionProvider();
            TblMember sqlMember = new TblMember();

            try
            {
                sqlMember.MainConnectionProvider = connProvider;
                connProvider.OpenConnection();
                connProvider.BeginTransaction("SaveIntroduceFriendforPackage");

                //sqlMember.UpdateIntroducerMembershipID(strMembershipID, strIntroducerID);
                DataTable IntroFriendFreebieTable = sqlMember.AddIntroFriendPackage(strIntroducerID, "INTRO " + strMembershipID, strPromotionCode, employeeID);

                //if (IntroFriendFreebieTable.Rows.Count > 0)
                //{
                //    bolReturn = true;
                //}
                connProvider.CommitTransaction();
                return(true);
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                if (connProvider.CurrentTransaction != null)
                {
                    connProvider.CurrentTransaction.Dispose();
                }
                if (connProvider.DBConnection != null)
                {
                    if (connProvider.DBConnection.State == ConnectionState.Open)
                    {
                        connProvider.DBConnection.Close();
                    }
                    connProvider.DBConnection.Dispose();
                }
                //sqlRewardsTransaction.Dispose();
                sqlMember.Dispose();
            }
        }