This is a migrated thread and some comments may be shown as answers.

Rad Calender Issue

4 Answers 92 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Datta Kulkarni
Top achievements
Rank 1
Datta Kulkarni asked on 26 Aug 2009, 08:54 AM
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
 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);  
                    }                      
                }  
            }  
        } 

4 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 28 Aug 2009, 12:59 PM
Hello,

I went through your code and it looks fine to me.
Could you specify what errors you receive and if you are using RadAjax in the problematic page?

Kind regards,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Datta Kulkarni
Top achievements
Rank 1
answered on 29 Aug 2009, 12:17 PM
Hello  Telerik team, 

I will explain you once again the problem we are facing.

We are using  Rad TreeView and Calender Control for a functionality.  
On Selecting  name of person from Tree View  (eg. employee name) user select  date form  calender control. 

This calander control not passing selected value to next page. Please see code  from "  if (e.SelectedDates.Count > 0)"  line.

This code was working since Apr.2009 on server,  it started giving error form 19/08/2009. But the  code is working on local PC with same server environment  SQL 2008, VS 2005  Dot net frame work Ver 2.

Is there any limitation for Tree View control ?
We have set 5 level and number of records(employees) bound to tree view are arroud 500.
We are using  rad contrils purchased in  30-Aug-07.
0
Datta Kulkarni
Top achievements
Rank 1
answered on 02 Sep 2009, 08:09 AM
Hi Telerik Team,

Please let us know,  Will Tree View and Callender Control  clash with any Firewalls ?

Pages are being denied by firewall at client where we have put/using  Tree View and Callender Controls.

Regards

Datta K
0
Georgi Krustev
Telerik team
answered on 02 Sep 2009, 04:14 PM
Hello Datta ,

Could you please verify that the event is fired and only the SelectedDates collection is empty? In order to investigate the problem locally I will ask you to post the HTML code and if necessary the code-behind. Thus I will investigate it locally and advice you further.

Sincerely yours,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Calendar
Asked by
Datta Kulkarni
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Datta Kulkarni
Top achievements
Rank 1
Georgi Krustev
Telerik team
Share this question
or