Hi, how are you? I have three questions. haha
Q1: Say now create another page which contains four calendar control, calendar 1-4. They will display the schedule group by contacts. Now I have a function will add schedules to the calendars from database.
exp:
private void (datatable dt, string xxx, string yyy)
{
//do sth
}
If I only have one calendar control, so I could simply use the calendar in the function. But at this moment I have four, what I did this afternoon was calling the function four times to execute the four calendar control.
I tried like
private void (Calendar cal, datatable dt, string xxx, string yyy)
{
//do sth
}
but I couldn't define
Calendar cal
like that to pass a calendar into this function.
Well, execute the function four times with particular calendar is not tough but I am wondering if there is any way that could have a such as calendar collection containing multiple calendar control.
Q2.
As I said above now I have several groups of contacts, on my main page there is only one calendar control which will display all the schedule with their contacts.
As we know in contact class we have firstname and lastname as contact member, so I put group name as the firstname then the real contact name as lastname, which looks like:
I am considering make a javascript accordion so that if user select "minimal view" foreach control on page, the calendar display only group name or group name with contact1, no contact2 nor contact3. Kind of expanding and collapse.
exp: (after collapse)
Ref:
http://jqueryui.com/accordion/http://www.1stwebdesigner.com/freebies/jquery-accordion-menus-tutorials/http://www.dhtmlx.com/docs/products/dhtmlxAccordion/index.shtmlCould you please give me some hint on how to implement snippet to the calendar control?
Q3.
I have a button on page that user could click on to save the calendar data to database. I am trying to add a condition check which will check whether the calendar schedule has been modified or not. If the calendar has been modified yet then enable the button to update data to database, otherwise disable the button because there is no change then tell the user "There is no change" or "Calendar data is already updated".
My idea is set a static boolean variable in code behind, by default it is false. Once the calendar control has been modified then set the variable to true, below is the code behind button OnClick function
private void btnUpload_Click(object sender, EventArgs e)
{
if (flag)
{
foreach (Appointment app in _calendar.Schedule.Items)
{
foreach (Contact c in app.Contacts)
{
//assgin data to stored procedure
}
}
flag = flase;
}
}
But I really have no idea how the set
flag = true
once the Calendar control has been modified(edit/delete/create/move...etc)
Thank you a tons.
Lyubo wrote on May 20
th, 2014 at 2:00pm:
The page is refreshed by the button. It is the default ASP.NET Button click behavior. If you wish to update your database without refreshing the whole page, try to do that with AJAX.
Regards,
Lyubo