protected override IUnitsModel GetModel() { IFunctionCollection collection = ProfilingViewModel.Application.ServiceContainer.Resolve <IFunctionCollection>(); FunctionsModel model = new FunctionsModel(collection); return(model); }
public ActionResult Results() { FunctionsModel model = new FunctionsModel(); model.PrintNumbersReturn = GetPrintNumbersReturn(); model.squaredReturn = GetFunctionSquaredReturn(); model.fibonacciReturn = GetFibonacciReturn(); return(View(model)); }
public FunctionsModel InsertIndentedFunction(string orgCode, int eventID, int functionID, string functionDescription, string statusCode, string coordinator) { var myFunction = new FunctionsModel { OrganizationCode = orgCode, EventID = eventID, Description = functionDescription, StatusCode = statusCode, StartDate = System.DateTime.Now, EndDate = System.DateTime.Now.AddDays(1), Coordinator = coordinator }; return(APIUtil.InsertIndentedFunction(USISDKClient, functionID, myFunction)); }
public FunctionsModel AddWithUserFields(string orgCode, int eventID, int functionID, string statusCode, string issueType, int newUserNumber03) { var myFunction = new FunctionsModel { OrganizationCode = orgCode, EventID = eventID, StatusCode = statusCode, StartDate = System.DateTime.Now, EndDate = System.DateTime.Now.AddDays(1) }; //Here's how to add a user field set with values to a new function myFunction.FunctionUserFieldSets = new List <UngerboeckSDKPackage.UserFields>(); UngerboeckSDKPackage.UserFields myUserField = new UngerboeckSDKPackage.UserFields(); //Note that class is always EventSales (C) and is automatically set in Ungerboeck. myUserField.Type = issueType; //Use the Opportunity Type code from your user field. This matches the value stored in Ungerboeck table column CR073_ISSUE_TYPE. myUserField.UserNumber03 = newUserNumber03; //Set the value in the user field property myFunction.FunctionUserFieldSets.Add(myUserField); //Then add it back into the EventModel object. You can add multiple user field sets to the same event object before saving. return(APIUtil.InsertAfterFunction(USISDKClient, functionID, myFunction)); //You can also use APIUtil.InsertIndentedFunction() }
public IActionResult Edit(double squareFunctionLowerBound, double squareFunctionUpperBound, double squareFunctionInterval) { // deliberately commiting the fat controller antipattern var functions = new FunctionsModel(); // wasting a bit of performance for (int i = 0; i < 10000; i++) { var x = squareFunctionLowerBound; var interval = squareFunctionInterval >= 0 ? squareFunctionInterval : 1.0; var upper = squareFunctionUpperBound >= squareFunctionLowerBound ? squareFunctionUpperBound : squareFunctionLowerBound; var list = new List <Tuple <double, double> >(); while (x <= squareFunctionUpperBound) { list.Add(new Tuple <double, double>(x, Math.Pow(x, 2))); x += interval; } functions.SquareFunctionInterval = squareFunctionInterval; functions.SquareFunctionLowerBound = squareFunctionLowerBound; functions.SquareFunctionUpperBound = squareFunctionUpperBound; functions.Values = list; // wasting more performance try { throw new Exception($"Blah {i}"); } catch (Exception ex) { Console.WriteLine(ex.Message); } } return(View(functions)); }
public IActionResult Edit() { var functions = new FunctionsModel(); return(View(functions)); }