Exemplo n.º 1
0
        private void AssignCard_WhenCardPresent(object sender, EventArgs e)
        {
            ////Button Manipulation
            ///

            MemberAccess = new MemberTableAccess();
            CardTableAccess  cardTable = new CardTableAccess();
            CardClass        CardThis;
            List <CardClass> CardList;

            byte[] bufferKey;

            bufferKey = CardThread.KeyNo;
            CardList  = cardTable.FindCard("CardNo", bufferKey);

            if (CardList.Count != 0)
            {
                CardMem      = new CardMemForm();
                CardMem.Card = CardList[0];
                CardMem.Show();
                //CardMem.FormClosing += CardMemForm_Closing;
            }
            else
            {
                MessageBox.Show("The card is not in the system, please Add card into the system");
                //AssignCard();
                ButtonControl(true);
            }
        }
Exemplo n.º 2
0
        private void bAssign_Click(object sender, EventArgs e)
        {
            CardTableAccess     CardAccess     = new CardTableAccess();
            DocumentTableAccess DocumentAccess = new DocumentTableAccess();
            MemberTableAccess   MemberAccess   = new MemberTableAccess();

            DocumentClass    buffDoc;
            List <CardClass> CardList;

            if (!Member.IsMember)
            {
                MessageBox.Show("Person is not a member, Please Sign up first");
            }
            else
            {
                CardList = CardAccess.FindCard("CustomerID", Member.ID);

                if (CardList.Count != 0)
                {
                    foreach (CardClass buff in CardList)
                    {
                        buff.IsActive = false;
                        buff.EndDate  = DateTime.Today;

                        CardAccess.UpdateExistingCard(buff);
                    }

                    buffDoc = DocumentAccess.FindDocument("SystemID", Member.ID);
                    DocumentAccess.UpdatePersonalLog(buffDoc, EventLogManipulation.EventTranslationFirst.Card_Loss);
                    ////Update Daily log
                    ///
                    Card.CustomerID = Member.ID;

                    Card.IsActive = Member.Validity;
                    Card.EffDate  = Member.EffDate;
                    Card.EndDate  = Member.EndDate;

                    CardAccess.UpdateExistingCard(Card);
                    //MemberAccess.UpdateExistingMember(Member);

                    DocumentAccess.UpdatePersonalLog(buffDoc, EventLogManipulation.EventTranslationFirst.Card_Replace);
                }
                else
                {
                    Card.CustomerID = Member.ID;

                    Card.IsActive = Member.Validity;
                    Card.EffDate  = Member.EffDate;
                    Card.EndDate  = Member.EndDate;

                    CardAccess.UpdateExistingCard(Card);
                    //MemberAccess.UpdateExistingMember(Member);

                    buffDoc = DocumentAccess.FindDocument("SystemID", Member.ID);
                    DocumentAccess.UpdatePersonalLog(buffDoc, EventLogManipulation.EventTranslationFirst.Card_Replace);
                    //// Update daily log
                }
            }
        }
Exemplo n.º 3
0
        private void InitMenu()
        {
            CardThread = new CardThreading();
            CardAccess = new CardTableAccess();


            Task cardState = new Task(CardThread.CardChecking.Invoke);

            cardState.Start();

            CardThread.CardPresent += this.OnCardPresent;

            Member = new MemberClass();
        }
Exemplo n.º 4
0
        private void bAddCard_Click(object sender, EventArgs e)
        {
            CardTableAccess  CardAccess = new CardTableAccess();
            List <CardClass> bufcard;

            bufcard = CardAccess.FindCard("CardNo", NewCard.CardNumber);

            if (bufcard.Count == 0)
            {
                CardAccess.AddCard(NewCard);
            }
            else
            {
                MessageBox.Show("Card Exist in the system");
            }
        }
Exemplo n.º 5
0
 private int UpdateCardID()
 {
     CardAccess = new CardTableAccess();
     return(CardAccess.FindLastCardID() + 1);
 }