protected void CalendarLinkButton1_CalendarClick(object sender, CalendarClickEventArgs e)
    {
        try
        {
            // Deserialize.
            JavaScriptSerializer        serializer = new JavaScriptSerializer();
            Dictionary <string, object> swipeInfo  = serializer.DeserializeObject(e.DataKey.ToString()) as Dictionary <string, object>;

            // Fetch values.
            string   action   = swipeInfo["Action"].ToString();
            int      id       = Int32.Parse(swipeInfo["Id"].ToString());
            DateTime workDate = DateTime.Parse(swipeInfo["WorkDate"].ToString());
            this.FillUserSwipes();
            UserSwipe userSwipe = null;

            if (mSwipeList != null)
            {
                // Check whether selected item is available in the list.
                userSwipe = mSwipeList.Where(item => item.Id == id && item.WorkDate.ToString("MM/dd/yyyy") == workDate.ToString("MM/dd/yyyy")).FirstOrDefault();
            }

            // Exists
            if (userSwipe == null)
            {
                userSwipe                = new UserSwipe(id);
                userSwipe.UserId         = Int32.Parse(this.hdnuserid.Value);
                userSwipe.WorkDate       = workDate;
                userSwipe.CreateDate     = DateTime.Now;
                userSwipe.LastUpdateDate = DateTime.Now;
            }

            // Display edit panel as dialog.
            this.userSwipeEditControl.AppManager = this.mAppManager;
            this.userSwipeEditControl.Action     = action;
            this.userSwipeEditControl.UserSwipe  = userSwipe;

            this.userSwipeEditControl.UserType = "Sup";
            this.userSwipeEditControl.InitializeView();


            // Register startup script.
            string script = string.Format("showEditPanelDialog({{'title': '{0}','width':'{1}'}})", action.ToString(), "400px");
            ScriptManager.RegisterStartupScript(
                this,
                typeof(Page),
                System.Guid.NewGuid().ToString(),
                script,
                true);
        }
        catch
        {
            throw;
        }
    }
 protected void CalendarLinkButton1_CalendarClick(object sender, CalendarClickEventArgs e)
 {
 }