Exemple #1
0
        public CashSelectorState(CashSelector mainForm, string language, Cash cash) : base(mainForm, language)
        {
            //if (language.Equals("CHINESE"))
            //    header.Text = "This is Chinese";
            //else if (language.Equals("MALAY"))
            //    header.Text = "This is Malay";
            //else    //English
            //    header.Text = "This is English";

            if (cash == null)
            {
                c2   = 0;
                c5   = 0;
                c10  = 0;
                c50  = 0;
                c100 = 0;
            }
            else
            {
                c2   = Convert.ToInt32(cash.getNotesQty(0));
                c5   = Convert.ToInt32(cash.getNotesQty(1));
                c10  = Convert.ToInt32(cash.getNotesQty(2));
                c50  = Convert.ToInt32(cash.getNotesQty(3));
                c100 = Convert.ToInt32(cash.getNotesQty(4));

                //label
                c2Cnt.Text   = Convert.ToString(c2);
                c5Cnt.Text   = Convert.ToString(c5);
                c10Cnt.Text  = Convert.ToString(c10);
                c50Cnt.Text  = Convert.ToString(c50);
                c100Cnt.Text = Convert.ToString(c100);
            }
        }
        public CashState(CashSelector mainForm, string language)
        {
            this.mainForm = mainForm;

            c2Cnt   = (Label)mainForm.Controls["c2Cnt"];
            c5Cnt   = (Label)mainForm.Controls["c5Cnt"];
            c10Cnt  = (Label)mainForm.Controls["c10Cnt"];
            c50Cnt  = (Label)mainForm.Controls["c50Cnt"];
            c100Cnt = (Label)mainForm.Controls["c100Cnt"];
            // increment & decrement
            c2CntM   = (Label)mainForm.Controls["c2CntM"];
            c2CntP   = (Label)mainForm.Controls["c2CntP"];
            c5CntM   = (Label)mainForm.Controls["c5CntM"];
            c5CntP   = (Label)mainForm.Controls["c5CntP"];
            c10CntM  = (Label)mainForm.Controls["c10CntM"];
            c10CntP  = (Label)mainForm.Controls["c10CntP"];
            c50CntM  = (Label)mainForm.Controls["c50CntM"];
            c50CntP  = (Label)mainForm.Controls["c50CntP"];
            c100CntM = (Label)mainForm.Controls["c100CntM"];
            c100CntP = (Label)mainForm.Controls["c100CntP"];
        }