Click here to Skip to main content
       

.NET Framework

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
GeneralRe: dont allow user to select existing datememberxnaLearner11 Dec '12 - 0:21 
No problem pete, yeah i'm a beginner at this stuff. Will just have to keep at it.
 
Thanks for the help though
GeneralRe: dont allow user to select existing dateprotectorPete O'Hanlon11 Dec '12 - 1:02 
No problem. Sorry I couldn't be more help here.

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos

CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

QuestionRun through loop for week and dont select weekendsmemberxnaLearner10 Dec '12 - 4:13 
So the user can select 2 different dates, a start date and an end date from 2 calendars, when they click 'add' the dates between&including the dates selected will be added to the DB, each date as a separate record.
 
This works fine however I dont want weekends to be added to the DB.
 
Iv updated the UI of datepicker http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerCustomCellRender.html but if a user selects fri-mon for example fri,sat,sun and mon will be added to the db Iv tried to only run the code if datyofweek is not saturday or sunday
 
 public ActionResult listHolidays(Holiday holiday, int? PersonId, string HolidayDate, string endDate)
        {
            DateTime startDates = Convert.ToDateTime(HolidayDate),
                     endDates = Convert.ToDateTime(endDate);
 
            while (startDates <= endDates)
            {
                if (startDates.DayOfWeek != DayOfWeek.Saturday || startDates.DayOfWeek != DayOfWeek.Sunday)
                {
                    Holiday holiday1 = new Holiday();
                    holiday1.PersonId = PersonId.Value;
                    holiday1.HolidayDate = startDates;
              
                    db.Holidays.AddObject(holiday1);
                    db.SaveChanges();
 
                    //say start date is 10. AddDays(1) will make it 11 then return it to startDates in 'startDates' = startdates,
                    //but doesnt chage the value of startdates = 'startdates'
                   // startDates = startDates.AddDays(1);

                     startDates = startDates.AddDays(1);
                }
            }
 
            return RedirectToAction("Index");
        }
any help?
Thanks
AnswerRe: Run through loop for week and dont select weekendsprotectorPete O'Hanlon10 Dec '12 - 4:31 
xnaLearner wrote:
if (startDates.DayOfWeek != DayOfWeek.Saturday || startDates.DayOfWeek != DayOfWeek.Sunday)

That's an AND condition, not an OR condition. It should read:
if (startDates.DayOfWeek != DayOfWeek.Saturday && startDates.DayOfWeek != DayOfWeek.Sunday)

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos

CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

GeneralRe: Run through loop for week and dont select weekendsmemberxnaLearner10 Dec '12 - 4:52 
thanks for the help
GeneralRe: Run through loop for week and dont select weekendsprotectorPete O'Hanlon10 Dec '12 - 4:53 
Not a problem.

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos

CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

QuestionDeploying a Windows Servicememberindian14310 Dec '12 - 4:09 
Hi,
 
I have created a windows service, I want to deploy it on the server. Can anybody please help me in deploying it. When I googled for it, I found that I have to have project installer file in my project.
 
What is project installer file, how should I write it to deploy my windows service. I am new to this windows service field, any kind of help, code snippet, or link would be very helpful.
 
Thanks in advance.
Thanks & Regards,
 
Abdul Aleem Mohammad
St Louis MO - USA

AnswerRe: Deploying a Windows ServiceprotectorPete O'Hanlon10 Dec '12 - 5:04 
As long as you aren't using Visual Studio 2012, this[^] should help.

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos

CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

GeneralRe: Deploying a Windows Servicememberindian14310 Dec '12 - 5:08 
Hi,
 
I am using Visual Studio 2010 but .Net Framework 3.5, I think it should work?
Thanks & Regards,
 
Abdul Aleem Mohammad
St Louis MO - USA

GeneralRe: Deploying a Windows ServiceprotectorPete O'Hanlon10 Dec '12 - 5:20 
It should work. The steps really didn't change.

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos

CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web02 | 2.6.130523.1 | Last Updated 24 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid