Page Index Toggle Pages: 1 [2]  Send TopicPrint
Hot Topic (More than 10 Replies) How to customize the new appointment? (Read 20715 times)
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: How to customize the new appointment?
Reply #15 - Feb 21st, 2014 at 11:33pm
Print Post  
Hi,

I worked on that today, right now I already have  datatable contains the entire excel file data. The I have one loop to assign the name, id and tag in to contact and another loop to 
assign the start time and end time in the appointment.

Attached are the two loops. I set breakpoint in the code, both of the two loops works well. All the data are assigned properly in the contact and appointment. 

Right now I really get stuck how to display the contact and appointment properly in the mindfusion calendar resource view.

Attachment 3 is my blank calendar.

Big thx.
Lyubo wrote on Feb 20th, 2014 at 9:15am:
Hi,

Data binding is currently not supported so you'll need to do this manually. Have a look at the 'Business Objects' sample provided with the control. It shows how you can manually bind schedule appointments to some generic business objects, which are persisted in XML format.

You could apply a similar approach in your case - after you've populated a DataSet from the xls file, extract the StartDate/EndDate pairs and assign them to newly created appointment objects. After that, add the appointments to the calendar's Schedule.

Regards,
Lyubo

  

q4.JPG (Attachment deleted)
q5.JPG (Attachment deleted)
q6.JPG (Attachment deleted)
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: How to customize the new appointment?
Reply #16 - Feb 24th, 2014 at 6:46am
Print Post  
Hi,

The ResourceView represents a distribution of schedule items, grouped for a particular resource - in your case contacts. For that view you should set the Calendar.GroupType property like this:
Code
Select All
_calendar.GroupType = GroupType.GroupByContacts; 


The resources by which the view would be grouped should be added to the Calendar.Contacts collection, so add this line in your contacts loop:
Code
Select All
_calendar.Contacts.Add(c); 


Finally, to show an item in the view, it should be associated with one (or more) of the grouped resources:
Code
Select All
app.Contacts.Add(c); 



Note that to display the contacts' names in the ResourceView group header, you should set the LastName and/or FirstName properties.

For additional examples on how to use and setup the view, check out the 'Resource Table' and 'Demo' samples.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: How to customize the new appointment?
Reply #17 - Feb 24th, 2014 at 4:32pm
Print Post  
Oh yea it basically works now.

In my loop it was "_calendar.Schedule.Contacts.Add(c)" and "_calendar.Schedule.Items.Add(app);", but didn't work.

I put your code "_calendar.Contacts.Add(c)" and "app.Contacts.Add(c)", then it worked.

Can you explain a little bit?

Thx in advance



Lyubo wrote on Feb 24th, 2014 at 6:46am:
Hi,

The ResourceView represents a distribution of schedule items, grouped for a particular resource - in your case contacts. For that view you should set the Calendar.GroupType property like this:
Code
Select All
_calendar.GroupType = GroupType.GroupByContacts; 


The resources by which the view would be grouped should be added to the Calendar.Contacts collection, so add this line in your contacts loop:
Code
Select All
_calendar.Contacts.Add(c); 


Finally, to show an item in the view, it should be associated with one (or more) of the grouped resources:
Code
Select All
app.Contacts.Add(c); 



Note that to display the contacts' names in the ResourceView group header, you should set the LastName and/or FirstName properties.

For additional examples on how to use and setup the view, check out the 'Resource Table' and 'Demo' samples.

Regards,
Lyubo

  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: How to customize the new appointment?
Reply #18 - Feb 25th, 2014 at 6:44am
Print Post  
Hi,

In two words, all available contacts should be registered with the schedule, by adding them to the Schedule.Contacts collection. Out of these, you choose which to display in a grouped view (when Calendar.GroupType is set), by adding them to the Calendar.Contacts collection. A contact should be added to the Item.Contacts collection to associate a particular calendar item with a particular contact - and thus display the appointment in a grouped view. The same goes for the other types of resources - Location, Task and Resource and their respective collections.

Additional information can be found in the documentation files and online here - http://www.mindfusion.eu/onlinehelp/webplanner/index.htm.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: How to customize the new appointment?
Reply #19 - Feb 25th, 2014 at 3:18pm
Print Post  
Appreciate that Lyubo, you really help a lot!

Now I am working on customize the "New Appointment" window, originally it has 'subject','location', 'start time', 'end time', 'details' and 'contacts' etc. In the previous post you explained how to use a dropdownlist instead of the 'subject' textbox and remove the display of 'contacts'.

