public float ExecuteOperation(float firstNumber, float secondNumber, EnumOperationBi operation) { float result = l_operBi[(int)operation]( firstNumber, secondNumber); AddOperationInLog(firstNumber, secondNumber, result, operation); return result; }
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); } }
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); }
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); }