Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic item modified - get resource (Read 2122 times)
alanmcgeough
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 34
Joined: Dec 17th, 2007
item modified - get resource
Nov 10th, 2009 at 3:33pm
Print Post  
Hi, when someone moves an item on my planner - (timetable view) i get the new location of the item and save that to the database -> i get the location using e.Item.Location.Name.

i have now being developing a planner using the resource view and am trying to do the same thing. when the item is modified i want to find out whiche resouce it have been moved to and save to the database but i cannot. There is no e.item.resource.Name or e.item.resouce.id functionality can you please advise. The function im using is item_modified.

i cant use getresourceAt() because parameter e represents the item not the point like windows from

thanks in advance.
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: item modified - get resource
Reply #1 - Nov 10th, 2009 at 4:11pm
Print Post  
The Resource view does not necessarily imply grouping by resources. You can still group by locations and use your old technique.

If you are grouping by resources however, you should inspect the item's Resources collection (items can be associated with more than one resource at a time). There should be only one resource there if the item has been modified interactively - the resource the item has been dragged to. The following implementation of the ItemModified event handler should give you a hint:

Code
Select All
private void calendar1_ItemModified(object sender, ItemModifiedEventArgs e)
{
	System.Diagnostics.Debug.WriteLine(e.Item.Resources[0].Name);
} 


Regards,
Meppy
  
Back to top
 
IP Logged
 
alanmcgeough
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 34
Joined: Dec 17th, 2007
Re: item modified - get resource
Reply #2 - Nov 10th, 2009 at 4:23pm
Print Post  
thanks again meppy

this is the bit i didnt know
[color=Pink]
There should be only one resource there if the item has been modified interactively
[/color]

sorted now!! Brillant!!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint