protected void frmInterviewDetails_Updating(object sender, FormViewUpdateEventArgs e)
    {
        try
        {
            string js            = "";
            string InterviewDate = (frmInterviewDetails.FindControl("txtPlanDate") as TextBox).Text.ToString();
            if (InterviewDate == "")
            {
                js = "alert('Interview Date is mandatory');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", js, true);
                return;
            }
            else
            {
                if (!UDFLib.DateCheck(InterviewDate))
                {
                    string js3 = "alert('Enter valid Interview Date" + DateFormatMessage + "');";
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "searchError", js3, true);
                    return;
                }
            }

            int    InterviewID       = UDFLib.ConvertToInteger(Request.QueryString["InterviewID"]);
            string H                 = Convert.ToString(e.NewValues["InterviewPlanH"]);
            string M                 = Convert.ToString((frmInterviewDetails.FindControl("ddlPlanM") as DropDownList).SelectedValue);
            string planDate          = UDFLib.ConvertToDefaultDt((frmInterviewDetails.FindControl("txtPlanDate") as TextBox).Text.ToString());
            string InterviewPlanDate = planDate + " " + H + ":" + M;

            int PlannedInterviewerID = UDFLib.ConvertToInteger((frmInterviewDetails.FindControl("ddlPlanInterviewer") as DropDownList).SelectedValue);
            int InterviewRank        = UDFLib.ConvertToInteger(e.NewValues["InterviewRank"]);

            string TimeZone = (frmInterviewDetails.FindControl("ddlTimeZone") as DropDownList).SelectedValue;

            if (int.Parse((frmInterviewDetails.FindControl("ddlInterviewSheet") as DropDownList).SelectedValue) == 0)
            {
                string ParentPage = Request.QueryString["ParentPage"];
                if (ParentPage != null && ParentPage.Equals("CrewInterview.aspx"))
                {
                    js = "alert('Interview Sheet is mandatory');";
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", js, true);
                    return;
                }
            }
            int IQID = UDFLib.ConvertToInteger((frmInterviewDetails.FindControl("ddlInterviewSheet") as DropDownList).SelectedValue);
            if (PlannedInterviewerID == 0)
            {
                js = "alert('Select planned interviewer!!');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", js, true);
            }
            else
            {
                int Res = BLL_Crew_Interview.UPDATE_CrewInterviewPlanning(InterviewID, InterviewPlanDate, PlannedInterviewerID, InterviewRank, Convert.ToInt32(Session["UserID"]), TimeZone, IQID);

                if (Res == 1)
                {
                    js = "alert('Interview Schedule Updated!!');parent.hideModal('dvPopupFrame');parent.window.location.reload();";
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", js, true);
                }
                else if (Res == -1)
                {
                    js = "alert('Another interview is scheduled for the interviewer at the same time. Interview schedule not updated!!');";
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", js, true);
                }
            }
        }
        catch { }
    }