Beispiel #1
0
        private void modifyInfoStripMenuItem1_Click(object sender, EventArgs e)
        {
            //权限管理
            if (!CheckAuthority.Check(LoginData.Authority, Authority.WareHouse))
            {
                MessageBox.Show("你还没有权限进行操作!. \n 请联系管理员. \n ", "Authority!", MessageBoxButtons.OK);
                return;
            }
            //权限管理|| LoginData.Authority == Authority.WareHouse
            //if (LoginData.Authority == Authority.Guest )
            //{
            //    MessageBox.Show("你还没有权限进行操作!. \n 请联系管理员. \n ", "Authority!", MessageBoxButtons.OK);
            //    return;
            //}

            int rowIndex = dgvMaterialList.CurrentCell.RowIndex;

            if (rowIndex < 0)
            {
                return;
            }

            ModifyMaterialInfo fmModify = new ModifyMaterialInfo(dgvMaterialList.Rows[rowIndex]);

            fmModify.ShowDialog();
        }
Beispiel #2
0
        private void btnOutMaterial_Click(object sender, EventArgs e)
        {
            //权限管理
            if (!CheckAuthority.Check(LoginData.Authority, Authority.WareHouse))
            {
                MessageBox.Show("你还没有权限进行操作!. \n 请联系管理员. \n ", "Authority!", MessageBoxButtons.OK);
                return;
            }
            //if (LoginDataInfo.LoginData.Authority == Authority.Guest || LoginDataInfo.LoginData.Authority == Authority.Buyer)
            //{
            //    MessageBox.Show("你还没有权限进行操作!. \n 请联系管理员. \n ", "Authority!", MessageBoxButtons.OK);
            //    return;
            //}
            OutMaterial fm = new OutMaterial();

            fm.ShowDialog();

            UpdateMaterialList();
        }
        public static void Run()
        {
            Console.WriteLine(GetPatternDescription());
            GoToNextStep();

            while (true)
            {
                Console.Clear();
                Console.WriteLine(ExeucteFirstWhenConditionMatchesFlavorDescription());
                Console.WriteLine(ExecuteAllUntilConditionIsFalseFlavorDescription());
                Console.WriteLine(ExecuteAllFlavorDescritpion());
                Console.WriteLine("1: Money Spender (flavor 1)");
                Console.WriteLine("2: File Transfer (flavor 1)");
                Console.WriteLine("3: User Processor (flavor 1 and 3)");
                Console.WriteLine("4: pitfals");
                Console.WriteLine("5: Poker Game (flavor 1)");
                Console.Write("0: exit\r\n>");

                var keyChar = GoToNextStep();

                switch (keyChar)
                {
                case '1':
                    CheckAuthority moneySpender = new CheckAuthority();

                    Console.WriteLine(moneySpender.GetDescriptionOfExample());
                    GoToNextStep();

                    moneySpender.PrintHowMuchEachCanSpend();
                    moneySpender.SpendMoney();
                    break;

                case '2':
                    TransferFilesManager transferFilesManager = new TransferFilesManager();

                    Console.WriteLine(transferFilesManager.GetDescriptionOfExample());
                    GoToNextStep();
                    transferFilesManager.TransferFiles();
                    break;

                case '3':
                    UserProcessor userProcessor = new UserProcessor();
                    userProcessor.DoStuff();
                    break;

                case '4':
                    Console.WriteLine(GetPitfalls());
                    GoToNextStep();
                    break;

                case '5':
                    PokerGame poke = new PokerGame();
                    poke.newGame();
                    break;
                }

                if (keyChar == '0')
                {
                    break;
                }
            }
        }