private void DuAnNonPersistentWindowController_ObjectsGetting(object sender, ObjectsGettingEventArgs e) { if (e.ObjectType.Name == "DuAnReportObject") { BindingList <DuAnReportObject> objects = new BindingList <DuAnReportObject>(); IObjectSpace objspc = Application.CreateObjectSpace(); IList <DuAn> duans = objspc.GetObjects <DuAn>(); foreach (DuAn duan in duans) { string hang_muc = string.Join(", ", duan.HangMucDuAns.Select <HangMucDuAn, string>(hangmuc => hangmuc.TieuDe)); int avgTienDo = duan.HangMucDuAns.Sum(hangmuc => hangmuc.TienDo) / duan.HangMucDuAns.Count; objects.Add(new DuAnReportObject() { MaDuAn = duan.MaDuAn, TenDuAn = duan.TenDuAn, LoaiDuAn = duan.LoaiDuAn, TrangThai = duan.TrangThai, HangMucDuAns = hang_muc, TienDo = avgTienDo, TongMucDauTu = duan.TongMucDauTu, BatDau = duan.BatDau, KetThuc = duan.KetThuc, QuyetToan = duan.QuyetToan, TruongDuAn = duan.TruongDuAn, }); } e.Objects = objects; } }
private void ObjectSpace_ObjectsGetting(object sender, ObjectsGettingEventArgs e) { if (e.ObjectType == typeof(LiveSummary)) { var keys = LiveSummaryPresetStorage.GetAllKeys(); e.Objects = keys.Select(key => GetObjectByKey(key)).ToList(); } }
private void ObjectSpace_ObjectsGetting(object sender, ObjectsGettingEventArgs e) { var collection = new DynamicCollection((IObjectSpace)sender, e.ObjectType, e.Criteria, e.Sorting, e.InTransaction); collection.FetchObjects += DynamicCollection_FetchObjects; e.Objects = collection; }
private void ObjectSpace_ObjectsGetting(object sender, ObjectsGettingEventArgs e) { if (e.ObjectType == typeof(TObject)) { var objects = GetObjects(); e.Objects = (System.Collections.IList)objects; } }
private void ObjectSpace_ObjectsGetting(object sender, ObjectsGettingEventArgs e) { if (e.ObjectType == typeof(Article)) { var collection = new DynamicCollection(objectSpace, e.ObjectType, e.Criteria, e.Sorting, e.InTransaction); collection.ObjectsGetting += DynamicCollection_ObjectsGetting; e.Objects = collection; } }
void os_ObjectsGetting(object sender, ObjectsGettingEventArgs e) { if (e.ObjectType == typeof(IPerson)) { var innerOs = CreateObjectSpace(typeof(Person)); e.Objects = innerOs.GetObjects(typeof(Person)); e.Handled = true; } }
private void ObjectSpace_ObjectsGetting(object sender, ObjectsGettingEventArgs e) { if (e.ObjectType == typeof(Group)) { if (objects == null) { var pos = ObjectSpace.Owner as IObjectSpace; objects = pos.GetObjectsQuery <Product>().Where(o => o.GroupName != null).GroupBy(o => o.GroupName).Select(o => GetObjectByKey(o.Key)).ToList(); } e.Objects = objects; } }
private void StudentWinController_ObjectsGetting(object sender, ObjectsGettingEventArgs e) { using (IDbConnection conn = new SqlConnection("uid=sa;pwd=sa;Pooling=false;Data Source=.;Initial Catalog=SkyFaith")) { IEnumerable <BusinessObjects.NonPersistentObjects.Student> stus = conn.Query <BusinessObjects.NonPersistentObjects.Student>("select * from student;"); BindingList <BusinessObjects.NonPersistentObjects.Student> bindingList = new BindingList <BusinessObjects.NonPersistentObjects.Student>(stus.ToList()); bindingList.AllowEdit = true; bindingList.AllowNew = true; bindingList.AllowRemove = true; e.Objects = bindingList; } }
private void TrackNumInfoWinController_ObjectsGetting(object sender, ObjectsGettingEventArgs e) { using (IDbConnection conn = new SqlConnection("uid=sa;pwd=skyfaith;Pooling=false;Data Source=47.88.149.87;Initial Catalog=db_SFI")) { IEnumerable <SFITrackNum> stus = conn.Query <SFITrackNum, Agent, SFITrackNum>("sp_GetAllTrackNumInfo", (Track, agent) => { Track.Agent = agent; return(Track); }, null, null, true, "int_AGid", null, CommandType.StoredProcedure); BindingList <SFITrackNum> bindingList = new BindingList <SFITrackNum>(stus.ToList()); bindingList.AllowEdit = true; bindingList.AllowNew = true; bindingList.AllowRemove = true; e.Objects = bindingList; } }
private void ObjectSpace_ObjectsGetting(object sender, ObjectsGettingEventArgs e) { BindingList <MyNonPersistentObject> objects = new BindingList <MyNonPersistentObject>(); for (int i = 1; i < 10; i++) { objects.Add(new MyNonPersistentObject() { Name = string.Format("Object {0}", i) }); } e.Objects = objects; }
private void NonPersistentObjectsController_ObjectsGetting(object sender, ObjectsGettingEventArgs e) { BindingList <NonPersistentObject> objects = new BindingList <NonPersistentObject>(); for (int i = 0; i < 10; i++) { objects.Add(new NonPersistentObject() { Name = string.Format("Object {0}", i) }); } e.Objects = objects; }
private void os_ObjectsGetting(object sender, ObjectsGettingEventArgs e) { //var gridEditor = View.Editor as GridListEditor; //var focussedRowHandle = gridEditor.GridView?.FocusedRowHandle; DynamicCollection collection = new DynamicCollection((IObjectSpace)sender, e.ObjectType, e.Criteria, e.Sorting, e.InTransaction); collection.FetchObjects -= DynamicCollection_FetchObjects; collection.FetchObjects += DynamicCollection_FetchObjects; e.Objects = collection; //if (focussedRowHandle != null) //{ // gridEditor.GridView.FocusedRowHandle = (int)focussedRowHandle; //} }
private void NonPersistentObjectsController_ObjectGetting(object sender, ObjectsGettingEventArgs e) { BindingList <NonPersistentObject> binding = new BindingList <NonPersistentObject>(); for (int i = 0; i < 20; i++) { binding.Add(new NonPersistentObject() { Oid = i, Name = string.Format("Name {0}", i) }); } e.Objects = binding; }
private void ObjectSpace_ObjectsGetting(Object sender, ObjectsGettingEventArgs e) { var objectSpace = (IObjectSpace)sender; var asortymenty = new BindingList <Asortyment>(); if (e.ObjectType == typeof(BusinessObjects.Asortyment)) { asortymenty.AllowNew = false; asortymenty.AllowEdit = true; asortymenty.AllowRemove = false; foreach (var item in asortymentyCache.Values) { asortymenty.Add(objectSpace.GetObject <Asortyment>(item)); } e.Objects = asortymenty; } }
private void ObjectSpace_ObjectsGetting(Object sender, ObjectsGettingEventArgs e) { BindingList <BaseNonPersistentClass> objects = new BindingList <BaseNonPersistentClass>(); objects.AllowNew = true; objects.AllowEdit = true; objects.AllowRemove = true; foreach (BaseNonPersistentClass obj in globalObjects) { if (e.ObjectType.IsAssignableFrom(obj.GetType())) { objects.Add(obj); obj.ObjectSpace = (IObjectSpace)sender; } } e.Objects = objects; }
private void NonPersistentObjectSpace_ObjectsGetting(object sender, ObjectsGettingEventArgs e) { if (e.ObjectType == typeof(AddInventoryItems)) { e.Objects = FillAddInventoryItems(); } else if (e.ObjectType == typeof(AddPurchaseItems)) { e.Objects = FillAddPurchaseItems(); } else if (e.ObjectType == typeof(AddSalesItems)) { e.Objects = FillAddSalesItems(); } else if (e.ObjectType == typeof(AddMenuSalesItems)) { e.Objects = FillAddMenuSalesItems(); } }
private void NonPersistentObjectSpace_ObjectsGetting(Object sender, ObjectsGettingEventArgs e) { ITypeInfo info = XafTypesInfo.Instance.FindTypeInfo(e.ObjectType); //if (e.ObjectType == typeof(NPCategory)) if (info.Implements <INonPersistent>()) { IObjectSpace objectSpace = (IObjectSpace)sender; BindingList <INonPersistent> objects = new BindingList <INonPersistent>(); objects.AllowNew = false; objects.AllowEdit = true; objects.AllowRemove = false; //objectsCache = DataGetters.GetNPCategories(); objectsCache = DataGetters.GetNPObjects(info, ObjectSpace); foreach (INonPersistent obj in objectsCache) { objects.Add(objectSpace.GetObject(obj)); } e.Objects = objects; } }
private void NonPersistentObjectSpace_ObjectsGetting(object sender, ObjectsGettingEventArgs e) { var objects = new List <object>(); //e.Criteria if (e.ObjectType == typeof(MyNonPersistentObject)) { objects.Add(new MyNonPersistentObject() { Name = nameof(MyNonPersistentObject), Description = "this is a non persistent object" }); } if (e.ObjectType == typeof(PocoClass)) { objects.Add(new PocoClass() { Name = nameof(PocoClass), Description = "this is a non persistent object POCO" }); } e.Objects = objects; }
private void WelcomeObjectSpace_ObjectsGetting(Object sender, ObjectsGettingEventArgs e) { BindingList <Welcome> objects = new BindingList <Welcome>(); objects.Add(new Welcome() { Category = "Linked Reports", Name = "Working Capital Reports", TextValue = @"\\vhacorp07.vha.internal\vodashare$\Finance\Cash Reports\Working Capital" }); objects.Add(new Welcome() { Category = "Linked Reports", Name = "Customer Reports", TextValue = @"\\vhacorp07.vha.internal\vodashare$\Finance\Cash Reports\Customer Investment" }); objects.Add(new Welcome() { Category = "Linked Reports", Name = "Accounting Reports", TextValue = @"\\vhacorp07.vha.internal\vodashare$\Finance\Cash Reports\Accounting" }); objects.Add(new Welcome() { Category = "Session Details", Name = "User Name", TextValue = Environment.UserName }); objects.Add(new Welcome() { Category = "Session Details", Name = "Logon Domain", TextValue = Environment.UserDomainName }); objects.Add(new Welcome() { Category = "Session Details", Name = "Database Connection", TextValue = Application.ConnectionString }); objects.Add(new Welcome() { Category = "Session Details", Name = "Application Path", TextValue = System.Reflection.Assembly.GetExecutingAssembly().Location }); objects.Add(new Welcome() { Category = "Session Details", Name = "Application Host Name", TextValue = Environment.MachineName }); e.Objects = objects; }
private void NonPersistentObjectSpaceOnObjectsGetting(object sender, ObjectsGettingEventArgs e) { BindingList <EmployeeNonPersistent> objects = new BindingList <EmployeeNonPersistent> { AllowNew = true, AllowEdit = true, AllowRemove = true }; var objectSpace = Application.CreateObjectSpace(); var employees = objectSpace.GetObjects <Employees>(); foreach (var employee in employees) { var employeeNonPersistent = new EmployeeNonPersistent { LastName = employee.LastName, Address = employee.Address, BirthDate = employee.BirthDate, City = employee.City, Country = employee.Country, EmployeeID = employee.EmployeeID, Extension = employee.Extension, FirstName = employee.FirstName, HireDate = employee.HireDate, HomePhone = employee.HomePhone, Photo = employee.Photo, PhotoPath = employee.PhotoPath, PostalCode = employee.PostalCode, Region = employee.Region, Title = employee.Title, TitleOfCourtesy = employee.TitleOfCourtesy }; objects.Add(employeeNonPersistent); } objectsCache = objects; e.Objects = objects; }
private void NonPersistentObjectSpace_ObjectsGetting(Object sender, ObjectsGettingEventArgs e) { ITypeInfo info = XafTypesInfo.Instance.FindTypeInfo(e.ObjectType); if (!info.Implements <INonPersistentBusinessObject>()) { return; } IObjectSpace objectSpace = (IObjectSpace)sender; BindingList <INonPersistentBusinessObject> objects = new BindingList <INonPersistentBusinessObject> { AllowNew = false, AllowEdit = true, AllowRemove = false }; LoadObjectsCache(objectSpace); foreach (INonPersistentBusinessObject obj in objectsCache) { objects.Add(objectSpace.GetObject(obj)); } e.Objects = objects; }
private void os_ObjectsGetting(object sender, ObjectsGettingEventArgs e) { e.Objects = ThinResult.GetList().ToList(); Console.WriteLine(e.Objects.Count); }
void ReportsObjectSpace_ObjectsGetting(object sender, ObjectsGettingEventArgs e) { }
private void ObjectSpace_ObjectsGetting(object sender, ObjectsGettingEventArgs e) { e.Objects = objects; }
private void NonPersistentObjectSpaceOnObjectsGetting(object sender, ObjectsGettingEventArgs e) { e.Objects = _datasource; }