We have used Rad Calender to pick dates and pass to next page to display details depends on complete date selected. eg 26/08/2009.
This code was working since Apr.2009 on server, it started giving error form 19/08/2009. On selecting date from calander. calender event not passing date to next page.
Same code is working on local PC with same server environment SQL 2008, VS 2005 Dot net frame work 2.0
This code was working since Apr.2009 on server, it started giving error form 19/08/2009. On selecting date from calander. calender event not passing date to next page.
Same code is working on local PC with same server environment SQL 2008, VS 2005 Dot net frame work 2.0
protected void SelectedDateChange(object sender, Telerik.WebControls.Base.Calendar.Events.SelectedDatesEventArgs e) |
{ |
objDailyReportBL = new DailyReportBL(); |
objDailyReportSchema = new DailyReportSchema(); |
objRoleMasterBL = new RoleMasterBL(); |
objRoleMasterSchema = new RoleMasterSchema(); |
if (e.SelectedDates.Count > 0) |
{ |
IsHoliday = false; |
if (e.SelectedDates[0].Date.DayOfWeek == DayOfWeek.Sunday) |
{ |
IsHoliday = true; |
} |
else |
{ |
if (dstHolidayList != null) |
{ |
if (dstHolidayList.Tables.Count > 0) |
{ |
if (dstHolidayList.Tables[0].Rows.Count > 0) |
{ |
DataRow[] foundRows = dstHolidayList.Tables[0].Select("HolidayDate='" + e.SelectedDates[0].Date + "'"); |
if (foundRows.Length != 0) |
{ |
IsHoliday = true; |
} |
} |
} |
} |
} |
if (QueryStringProfileEmployeeID != Guid.Empty) |
{ |
if (SessionRoleName != MasterDataHelper.USER_BDE && SessionRoleName != MasterDataHelper.USER_ADMIN) |
{ |
if (e.SelectedDates[0].Date > SessionLastSubmittedDate || SessionLastSubmittedDate.IsNull) |
{ |
Response.Write("<script language=javascript>alert(' " + MoleKule.Resources.Molekule.SuperiorCantViewDailyReportUntilSelfSubmits + "');self.location=('DailyReport.aspx?pid=" + GetProfileEmployeeID.ToString() + "');</script>"); |
return; |
} |
} |
objDailyReportSchema = objDailyReportBL.DailyReportRetrieve(SqlDateTime.Parse(e.SelectedDates[0].Date.ToString()), QueryStringProfileEmployeeID); |
if ((objDailyReportSchema != null) && (objDailyReportSchema.IsReportSubmitted)) |
{ |
Response.Redirect(MasterDataHelper.NAVIGATE_DAILYREPORT + (e.SelectedDates[0]).Date.ToString() + "&pid=" + GetProfileEmployeeID.ToString() + "&holiday=" + IsHoliday); |
} |
else |
{ |
Response.Write("<script language=javascript>alert(' " + MoleKule.Resources.Molekule.DailyReportNotYetSubmitted + "');self.location=('DailyReport.aspx?pid=" + GetProfileEmployeeID.ToString() + "');</script>"); |
//Response.Redirect(MasterDataHelper.NAVIGATE_CLIENT_DAILYREPORT + "?pid=" + QueryStringProfileEmployeeID.ToString()); |
} |
} |
else |
{ |
SqlDateTime WebConfigDT, ReportStartDate, DOJ, DateOfAct, PreDt; |
DateOfAct = SqlDateTime.Null; |
DOJ = SqlDateTime.Null; |
DataSet dstDailyReport; |
objDailyReportBL = new DailyReportBL(); |
dstDailyReport = objDailyReportBL.DailyReportGetDOJAndDtOfActivation(SessionProfileEmployeeID); |
if (dstDailyReport.Tables.Count > 0) |
if (dstDailyReport.Tables[0].Rows.Count > 0) |
{ |
DateOfAct = SqlDateTime.Parse(dstDailyReport.Tables[0].Rows[0]["ActivationDate"].ToString()); |
DOJ = SqlDateTime.Parse(dstDailyReport.Tables[0].Rows[0]["JoiningDate"].ToString()); |
} |
try |
{ |
WebConfigDT = SqlDateTime.Parse(ConfigurationManager.AppSettings["DailyReportStartDate"].ToString()); |
} |
catch (Exception) |
{ |
Response.Write("<script language=javascript>alert(' " + "Report can't submit. Contact Admin." + "');self.location=('DailyReport.aspx');</script>"); |
//WebConfigDT = SqlDateTime.Null; |
return; |
} |
if (!WebConfigDT.IsNull) |
{ |
ReportStartDate = WebConfigDT; |
if (DOJ > ReportStartDate) |
ReportStartDate = DOJ; |
if (DateOfAct > ReportStartDate) |
ReportStartDate = DateOfAct; |
if (e.SelectedDates[0].Date < ReportStartDate) |
{ |
DateTime tmp = Convert.ToDateTime(ReportStartDate.ToString()); |
Response.Write("<script language=javascript>alert(' " + "Your start date of daily report is " + tmp.ToString("dd/MM/yyyy") + ". You can create report from " + tmp.ToString("dd/MM/yyyy") + " onwards." + "');self.location=('DailyReport.aspx');</script>"); |
//Response.Redirect("DailyReport.aspx"); |
return; |
} |
} |
else |
{ |
Response.Write("<script language=javascript>alert(' " + "Report can't submit. Contact Admin." + "');self.location=('DailyReport.aspx');</script>"); |
return; |
} |
objRoleMasterSchema = objRoleMasterBL.RoleMasterRetrieveByProfileEmployeeID(SessionProfileEmployeeID); |
if (objRoleMasterSchema.RoleName != MasterDataHelper.USER_ADMIN) |
{ |
Response.Redirect(MasterDataHelper.NAVIGATE_DAILYREPORT + (e.SelectedDates[0]).Date.ToString() + "&holiday=" + IsHoliday); |
} |
} |
} |
} |