Ejemplo n.º 1
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.º 2
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.º 3
0
 private void SetGreeting(tMember m, tCard c)
 {
     lblGreeting.Text = "Hola";
     lblName.Text = m.Firstname + " " + m.Lastname;
     lblMembershipInfo.Text = m.tMemberType.MemberTypeDescription;
 }
Ejemplo n.º 4
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.º 5
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();
        }