Could you please explain a little bit more about how to modify the "New Appointment" window?

Thx
  
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: How to customize the new appointment?
Reply #20 - Feb 25th, 2014 at 8:06pm
Print Post  
@Lyubo
@Stoyo

If there any easy way to import multiple appointments with one contact?

Exp, contact "Tom", he has one appointment from 3/01 -3/03, then another appointment from 3/04 - 3/07, how can I import the two appointments then put them in one line not two lines in the calendar?

Let's say there is an appointment already existing on the calendar, now I want to add new appointment time period into the existing one from my datatable, so after that the appointment contains two time periods.


Lyubo wrote on Feb 25th, 2014 at 6:44am:
Hi,

In two words, all available contacts should be registered with the schedule, by adding them to the Schedule.Contacts collection. Out of these, you choose which to display in a grouped view (when Calendar.GroupType is set), by adding them to the Calendar.Contacts collection. A contact should be added to the Item.Contacts collection to associate a particular calendar item with a particular contact - and thus display the appointment in a grouped view. The same goes for the other types of resources - Location, Task and Resource and their respective collections.

Additional information can be found in the documentation files and online here - http://www.mindfusion.eu/onlinehelp/webplanner/index.htm.

Regards,
Lyubo
« Last Edit: Feb 25th, 2014 at 9:51pm by Xylon »  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: How to customize the new appointment?
Reply #21 - Feb 26th, 2014 at 10:25am
Print Post  
Xylon wrote on Feb 25th, 2014 at 3:18pm:
Could you please explain a little bit more about how to modify the "New Appointment" window?

This topic in the documentation shows one approach in customizing the forms - by handling the FormShow event - it is also demonstrated in the 'Clients Events' sample.

The 'Stock Forms' sample shows how you can create and display your own popup forms, using the CSS classes, that the built-in forms use.

You can style the forms through CSS. The classes that the forms use are listed in a table here.

In addition, you can use the Calendar.LocalizationInfo property as a way to set the text in the various form labels.


Xylon wrote on Feb 25th, 2014 at 8:06pm:
If there any easy way to import multiple appointments with one contact?

Exp, contact "Tom", he has one appointment from 3/01 -3/03, then another appointment from 3/04 - 3/07, how can I import the two appointments then put them in one line not two lines in the calendar?

It is as easy as creating multiple Appointment objects, assigning them the contact, and then adding the Appointment objects the the Schedule.Items collection:
Code
Select All
Contact c = new Contact();
c.FirstName = "Tom";
// Add the contact to the Schedule
_calendar.Schedule.Contacts.Add(c);
// Add the contact to the calendar grouping collection
_calendar.Contacts.Add(c);

var app = new Appointment();
app.Subject = "First Appointment";
app.StartTime = new DateTime(2014, 3, 1);
app.EndTime = new DateTime(2014, 3, 3);
// Assign the contact to the appointment
app.Contacts.Add(c);
// Add the appointment to the Schedule
_calendar.Schedule.Items.Add(app);

// Create the second appointment in the same way
app = new Appointment();
app.Subject = "Second Appointment";
app.StartTime = new DateTime(2014, 3, 4);
app.EndTime = new DateTime(2014, 3, 7);
app.Contacts.Add(c);
_calendar.Schedule.Items.Add(app); 


The above code puts the appointments in one line in my test (see the first attached picture). Are you sure you're assigning the same contact to the appointments? If two or more appointments' time periods overlap, they will be placed on different rows within the grouped (contact) row - you can see an example of that in the second attachment - there the second appointment is moved to start from 03/02.


Xylon wrote on Feb 25th, 2014 at 8:06pm:
Let's say there is an appointment already existing on the calendar, now I want to add new appointment time period into the existing one from my datatable, so after that the appointment contains two time periods.

The Appointment class represents a single event which is scheduled to occur at a specified time and has a specified duration - defined by the StartTime and EndTime properties - so you cannot assign more than one time period for one Appointment instance.

If this second time period in the database represents a different event - you should create a second appointment.
If it in some way is meant to change the existing time period - move it, extend it, shrink it, etc. - you should modify the StartTime/EndTime values of the existing appointment.
If it represents a event which occurs repeatedly in time - i.e. a birthday occurs every year, a paycheck will arrive every week/month, etc. - you should use a Recurrent appointment (you can find additional information about recurrences here).

If you provide me with more details regarding your specific case, I may be able to give you a more concrete answer on how to approach this case.

Regards,
Lyubo
  

