public tk_FreeEventCustomers SaveFreeEventCustomer(GenericViewModel model, int ticketID)
        {
            var    cust    = new tk_FreeEventCustomers();
            string tranRef = string.Empty;

            try
            {
                if (model != null)
                {
                    cust.DateCreated = DateTime.Now;
                    cust.Email       = model.FreeEventCustomerEmail;
                    cust.EventId     = ticketID;
                    cust.Fullname    = model.FreeEventCustomerName;
                    cust.PhoneNo     = model.FreeEventCustomerPhoneNo;
                    cust.NoOfPersons = model.FreeEventNoofPersons;
                    cust.IsEmailSent = "N";
                    cust.UserId      = 1;
                    cust.Status      = "SUCCESSFULL";
                    cust.Retry       = 0;
                    cust.ReferenceNo = RefferenceGenerator.GenerateReference(GetCurrentCounter());
                    repoFreeEventCustomers.Add(cust);
                    var retV1 = unitOfWork.CommitNonAsync(1) > 0 ? true : false;
                    if (retV1)
                    {
                        var counter = repotk_BatchCounter.GetNonAsync(null);
                        counter.BatchNo = counter.BatchNo + 1;
                        repotk_BatchCounter.Update(counter);
                        var rtv = unitOfWork.CommitNonAsync(1) > 0 ? true : false;

                        // Save SMS Table
                        // Insert Into PromoLog Table
                        var sms = new tk_Sms();
                        sms.DateCreated = DateTime.Now;
                        sms.Retry       = 0;
                        sms.Message     = "Dear " + cust.Fullname + ", Your Ticket Planet Ref is: " + cust.ReferenceNo + " this RefNo  is required for Confirmation at the Event";
                        sms.PhoneNo     = cust.PhoneNo;
                        sms.IsSent      = "N";
                        repoSms.Add(sms);
                        var retV3 = unitOfWork.CommitNonAsync(1) > 0 ? true : false;

                        return(cust);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(cust);
        }
        public ReturnValues SaveIntoTransactionLog(string tranRef)
        {
            var rtv         = new ReturnValues();
            var tranlog     = new tk_TransactionLog();
            var TranDetails = repoEventCustomer.GetNonAsync(o => o.PayStackReferenceNo == tranRef);

            tranlog.ContactFullname   = TranDetails.Fullname;
            tranlog.ContactPhoneNo    = TranDetails.PhoneNo;
            tranlog.ContactEmail      = TranDetails.Email;
            tranlog.PayStackReference = TranDetails.PayStackReferenceNo;
            tranlog.ReferenceNo       = TranDetails.ReferenceNo;
            tranlog.TransactionDate   = DateTime.Now;
            tranlog.TotalAmount       = TranDetails.TotalAmount;
            tranlog.Price             = TranDetails.UnitPrice;
            tranlog.Status            = "SUCCESSFULL";
            tranlog.DateCreated       = DateTime.Now;

            repotk_TranLog.Add(tranlog);
            var retV = unitOfWork.CommitNonAsync(1) > 0 ? true : false;

            if (retV)
            {
                // mails
                var mails = new tk_Sms();
                mails.DateCreated = DateTime.Now;
                mails.Retry       = 0;
                mails.Message     = "Dear " + tranlog.ContactFullname + ", Thank You For Your Ticket Purchase From <a href= 'https://www.ticketplanet.ng'> Ticket Planet</ a >.We Are Happy To Have You On Board!. Buy Movie Tickets Up To 3 Times This Month For FilmHouse Cinema Or IMax And Receive 5% Off Any Event Ticket Purchase Of Your Choice And Stay Tuned For For More Exciting Offers And Discount From Us!. Feel Free To Contact Us On 09070111115 For Any Questions And To Join The Whatsapp Group Where Special Offers And Discounts Are Shared.";
                mails.PhoneNo     = tranlog.ContactPhoneNo;
                mails.IsSent      = "N";
                repoSms.Add(mails);
                var retV1 = unitOfWork.CommitNonAsync(1) > 0 ? true : false;
                // Insert Into PromoLog Table
                var sms = new tk_Sms();
                sms.DateCreated = DateTime.Now;
                sms.Retry       = 0;
                sms.Message     = "Dear " + tranlog.ContactFullname + ", Your Ticket Planet Ref is: " + tranlog.ReferenceNo + " this RefNo  is required for Confirmation at the Event";
                sms.PhoneNo     = tranlog.ContactPhoneNo;
                sms.IsSent      = "N";
                repoSms.Add(sms);
                var retV3 = unitOfWork.CommitNonAsync(1) > 0 ? true : false;

                rtv.nErrorCode = 0;
            }
            return(rtv);
        }