/// <summary> /// Maps RestOrderIn to Order object /// </summary> /// <param name="rOrderIn">RestOrderIn object</param> /// <param name="dc">Repository controller</param> /// <returns></returns> public static Order ROrderInToOrder(ROrderIn rOrderIn, IDomainController dc) { Product p = (Product)Enum.Parse(typeof(Product), rOrderIn.Product); Order order = new Order(p, rOrderIn.Amount, dc.GetClient(rOrderIn.ClientId)); order.Id = rOrderIn.OrderId; return(order); }
private IDomainController GetDomainController() { if (domainController == null) { domainController = ControllerFactory.CreateDomainController(); } return(domainController); }
public static IDomainController CreateDomainController() { string assemblyName = System.Configuration.ConfigurationManager.AppSettings["ControllerAssembly"]; Assembly controllerAssembly = Assembly.Load(assemblyName); string controllerName = System.Configuration.ConfigurationManager.AppSettings["ControllerType"]; IDomainController controller = (IDomainController)controllerAssembly.CreateInstance(controllerName); return(controller); }
protected void addRelationshipButton_Click(object sender, EventArgs e) { string propertyName = propertyNameTextBox.Text; if (string.IsNullOrEmpty(propertyName)) { return; } string propertyTypeName = relationshipTypeDropDownList.SelectedValue; if (string.IsNullOrEmpty(propertyTypeName)) { return; } string multiplicity = relationshipMultiplicityDropDownList.SelectedValue; if (string.IsNullOrEmpty(multiplicity)) { return; } if (string.IsNullOrEmpty(typeName)) { return; } IDomainController domainController = GetDomainController(); Type type = domainController.GetTypeFromTypeName(typeName); Type propertyType = domainController.GetTypeFromTypeName(propertyTypeName); IEngine engine = EngineFactory.CreateEngine(); string command = "create "; command += multiplicity.ToLower() + " "; command += typeName + "." + propertyName + " (Type = " + propertyTypeName; if (!string.IsNullOrEmpty(inverseNameTextBox.Text)) { command += ", Inverse = " + inverseNameTextBox.Text; } command += ")"; engine.Execute(command); ListProperties(); }
private void LoadDataTypes() { propertyTypeDropDownList.Items.Add("System.Boolean"); propertyTypeDropDownList.Items.Add("System.Byte"); propertyTypeDropDownList.Items.Add("System.DateTime"); propertyTypeDropDownList.Items.Add("System.Decimal"); propertyTypeDropDownList.Items.Add("System.Int16"); propertyTypeDropDownList.Items.Add("System.Int32"); propertyTypeDropDownList.Items.Add("System.Int64"); propertyTypeDropDownList.Items.Add("System.String"); IDomainController domainController = GetDomainController(); foreach (string typeName in domainController.GetTypeNames()) { relationshipTypeDropDownList.Items.Add(typeName); } }
private IDomainController GetDomainController() { if (domainController == null) domainController = ControllerFactory.CreateDomainController(); return domainController; }
public ValueComparer(IDomainController controller, bool descending) { this.controller = controller; this.descending = descending; }
public ValueComparer(IDomainController controller) : this(controller, false) { }
public ObjectComparer(IDomainController controller, string propertyName, bool descending) { this.controller = controller; this.propertyName = propertyName; this.valueComparer = new ValueComparer(controller, descending); }
public ObjectComparer(IDomainController controller, string propertyName) : this(controller, propertyName, false) { }
public TypeControllerBase(IDomainController domainController) { this.domainController = domainController; }
public GeoServiceController(IDomainController dc, IConfiguration iconfiguation) { this.dc = dc; apiUrl = iconfiguation.GetValue <string>("profiles:GeoService:applicationUrl"); }
/// <summary> /// Constructor for API controller /// </summary> /// <param name="dc">RepositoryController</param> /// <param name="loggerFactory">LoggingObject</param> public KBController(IDomainController dc, ILoggerFactory loggerFactory) { this.dc = dc; this.logger = loggerFactory.AddFile("KlantenServiceLogs.txt").CreateLogger("KlantenService"); }
protected override void OnLoad(EventArgs e) { domainController = ControllerFactory.CreateDomainController(); engine = EngineFactory.CreateEngine(); string className = Request["class"]; string typeName = Request["type"]; string id = Request["id"]; string property = Request["property"]; string page = Request["page"]; string sort = Request["sort"]; string desc = Request["desc"]; if (className != null) { SelectedType = GetTypeFromTypeName(className); SelectedObjects = GetObjectsOfType(SelectedType); } if (typeName != null && id != null) { Type type = GetTypeFromTypeName(typeName); SelectedObject = GetObjectByIdentity(id, type); } SelectedPropertyName = property; if (page != null) { int pageNr; if (int.TryParse(page, out pageNr)) currentPage = pageNr; } SortProperty = sort; if (desc != null) descending = true; base.OnLoad(e); }