resourceview01.png (Attachment deleted)
resourceview02.png (Attachment deleted)
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: How to customize the new appointment?
Reply #22 - Feb 26th, 2014 at 8:42pm
Print Post  
Hi Lyubo,

I got where my issue is! Let's say I have 20 individual contacts on my calendar now, 15 of them have same name (contact.FirstName, for example all of the 15 contacts are named "Tom") and rest 5 have another same name (contact.FirstName, for example all of the rest 5 contacts are named "Jerry").

At this moment I have 20 lines on the calendar standing for 20 appointments, but actually there are only two different names, "Tom" and "Jerry". Is there any way to group the same names into one name? EXP there are 15 "Tom"s on the left of the calendar, I would like to set to only one "Tom" but still 15 lines of appointments.

Attention there are 20 individual appointments(15 "Tom"s, 5 "Jerry"s), I can't merge them into 1 "Tom" and 1 "Jerry".

Btw in each appointment I have multiple time periods in one line without overlap. That's why I asked the previous question, but now I realized my real issues is not overlap but grouping.

Looking forward your reply, thank you Lyubo

-------------------------------------------------------

Lol, just discussed with my colleague, forget about what I asked above. There won't be duplicate names in the future!

Right now I am working on customizing the "New Appointment" window, working on how to get the value from subject line and remove location droplist, put event type droplist instead of it, and the value in the droplist should be fixed.

Again, thank you very much!


Lyubo wrote on Feb 26th, 2014 at 10:25am:
Xylon wrote on Feb 25th, 2014 at 3:18pm:
Could you please explain a little bit more about how to modify the "New Appointment" window?

This topic in the documentation shows one approach in customizing the forms - by handling the FormShow event - it is also demonstrated in the 'Clients Events' sample.

The 'Stock Forms' sample shows how you can create and display your own popup forms, using the CSS classes, that the built-in forms use.

You can style the forms through CSS. The classes that the forms use are listed in a table here.

In addition, you can use the Calendar.LocalizationInfo property as a way to set the text in the various form labels.


Xylon wrote on Feb 25th, 2014 at 8:06pm:
If there any easy way to import multiple appointments with one contact?

Exp, contact "Tom", he has one appointment from 3/01 -3/03, then another appointment from 3/04 - 3/07, how can I import the two appointments then put them in one line not two lines in the calendar?

It is as easy as creating multiple Appointment objects, assigning them the contact, and then adding the Appointment objects the the Schedule.Items collection:
Code
Select All
Contact c = new Contact();
c.FirstName = "Tom";
// Add the contact to the Schedule
_calendar.Schedule.Contacts.Add(c);
// Add the contact to the calendar grouping collection
_calendar.Contacts.Add(c);

var app = new Appointment();
app.Subject = "First Appointment";
app.StartTime = new DateTime(2014, 3, 1);
app.EndTime = new DateTime(2014, 3, 3);
// Assign the contact to the appointment
app.Contacts.Add(c);
// Add the appointment to the Schedule
_calendar.Schedule.Items.Add(app);

// Create the second appointment in the same way
app = new Appointment();
app.Subject = "Second Appointment";
app.StartTime = new DateTime(2014, 3, 4);
app.EndTime = new DateTime(2014, 3, 7);
app.Contacts.Add(c);
_calendar.Schedule.Items.Add(app); 


The above code puts the appointments in one line in my test (see the first attached picture). Are you sure you're assigning the same contact to the appointments? If two or more appointments' time periods overlap, they will be placed on different rows within the grouped (contact) row - you can see an example of that in the second attachment - there the second appointment is moved to start from 03/02.


Xylon wrote on Feb 25th, 2014 at 8:06pm:
Let's say there is an appointment already existing on the calendar, now I want to add new appointment time period into the existing one from my datatable, so after that the appointment contains two time periods.

The Appointment class represents a single event which is scheduled to occur at a specified time and has a specified duration - defined by the StartTime and EndTime properties - so you cannot assign more than one time period for one Appointment instance.

If this second time period in the database represents a different event - you should create a second appointment.
If it in some way is meant to change the existing time period - move it, extend it, shrink it, etc. - you should modify the StartTime/EndTime values of the existing appointment.
If it represents a event which occurs repeatedly in time - i.e. a birthday occurs every year, a paycheck will arrive every week/month, etc. - you should use a Recurrent appointment (you can find additional information about recurrences here).

If you provide me with more details regarding your specific case, I may be able to give you a more concrete answer on how to approach this case.

Regards,
Lyubo

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint