Ejemplo n.º 1
0
        private void btnAccept_Click(object sender, EventArgs e)
        {
            if (txtMemberId.Text.Length <= 0)
            {
                return;
            }
            oldCard = cards.GetCard(tag);

            newCard.CardId = Convert.ToInt64(txtMemberId.Text);
            newCard.Changed = DateTime.Today;
            newCard.Enabled = true;
            newCard.EndDate = oldCard.EndDate;
            newCard.StartDate = oldCard.StartDate;
            newCard.Tickets = oldCard.Tickets;
            newCard.TypeId = oldCard.TypeId;

            tCardUsage.CardId = newCard.CardId;
            tCardUsage.EntranceDate = DateTime.Now;
            tCardUsage.Description = "Nueva tarjeta de vieja tarjeta " + oldCard.CardId;

            cards.SaveNewCard(newCard);
            cardUsage.MoveCardUsage(oldCard.CardId,newCard.CardId);
            member.MoveMember(oldCard.CardId, newCard.CardId);
            cardUsage.InsertCardUsage(tCardUsage);
            oldCard.Enabled = false;
            cards.SaveCard(oldCard);
            this.ReturnValue = Convert.ToInt32(txtMemberId.Text);
        }
Ejemplo n.º 2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txtMemberId.Text.Equals("Ingrese numero de tarjeta") || txtMemberName.Text.Length == 0 || txtLastNames.Text.Length == 0 || txtCellphone.Text.Length == 0)
            {
            }
            else
            {
                this.tPrice = (tPrice)this.cmbCardType.SelectedItem;
                this.tMember = new tMember();
                this.tCard = new tCard();
                  cards.SaveCard(PopulateCard());
                //members.SaveMember(PopulateMember());

                ReturnValue = Convert.ToInt32(txtMemberId.Text);
                this.Dispose();
                }
        }
Ejemplo n.º 3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            this.tPrice = (tPrice)this.cmbCardType.SelectedItem;
            if (this.tPrice.PriceId <= 0 || txtValidTo.Text.Length == 0 || txtMemberName.Text.Length == 0 || txtLastNames.Text.Length == 0 || txtCellphone.Text.Length == 0)
            {
                return;
            }
            if (this.newMember)
            {
                this.tMember = new tMember();
                this.tCard = new tCard();
                if (this.txtMemberName.Text != "" && this.txtCellphone.Text != "")

                    members.SaveMember(PopulateMember());

                cards.SaveCard(PopulateCard());
            }
            else
            {
                members.SaveMember(PopulateMember());
                cards.SaveCard(PopulateCard());

            }
        }
Ejemplo n.º 4
0
 private void SaveTickets(tCard card)
 {
     card.Tickets = card.Tickets - 1;
     SaveCardUsage(card);
     cards.SaveCard(card);
 }
Ejemplo n.º 5
0
 private void SaveMonthly(tCard card)
 {
     SaveCardUsage(card);
 }
Ejemplo n.º 6
0
 private void SaveCardUsage(tCard card)
 {
     tCardUsage = new tCardUsage { CardId = card.CardId, EntranceDate = DateTime.Now };
     cardUsage.InsertCardUsage(tCardUsage);
 }
Ejemplo n.º 7
0
 private void SetGreeting(tMember m, tCard c)
 {
     lblGreeting.Text = "Hola";
     lblName.Text = m.Firstname + " " + m.Lastname;
     lblMembershipInfo.Text = m.tMemberType.MemberTypeDescription;
 }
Ejemplo n.º 8
0
        private tCard UpdateCard(tCard c, tPrice p)
        {
            c.StartDate = DateTime.Now;
            c.EndDate = DateTime.Now.AddMonths(1);
            c.Changed = DateTime.Now;
            c.Enabled = true;
            c.Tickets = p.Count;

            c.TypeId = p.PriceId;
            return c;
        }
Ejemplo n.º 9
0
        private void SaveOrder(Types types, int value)
        {
            if (value == 0)
            {
                RemoveRow((int)types);
                SetButtons(true, true, true, true);

                return;
            }
            tCard = cards.GetCard(value);
            tMember = members.GetMember(tCard.CardId.ToString());
            lblName.Text = tMember.Firstname + " " + tMember.Lastname;
            lblCardId.Text = tCard.CardId.ToString();
            ShowLabels(true);

            cards.SaveCard(UpdateCard(tCard, tPrices.Find(p => p.PriceId == (int)types)));
            tCardUsage.CardId = tCard.CardId;
            tCardUsage.EntranceDate = DateTime.Now;
            tCardUsage.Description = "Compra de: " + tPrices.Find(p => p.PriceId == (int)types).PriceDescription;
            cardUsage.InsertCardUsage(tCardUsage);
        }
Ejemplo n.º 10
0
        private void SearchMember(string input)
        {
            tMember = new tMember();
            tMember = members.GetMember(input);
            newMember = false;
            if (tMember == null) return;

            tCard = cards.GetCardInfo((long)tMember.CardId);
            SetCardInfo(tMember.CardId.ToString());

            txtCellphone.Text = tMember.Cellphone;
            txtMemberId.Text = tMember.MemberId.ToString();
            txtMemberName.Text = tMember.Firstname;
            txtLastNames.Text = tMember.Lastname;
            txtMemberType.Text = tMember.tMemberType.MemberTypeDescription;

            if (tCard != null)
            {
                txtValidTo.Text = tCard.EndDate.Value.ToShortDateString();
                if (tCard.EndDate < DateTime.Now)
                {
                    txtValidTo.ForeColor = Color.DarkRed;
                }
            }
            txtTickets.Text = tCard.Tickets.ToString();
            cmbCardType.SelectedIndex = tCard.TypeId;
            if (tCard.Enabled != null)
            {
                chkValid.Checked = (bool)tCard.Enabled;
            }
            SetgbMember();
        }