public void UpdateCards(CustomerIsssueCard model)
        {
            Htl_CustomerCards comm = entities.Htl_CustomerCards.Where(u => u.CustomerCardsId == model.CustomerCardsId).FirstOrDefault();


            comm.CardId      = model.CardId;
            comm.AgentId     = model.AgentId;
            comm.CustomerId  = Convert.ToInt16(model.CustomerID);
            comm.CreateDate  = model.Created;
            comm.CreatedBy   = model.CreatedBy;
            comm.UpdatedBy   = model.UpdatedBy;
            comm.UpdatedDate = model.Updated;
            entities.ApplyCurrentValues(comm.EntityKey.EntitySetName, comm);
            entities.SaveChanges();
        }
        public void CreateCards(CustomerIsssueCard model)
        {
            Htl_CustomerCards obj = new Htl_CustomerCards
            {
                //CardId = model.CustomerCardId.ElementAt(0),
                CardId     = model.CardId,
                AgentId    = model.AgentId,
                CustomerId = Convert.ToInt16(model.CustomerID),
                CreateDate = DateTime.Now,
                CreatedBy  = model.CreatedBy,
            };

            entities.AddToHtl_CustomerCards(obj);
            entities.SaveChanges();
        }