コード例 #1
0
        public float ExecuteOperation(float firstNumber, float secondNumber, EnumOperationBi operation)
        {
            float result = l_operBi[(int)operation]( firstNumber, secondNumber);
            AddOperationInLog(firstNumber, secondNumber, result, operation);

            return result;
        }
コード例 #2
0
        public float ExecuteOperation(float firstNumber, float secondNumber, EnumOperationBi operation)
        {
            try
            {
                var result = l_operBi[(int)operation](firstNumber, secondNumber);

                AddOperationInLog(firstNumber, secondNumber, result, operation);

                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return(0);
            }
        }
コード例 #3
0
        private void AddOperationInLog(float firstNumber, float secondNumber, float result, EnumOperationBi operation)
        {
            DataOperation dataOperation;
            var           list_log = (List <DataOperation>)Session["LogOperations"];

            if (list_log == null)
            {
                Session["LogOperations"] = new List <DataOperation>();
                list_log = (List <DataOperation>)Session["LogOperations"];
            }

            dataOperation.firstNumber  = firstNumber;
            dataOperation.secondNumber = secondNumber;
            dataOperation.result       = result;
            dataOperation.enumOper     = operation;

            list_log.Add(dataOperation);
        }
コード例 #4
0
        private void AddOperationInLog(float firstNumber, float secondNumber, float result, EnumOperationBi operation)
        {
            DataOperation dataOperation;
            List<DataOperation> list_log = (List<DataOperation>)Session["LogOperations"];

            if (list_log == null)
            {
                Session["LogOperations"] = new List<DataOperation>();
                list_log = (List<DataOperation>)Session["LogOperations"];
            }

            dataOperation.firstNumber = firstNumber;
            dataOperation.secondNumber = secondNumber;
            dataOperation.result = result;
            dataOperation.enumOper = operation;

            list_log.Add(dataOperation);
        }