private void Popup_ModifierClient_Load(object sender, EventArgs e) { ISessionFactory sessionFactory = new Configuration().Configure().BuildSessionFactory(); ISession session = sessionFactory.OpenSession(); using (ITransaction transaction = session.BeginTransaction()) { TypeStructure lesTypeStructure = new TypeStructure(); comboBoxTS.DataSource = lesTypeStructure.GetLesTypesStructure(); comboBoxChoixStructure.DataSource = session.CreateQuery(@"select e from Structure e order by e.denominationSociale asc").List <Structure>(); if (interlocuteur != null) { if (interlocuteur.nomInterlocuteur != null) { textBoxNom.Text = interlocuteur.nomInterlocuteur; } if (interlocuteur.prenomInterlocuteur != null) { textBoxPrenom.Text = interlocuteur.prenomInterlocuteur; } if (interlocuteur.telInterlocuteur != null) { textBoxTel.Text = interlocuteur.telInterlocuteur; } if (interlocuteur.telInterlocuteur != null) { textBoxTel.Text = interlocuteur.telInterlocuteur; } if (interlocuteur.mailInterlocuteur != null) { textBoxMail.Text = interlocuteur.mailInterlocuteur; } // Si l'interlocuteur est un particulier if (isIndividu) { Individu individu = session.CreateQuery("select e from Individu e where e.interlocuteur.idInterlocuteur=:num").SetParameter("num", interlocuteur.idInterlocuteur).UniqueResult <Individu>(); if (individu.adresseIndividu != null) { textBoxAdresse.Text = individu.adresseIndividu; } if (individu.cpIndividu != null) { textBoxCp.Text = individu.cpIndividu; } if (individu.villeIndividu != null) { textBoxVille.Text = individu.villeIndividu; } if (individu.distanceSiege != null) { textBoxDistance.Text = individu.distanceSiege.ToString(); } if (individu.infosSupplementaire != null) { textBoxIC.Text = individu.infosSupplementaire; } } // Si l'interlocuteur est un interlocuteur_structure if (!isIndividu) { groupBoxParticulier.Visible = false; groupBoxStructureExistante.Visible = true; InterlocuteurStructure interlocuteurStructure = session.CreateQuery("select e from InterlocuteurStructure e where e.interlocuteur.idInterlocuteur=:num").SetParameter("num", interlocuteur.idInterlocuteur).UniqueResult <InterlocuteurStructure>(); if (interlocuteurStructure.structure != null) { foreach (Structure s in comboBoxChoixStructure.Items) { if (s.numStructure == interlocuteurStructure.structure.numStructure) { comboBoxChoixStructure.SelectedItem = s; } } } } } session.Dispose(); } }
private string getSourceParameters(MethodStructure methodStructure, TypeStructure x) { return($"{x.Name}:{(x.Attributes.ContainsKey("FromBodyAttribute") ? "\"BODY\"" : methodStructure.URL.Contains($"{{{x.Name}}}") ? "\"URL\"" : "\"QUERY\"")}");
public AssignmentFromObj(TypeStructure typeStructure, Types.JSString type) : this(typeStructure) { }
public static ValueStructureSparse Create(TypeStructure valueType) { return(new ValueStructureSparse(valueType)); }
public DirectAssignment(TypeStructure typeStructure, Types.JSString type) : this(typeStructure) { }
private void buildConstructorComment(TypeStructure typeStructure) { childRenderbles.Add((JSRenderble)DI.Get <IClassConstructorComment>(typeStructure)); }
private string getFromObjectPropertyTagName(TypeStructure typeStructure) { return(((JSRenderble)DI.Get <IFromObjectAssignmentProperty>(typeStructure, new JSNumber())).Name); }
public ArrayTypeStructure(TypeStructure elementType) : base(elementType) { }
public NullableTypeStructure(TypeStructure elementType) : base(elementType) { }
public Parameter(TypeStructure type, bool hasModifier) { Type = type; HasModifier = hasModifier; }
public PointerTypeStructure(TypeStructure elementType) : base(elementType) { }
protected NodeTypeStructure(TypeStructure elementType) => ElementType = elementType;
public void TestRequestContainer() { var idParameter = new TypeStructure { Attributes = new Dictionary <string, Attribute> { }, IsSytemType = true, Name = "id", Type = typeof(int) }; var classStructure = new ClassStructure { Attributes = new Dictionary <string, Attribute> { }, Name = "Person", URL = "API/Person", Methods = new List <MethodStructure> { new MethodStructure { Attributes = new Dictionary <string, Attribute> { { "HttpGetAttribute", new IgnoreAttribute() } }, Name = "Get", URL = "API/Person", IsRPC = false, Parameters = new List <TypeStructure> { }, Result = new TypeStructure { IsArray = true, Name = personTypeStructure.Name, Properties = personTypeStructure.Properties, TypeName = personTypeStructure.TypeName } }, new MethodStructure { Attributes = new Dictionary <string, Attribute> { { "HttpGetAttribute", new IgnoreAttribute() } }, Name = "Get", URL = "API/Person/{id}", IsRPC = false, Parameters = new List <TypeStructure> { idParameter }, Result = personTypeStructure } , new MethodStructure { Attributes = new Dictionary <string, Attribute> { { "HttpPutAttribute", new IgnoreAttribute() } }, Name = "Put", URL = "API/Person/{id}", IsRPC = false, Parameters = new List <TypeStructure> { idParameter, personTypeStructure }, Result = successTypeStructure }, new MethodStructure { Attributes = new Dictionary <string, Attribute> { { "HttpPostAttribute", new IgnoreAttribute() } }, Name = "Post", URL = "API/Person", IsRPC = false, Parameters = new List <TypeStructure> { personTypeStructure }, Result = successTypeStructure }, new MethodStructure { Attributes = new Dictionary <string, Attribute> { { "HttpDeleteAttribute", new IgnoreAttribute() } }, Name = "Delete", URL = "API/Person/{id}", IsRPC = false, Parameters = new List <TypeStructure> { idParameter }, Result = successTypeStructure } } }; var jsCode = ((JSRenderble)DI.Get <IJSClass>(classStructure)).GetText(); Assert.AreEqual(jsCode, "import {request,globalTokens} from \"./request/request.js\";\r\nimport {Person} from \"./models/Person.js\";\r\nimport {PersonDetails} from \"./models/PersonDetails.js\";\r\nimport {ResultAction} from \"./models/ResultAction.js\";\r\n\r\nclass PersonRequestContainer \r\n{\r\n /**\r\n * PersonRequestContainer. Use instance to make requests to: API/Person\r\n * @param { String } baseURL\r\n*/\r\n constructor(baseUrl) \r\n {\r\n/**\r\n * @type String\r\n*/\r\nthis.baseUrl = baseUrl;\r\n\r\nthis._Get = new request(this.baseUrl,\"API/Person\",\"GET\",{}, Person);\r\n\r\nthis._GetById = new request(this.baseUrl,\"API/Person/{id}\",\"GET\",{id:\"URL\"}, Person);\r\n\r\nthis._PutById = new request(this.baseUrl,\"API/Person/{id}\",\"PUT\",{id:\"URL\",Person:\"BODY\"}, ResultAction);\r\n\r\nthis._Post = new request(this.baseUrl,\"API/Person\",\"POST\",{Person:\"BODY\"}, ResultAction);\r\n\r\nthis._DeleteById = new request(this.baseUrl,\"API/Person/{id}\",\"DELETE\",{id:\"URL\"}, ResultAction);\r\n\r\n }\r\n setHttpHeaders(headerObject)\r\n {\r\n for (var key in headerObject){\r\n globalTokens[key] = headerObject[key];\r\n }\r\n }\r\n /**\r\n * Method used to invoke request of type: GET to URL: API/Person.\r\n<< ParameterTypeComment >>\r\n * @return {PromiseLike<Person[]>}\r\n*/\r\n Get ()\r\n {\r\n return this._Get.ExecuteRequest({});\r\n }\r\n\r\n /**\r\n * Method used to invoke request of type: GET to URL: API/Person/{id}.\r\n * @param { Number } id\r\n * @return {PromiseLike<Person>}\r\n*/\r\n GetById (id)\r\n {\r\n return this._GetById.ExecuteRequest({id:id});\r\n }\r\n\r\n /**\r\n * Method used to invoke request of type: PUT to URL: API/Person/{id}.\r\n * @param { Number } id\r\n * @param { Person } Person\r\n * @return {PromiseLike<ResultAction>}\r\n*/\r\n PutById (id,Person)\r\n {\r\n return this._PutById.ExecuteRequest({id:id,Person:Person});\r\n }\r\n\r\n /**\r\n * Method used to invoke request of type: POST to URL: API/Person.\r\n * @param { Person } Person\r\n * @return {PromiseLike<ResultAction>}\r\n*/\r\n Post (Person)\r\n {\r\n return this._Post.ExecuteRequest({Person:Person});\r\n }\r\n\r\n /**\r\n * Method used to invoke request of type: DELETE to URL: API/Person/{id}.\r\n * @param { Number } id\r\n * @return {PromiseLike<ResultAction>}\r\n*/\r\n DeleteById (id)\r\n {\r\n return this._DeleteById.ExecuteRequest({id:id});\r\n }\r\n\r\n}\r\n\r\nexport {Person,PersonDetails,ResultAction,PersonRequestContainer};"); }
public AssignmentFromObj(TypeStructure typeStructure, Types.JSBoolArray type) : this(typeStructure) { }
private bool shouldProcessParameter(Models.ItemType objectType, TypeStructure parameterStructure) { return(!parameterStructure.IsSytemType && AppDomain.CurrentDomain.GetAssemblies().Contains(objectType.Type.Assembly)); }
public QualifiedNameStructure(TypeStructure left, SimpleNameStructure right) { Left = left; Right = right; }
private void buildExport(TypeStructure typeStructure) { childRenderbles.Add((JSRenderble)DI.Get <IExport>(typeStructure)); }
protected ValueStructure(TypeStructure valueType, Dictionary <string, ILanguageValue> value) { ValueStructureType = valueType; Value = value; }
private void buildFromObjectAssignmentProperties(TypeStructure typeStructure) { multiplyTags(typeStructure.Properties.Count, getFromObjectPropertyTagName(typeStructure)); childRenderbles.AddRange(typeStructure.Properties.Select(property => (JSRenderble)DI.Get <IFromObjectAssignmentProperty>(property, JSTypeMapping.GetJSType(property)))); }
protected ValueStructure(TypeStructure valueType) { ValueStructureType = valueType; Value = new Dictionary <string, ILanguageValue>(); }
protected ValueStructureSparse(TypeStructure valueType) { ValueStructureType = valueType; }
//public static ValueStructure Create(TypeStructure value_type) //{ // return new ValueStructure(value_type); //} public static ValueStructure Create(TypeStructure valueType, Dictionary <string, ILanguageValue> value) { return(new ValueStructure(valueType, value)); }
public DirectAssignment(TypeStructure typeStructure, Types.JSNumber type) : this(typeStructure) { }
public JSFunction(TypeStructure typeStructure) : base(Resources.functionPOKO) { assignLocalProperties(typeStructure); createPOCOClassConstructorComment(); createPOCOClassProperties(typeStructure); }
public DirectAssignment(TypeStructure typeStructure, Types.JSBoolArray type) : this(typeStructure) { }
public static bool CompareTypes(TypeStructure first, TypeStructure second) => Compare(first, second);
public ExportPOCO(TypeStructure typeStructure) : base("ExportPOCO") { tagValues = new Dictionary <string, string> { { typesTag, Configuration.Instance.ModelsNameFactory(typeStructure.TypeName) } }; }
public AssignmentFromObj(TypeStructure typeStructure, Types.JSNumber type) : this(typeStructure) { }