JNode IJsonSerializable.ToJNode(object config) { var jn = new JNode(); jn.AddPrimitive("entityType", this.EntityType.Name); jn.AddArray("values", this.Values); return jn; }
void IJsonSerializable.FromJNode(JNode jNode) { ServiceName = jNode.Get<String>("serviceName"); // Adapter = null; HasServerMetadata = jNode.Get<bool>("hasServerMetadata"); // JsonResultsAdapter UseJsonP = jNode.Get<bool>("useJsonp"); }
public JNode GetNode(DataRow pRow) { JNode Node = new JNode((int)pRow["Code"], "Driver.JDriver"); Node.MouseDBClickAction = new JAction("EditDriver", "BusManagment.Driver.DriverForm.ShowDialog", null, new object[] { (int)pRow["Code"] }); return(Node); }
public DataService(JNode jNode) { ServiceName = jNode.Get<String>("serviceName"); // Adapter = null; HasServerMetadata = jNode.Get<bool>("hasServerMetadata"); // JsonResultsAdapter UseJsonP = jNode.Get<bool>("useJsonp"); }
public EntityKey(JNode jn) { var etName = jn.Get<String>("entityType"); _entityType = MetadataStore.Instance.GetEntityType(etName); ClrType = _entityType.ClrType; // coerce the incoming data Values = jn.GetPrimitiveArray("values", EntityType.KeyProperties.Select(kp => kp.ClrType)).ToArray(); }
public static JNode GetTreeNode() { JNode Node = new JNode(0, 0); Node.Name = "Shifts"; Node.MouseClickAction = new JAction("Shifts", "BusManagment.WorkOrder.JShifts.ListView"); return(Node); }
void SetParents(JNode node) { foreach (var ch in node.Children()) { Parents[ch] = node; SetParents(ch); } }
public static JNode GetTreeNode() { JNode Node = new JNode(0, 0); Node.Name = "Payments"; Node.MouseClickAction = new JAction("Payments", "BusManagment.Documents.JAUTPayments.ListView"); return(Node); }
public static JNode GetTreeNode() { JNode Node = new JNode(0, 0); Node.Name = "RegisterVacation"; Node.MouseClickAction = new JAction("Vacatrion", "BusManagment.WorkOrder.JAUTVacations.ListView"); return(Node); }
JNode IJsonSerializable.ToJNode(object config) { var jn = new JNode(); jn.AddEnum("fetchStrategy", this.FetchStrategy); jn.AddEnum("mergeStrategy", this.MergeStrategy); return(jn); }
public DataService(JNode jNode) { ServiceName = jNode.Get<String>("serviceName"); HasServerMetadata = jNode.Get<bool>("hasServerMetadata"); // TODO: implement JsonResultsAdapter UseJsonP = jNode.Get<bool>("useJsonp"); Adapter = GetAdapter(jNode.Get<String>("adapterName")); InitializeHttpClient(); }
internal SaveException(EntityManager em, JNode jn) : base() { _message = jn.Get<String>("ExceptionMessage") ?? "see EntityErrors"; var entityErrors = jn.GetArray<EntityError>("Errors", "errors", "EntityErrors", "entityErrors"); entityErrors = entityErrors.Select(ee => ee.Resolve(em)); _entityErrors = new SafeList<EntityError>(entityErrors); IsServerError = true; }
/// <summary> /// تشکیل زیردرخت کلاس اطلاعات پایه /// </summary> public JNode[] TreeView() { JNode[] N = new JNode[2]; N[0] = JAStaticAction._SubsidiariessNode(); //N[1] = JAStaticAction._DefineKartablNode(); return(N); }
public static JNode GetTreeNode() { JNode Node = new JNode(0, 0); Node.Name = "Path"; Node.MouseClickAction = new JAction("Path", "BusManagment.Line.JLineNodePathse.ListView"); return(Node); }
public static JNode GetTreeNode() { JNode Node = new JNode(0, 0); Node.Name = "Atumobile"; Node.MouseClickAction = new JAction("Autombile", "AUTOMOBILE.AutomobileDefine.JAutomobileDefines.ListView"); return(Node); }
JNode IJsonSerializable.ToJNode() { var jo = new JNode(); jo.Add("serviceName", this.ServiceName); jo.Add("adapterName", this.Adapter == null ? null : this.Adapter.Name); jo.Add("hasServerMetadata", this.HasServerMetadata); jo.Add("jsonResultsAdapter", this.JsonResultsAdapter == null ? null : this.JsonResultsAdapter.Name); jo.Add("useJsonp", this.UseJsonP); return jo; }
public static JNode GetTreeNode() { JNode Node = new JNode(0, 0); Node.Name = "SellerTickets"; Node.MouseClickAction = new JAction("SellerTicket", "BusManagment.SellerTicket.JSellerTickets.ListView"); return(Node); }
public static JRef AsRef(this JNode node) { if (node is JRef jRef) { return(jRef); } return(null); }
public static JNode GetTreeNode() { JNode Node = new JNode(0, 0); Node.Name = "WorkOrder"; Node.MouseClickAction = new JAction("WorkOrder", "BusManagment.WorkOrder.JTarrfiHokmeKarBaseDefines.ListView"); return(Node); }
public static JNode GetTreeNode() { JNode Node = new JNode(0, 0); Node.Name = "Device"; Node.MouseClickAction = new JAction("Device", "AUTOMOBILE.Device.JDevices.ListView"); return(Node); }
public static JNode GetTreeNode() { JNode Node = new JNode(0, 0); Node.Name = "UserDynamicDashboard"; Node.MouseClickAction = new JAction("UserDynamicDashboard", "BusManagment.UserDynamicDashboard.JUserDynamicDashboards.ListView"); return(Node); }
public ClassLibrary.JNode[] TreeView() { JNode[] Node = new JNode[3]; Node[0] = Documents.JAUTDocument.GetTreeNode(); Node[1] = Documents.JAUTPayment.GetTreeNode(); Node[2] = Documents.JAUTDocumentReport.GetTreeNode(); return(Node); }
public static bool IsList(this JNode node) { if (node is JRef jRef) { return(jRef.Reference.IsList()); } return(node is JList); }
public static JNode GetTreeNode() { JNode Node = new JNode(0, 0); Node.Name = "Personel"; Node.MouseClickAction = new JAction("Personel", "BusManagment.Personel.JPersonels.ListView"); return(Node); }
public static JNode GetTreeNode() { JNode Node = new JNode(0, 0); Node.Name = "Line"; Node.MouseClickAction = new JAction("Line", "BusManagment.Line.JLineServicess.ListView"); return(Node); }
public static JNode GetTreeNode() { JNode Node = new JNode(0, 0); Node.Name = "Price"; Node.MouseClickAction = new JAction("Price", "BusManagment.Price.JPrices.ListView"); return(Node); }
public ClassLibrary.JNode[] TreeView() { JNode[] Node = new JNode[3]; Node[0] = WorkOrder.JShift.GetTreeNode(); Node[1] = WorkOrder.JTariff.GetTreeNode(); Node[2] = WorkOrder.JAUTVacation.GetTreeNode(); return(Node); }
public ClassLibrary.JNode[] TreeView() { JNode[] Node = new JNode[3]; Node[0] = AutomobileDefine.JAutomobileDefine.GetTreeNode(); Node[1] = (new ClassLibrary.JBaseDefine()).GetNode(ClassLibrary.JBaseDefine.AutomobileType); Node[2] = Device.JDevice.GetTreeNode(); return(Node); }
public static JNode GetTreeNode() { JNode Node = new JNode(0, 0); Node.Name = "Station"; Node.MouseClickAction = new JAction("Station", "BusManagment.Station.JStations.ListView"); return(Node); }
public static JNode GetTreeNode() { JNode Node = new JNode(0, 0); Node.Name = "Fleet"; Node.MouseClickAction = new JAction("Fleet", "BusManagment.Fleet.JFleets.ListView"); return(Node); }
public static JNode GetTreeNode() { JNode Node = new JNode(0, 0); Node.Name = "Bus"; Node.MouseClickAction = new JAction("Bus", "BusManagment.Bus.JBuses.ListView"); return(Node); }
public static bool IsData(this JNode node) { if (node is JRef jRef) { return(jRef.Reference.IsData()); } return(node is IJData); }
public JNode[] TreeView() { JNode[] T = new JNode[4]; T[0] = JAStaticNode._ArchivePlaceNode(); T[1] = JAStaticNode._ArchiveSubjectNode(); T[2] = JAStaticNode._ArchiveDocuments(); T[3] = JAStaticNode._RequestArchiveFile(); return(T); }
public static JNode GetTreeNode() { JNode Node = new JNode(0, 0); Node.Name = "Driver"; Node.MouseClickAction = new JAction("Driver", "BusManagment.Driver.JDriverse.ListView"); return(Node); }
public static void NodeSubscribe <T>(this IService service, JNode node, JNodeEvent eventFilter, Action <T> action) where T : JNode { service.NodeSubscribe(node, eventFilter, n => { if (n is T jNode) { action(jNode); } }); }
public JNode GetNode(DataRow pDR) { JNode _Node = new JNode((int)pDR["Code"], this.GetType().FullName); //درخواست آرشیو JAction editAction = new JAction("Request Archive...", "ArchivedDocuments.JRequestArchiveFile.ReferShow", new object[] { 0, _Node.Code, 0 }, null); //_Node.MouseDBClickAction = editAction; _Node.Popup.Insert(editAction); return(_Node); }
public static JNode GetTreeNode() { JNode Node = new JNode(0, "Documents.JAUTDocumentReportForm"); Node.Name = "Reports"; JAction Ac = new JAction("Reports", "BusManagment.Documents.JAUTDocumentReportForm.ShowDialog", null, null, false); Node.MouseClickAction = Ac; return(Node); }
/// <summary> /// For internal use only. /// </summary> /// <param name="jNode"></param> public DataService(JNode jNode) { ServiceName = jNode.Get<String>("serviceName"); HasServerMetadata = jNode.Get<bool>("hasServerMetadata"); UseJsonP = jNode.Get<bool>("useJsonp"); Adapter = GetAdapter(jNode.Get<String>("adapterName")); // TODO: need to do the same as above with JsonResultsAdapter. JsonResultsAdapter = Adapter.JsonResultsAdapter; InitializeHttpClient(null); }
private JNode DataToJNode(StructuralAspect aspect) { var jn = new JNode(); var stype = aspect.StructuralType; stype.DataProperties.ForEach(dp => { var val = aspect.GetValue(dp.Name); // handle nonscalar dps if (dp.IsComplexProperty) { jn.AddJNode(dp.NameOnServer, DataToJNode(((IComplexObject)val).ComplexAspect)); } else { jn.AddPrimitive(dp.NameOnServer, val, dp.DefaultValue); } }); return jn; }
private JNode BuildEntityAspectNode(EntityAspect entityAspect) { var nc = MetadataStore.Instance.NamingConvention; var jn = new JNode(); var entityType = entityAspect.EntityType; jn.AddPrimitive("entityTypeName", entityType.Name); jn.AddEnum("entityState", entityAspect.EntityState); jn.AddPrimitive("defaultResourceName", entityType.DefaultResourceName); jn.AddJNode("originalValuesMap", BuildOriginalValuesMapNode(entityAspect, nc)); var agkType = entityType.AutoGeneratedKeyType; if (agkType != AutoGeneratedKeyType.None) { var agkNode = new JNode(); agkNode.AddPrimitive("propertyName", entityType.KeyProperties[0].Name); agkNode.AddEnum("autoGeneratedKeyType", agkType); jn.AddJNode("autoGeneratedKey", agkNode); } return jn; }
JNode IJsonSerializable.ToJNode(object config) { var jn = new JNode(); jn.AddEnum("fetchStrategy", this.FetchStrategy ); jn.AddEnum("mergeStrategy", this.MergeStrategy ); return jn; }
//public SaveOptions(JNode jNode) { //} JNode IJsonSerializable.ToJNode(object config) { var jn = new JNode(); jn.AddPrimitive("allowConcurrentSaves", AllowConcurrentSaves); jn.AddPrimitive("tag", Tag); return jn; }
JNode IJsonSerializable.ToJNode(object config) { var jn = new JNode(); return jn; }
public SaveOptions(JNode jNode) { }
public QueryOptions(JNode jNode) { FetchStrategy = jNode.GetNullableEnum<FetchStrategy>("fetchStrategy"); MergeStrategy = jNode.GetNullableEnum<MergeStrategy>("mergeStrategy"); }
private JNode PrepareSaveBundle(IEnumerable<IEntity> entitiesToSave, SaveOptions saveOptions) { var jn = new JNode(); jn.AddArray("entities", entitiesToSave.Select(e => EntityToJNode(e))); jn.AddJNode("saveOptions", saveOptions); return jn; }
private SaveResult ProcessSaveResult(EntityManager entityManager, SaveOptions saveOptions, JNode jNode) { var kms = jNode.GetArray<KeyMapping>("KeyMappings"); var keyMappings = kms.Select(km => ToEntityKeys(km, entityManager.MetadataStore)).ToDictionary(tpl => tpl.Item1, tpl => tpl.Item2); using (entityManager.NewIsLoadingBlock(false)) { keyMappings.ForEach(km => { var targetEntity = entityManager.GetEntityByKey(km.Key); targetEntity.EntityAspect.SetDpValue(km.Key.EntityType.KeyProperties[0], km.Value.Values[0]); }); var entityNodes = jNode.GetToken<JArray>("Entities"); var serializer = new JsonSerializer(); var mappingContext = new MappingContext() { EntityManager = entityManager, MergeStrategy = MergeStrategy.OverwriteChanges, LoadingOperation = LoadingOperation.Save, JsonResultsAdapter = saveOptions.DataService.JsonResultsAdapter }; var jsonConverter = new JsonEntityConverter(mappingContext); serializer.Converters.Add(jsonConverter); // serializer.Converters.Add(new StringEnumConverter()); // Don't use the result of the Deserialize call to get the list of entities // because it won't include entities added on the server. serializer.Deserialize<IEnumerable<IEntity>>(entityNodes.CreateReader()); var allEntities = mappingContext.Entities; allEntities.ForEach(e => e.EntityAspect.AcceptChanges()); return new SaveResult(allEntities, keyMappings); } }
private SaveResult ProcessSaveResult(EntityManager entityManager, string saveResultJson) { var jo = JObject.Parse(saveResultJson); var jn = new JNode(jo); var kms = jn.GetArray<KeyMapping>("KeyMappings"); var keyMappings = kms.Select(km => ToEntityKeys(km)).ToDictionary(tpl => tpl.Item1, tpl => tpl.Item2); using (entityManager.NewIsLoadingBlock(false)) { keyMappings.ForEach(km => { var targetEntity = entityManager.FindEntityByKey(km.Key); targetEntity.EntityAspect.SetDpValue(km.Key.EntityType.KeyProperties[0], km.Value.Values[0]); }); var prop = jo.Property("Entities"); if (prop == null) return null; var entityNodes = (JArray)prop.Value; var serializer = new JsonSerializer(); var jsonConverter = new JsonEntityConverter(entityManager, MergeStrategy.OverwriteChanges, NormalizeEntityTypeName); serializer.Converters.Add(jsonConverter); // Don't use the result of the Deserialize call to get the list of entities // because it won't include entities added on the server. serializer.Deserialize<IEnumerable<IEntity>>(entityNodes.CreateReader()); var allEntities = jsonConverter.AllEntities; allEntities.ForEach(e => e.EntityAspect.AcceptChanges()); return new SaveResult(allEntities, keyMappings); } }
//public SaveOptions(JNode jNode) { //} JNode IJsonSerializable.ToJNode(object config) { var jn = new JNode(); jn.AddPrimitive("tag", Tag); return jn; }