473,805 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calendar date blocking

44 New Member
Hi

Can anybody help me how to block all dates in calendar control till the current date.
Jun 27 '08 #1
10 1907
sweatha
44 New Member
Hi Experts

I have selected date from DB by using query

"Select Date from Appointment where Count(date)>=5"

I have to block all dates that I retrieved from DB in Calendar control. If I have to block a single date (eg: 28-6-2008), I can block that date by using the coding

if (e.Day.Date =='28-6-2008')
{
e.Day.IsSelecta ble = false;

e.Cell.BackColo r = System.Drawing. Color.Brown;
}

but the value retrieved from the DB will be the set of values like

Date
--------------------
28-6-2008
29-6-2008
30-6-2008

How can I block any of the selected set of dates in Calendar control during the page load
Jun 27 '08 #2
cloud255
427 Recognized Expert Contributor
you could try the following:

in the valueChanged event handler of your date picker control,

if(datePicker.V alue < System.DateTime .Today)
{
datePicker.Valu e = System.DateTime .Today;
}

should work ok.

good luck
Jun 27 '08 #3
nmsreddi
366 Contributor
Hello

if its a windows application you can directly use MinDate property of the datetime picker.just assign min date as current date

dateTimePicker1 .MinDate = System.DateTime .Now;

in web application we have java script calenders ,where we can directly strike out the passed dates .

better post application type and the excat control what you are using ,then its easy to give exact answer

Regards
nmsreddi
Jun 27 '08 #4
nmsreddi
366 Contributor
Hello

i dint get your question exactly , whether you want to block the dates in calender or the dates that you are quering from DB.

i dont think so there is option for blocking particular selected number of dates .
but you can , block all previous dates of a calender control from current date or all dates after the current date.

i dint get you problem correctly , hope this may help .


Regards
nmsreddi
Jun 27 '08 #5
debasisdas
8,127 Recognized Expert Expert
Using the MinDate property is a better option.
Jun 27 '08 #6
debasisdas
8,127 Recognized Expert Expert
1.Allow the user to select any date from calander.
2.fetch the list of dates from database.
3.If the seelcted date is in the list of dates ,re-prompt the user to select date again with some meaningful message.
Jun 27 '08 #7
sweatha
44 New Member
1.Allow the user to select any date from calander.
2.fetch the list of dates from database.
3.If the seelcted date is in the list of dates ,re-prompt the user to select date again with some meaningful message.
Hi

sorry for delay.

In ASP .Net calendar control, I have to block all dates which has count >=5 in DB during the page load
Jun 30 '08 #8
nmsreddi
366 Contributor
Hello

Even in asp.net or Win application you can block dates in a range or with some

condition. but why the DB comes in to pitcure, what is the actual relation of DB

and calender here , you are getting some integer value from DB and you want to

block dates depending on that value.can you please explain your project requirement.

Regards
nmsreddi
Jun 30 '08 #9
sweatha
44 New Member
Hello

Even in asp.net or Win application you can block dates in a range or with some

condition. but why the DB comes in to pitcure, what is the actual relation of DB

and calender here , you are getting some integer value from DB and you want to

block dates depending on that value.can you please explain your project requirement.

Regards
nmsreddi

Hi

In my DB, I have the Appointment Table with the following columns

APID nvarchar(12)
USID nvarchar(12)
DRID nvarchar(12)
Date datetime
Brief Desc nvarchar(50)
Other Desc nvarchar(500)
Add by char(2)
Status char(1)



My requirement is the patients can fix an appointment to the doctors. If already appoints are fixed by an patients for more than 5 times, I have to block the date in calendar control by default in page load.

In my first form, if I click the Link Button named "Fix an Appointment", it should redirects to an Appointment.asp x page. Once if it redirects to the Appointment page, it should show a calendar with blocking of all previous dates and the date the appointment is fixed for more than 5 times.


In this appointment page, I have

1 Calendar control

Date: TextBox
Brief Desc: TextBox
Other Details: TextBox
Add By: TextBox
Status: TextBox

"Fix Appointment"- Button

Here the patient can enter the date,Brief Desc,etc and click the button to fix an appointment.
Jun 30 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

2
14882
by: cg_news | last post by:
In short, what I am trying to do is, based on a date, calculate the week of year (as described in ISO 8601), then calculate the first and last date in this week period and return them in the format CCYYMMDD. Sounds easy enough, right?? I am attempting to accomplish this by creating a GregorianCalender which will get me the week of year. Then by changing the day of week to 1 (start of week) i'm trying the get the first day of the week,...
1
4256
by: David Stockwell | last post by:
I''m wondering if the Calendar object has an option to only do calculations based on business days (ie M-F). Additionally does it have a way to get holidays into itself? Currently I'm considering converting my calculations over to business days and am wondering if there is anything built-in. I've tried searching but so far haven't seen such a thing built in. I'm thinking I'm just going to have to bite the bullet and create my own...
10
2530
by: vinu | last post by:
I have a javascript file named select.js. This is a file which is use to pop up a calendar, when clicked on a calendar icon in an ASP file. have a close button in the calendar. When i click on the button, th calendar is not closing. here is the select.js file x999NS4compatible = (document.layers); var x999IE4compatible = (document.all); var x999dayabbs = ;
2
3419
by: Caesar Augustus | last post by:
First, let me start by saying my asp.net experience is still in it's infancy so please bare with me as I try to explain my situation. I have created a single page that with the use of many controls (i.e. roundedcorners component www.4guysfromrolla.com], buttons and panels) functions like a tab control. The buttons are programmatically designed to make the corresponding panel visible. Sample aspx.vb code:
3
2743
by: thorpk | last post by:
I posted this problem earlier in the month and some one decided it was better to change the subject and ask a completely different question. I am therefore reposting. I am hoping some one can assist with this. Thanks in advance. I have an access database that i have added a pop up calendar to, the Table information for the Date Reported field is Date/Time format short date, input mask is 00/00/0000.
0
3329
by: mathewgk80 | last post by:
HI all, I am having popup calendar Javascript code. But i dont know how it is connecting to asp.net code.. I am using asp.net,c#.net and also using 3tier architecture with master page.... I would like to get the code for connecting the javascript to asp.net page... Please help me... The javascript code is as follows..
4
3379
by: gubbachchi | last post by:
Hi all, Please anybody help me solve this problem. I am stuck up with this from past 2 weeks. I am developing an application where, when the user selects date from javascript datepicker and enters the comments and clicks the save button then the date and the date will be stored in the mysql database. This is working fine. But my problem is when, after the user had made an entry the date in the calendar for which an entry has made should be...
2
929
by: suganya | last post by:
Hi I have to block all previous date in calendar. for that I have given coding as protected void QuickCalendar_DayRender(object sender, System.Web.UI.WebControls.DayRenderEventArgs e) { if ((e.Day.Date < DateTime.Now)) {
1
4911
by: swethak | last post by:
Hi, I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the events when click on that date that perticular event displyed in a text box.But my requirement is to when click on that date that related event displyed in same td row not the text box. and also i add the events to that calendar.plz advice how to...
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10368
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10107
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5544
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4327
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.