/// <summary>
 /// When we press Proceed button on the Pop-up menu,this method executes
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnWorkflowProceed_click(object sender, EventArgs e)
 {
     try
     {
         if (ddlReportingSchedule.SelectedValue != "")
         {
             string royaltorId = txtRoyaltor.Text.Substring(0, txtRoyaltor.Text.IndexOf("-") - 1);
             notesOverviewBL = new NotesOverviewBL();
             DataSet workflowNotesData = notesOverviewBL.GetNotesData(royaltorId, "WORKFLOW", ddlReportingSchedule.SelectedValue, out errorId);
             notesOverviewBL = null;
             if (errorId != 2)
             {
                 if (workflowNotesData.Tables[0].Rows.Count > 0)
                 {
                     txtNotes.Text = Convert.ToString(workflowNotesData.Tables[0].Rows[0][0]);
                     txtNotes.Text = Regex.Replace(txtNotes.Text, @"&lt;.+?&gt;|&nbsp;|&apos;|&amp;nbsp;", "").Trim();
                 }
                 else
                 {
                     msgView.SetMessage("There are no Workflow Notes available for this Royaltor!", MessageType.Warning, PositionType.Auto);
                     return;
                 }
             }
             else
             {
                 ExceptionHandler("Error in getting data for Workflow Notes", string.Empty);
             }
         }
     }
     catch (Exception ex)
     {
         ExceptionHandler("Error in getting data for Workflow Notes", ex.Message);
     }
 }
        /// <summary>
        /// When we click on Work FLow button, this method executes
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnWorkFlow_Click(object sender, EventArgs e)
        {
            try
            {
                txtNotes.Text = string.Empty;

                if (txtRoyaltor.Text != " ")
                {
                    string royaltorId = txtRoyaltor.Text.Substring(0, txtRoyaltor.Text.IndexOf("-") - 1);
                    notesOverviewBL = new NotesOverviewBL();
                    DataSet workFlowDropdown = notesOverviewBL.GetWorkflowDropdown(royaltorId, out errorId);
                    notesOverviewBL = null;

                    if (workFlowDropdown.Tables.Count != 0 && errorId != 2)
                    {
                        if (workFlowDropdown.Tables[1].Rows.Count > 1)
                        {
                            ddlReportingSchedule.DataTextField  = "Statement_period_list_item";
                            ddlReportingSchedule.DataValueField = "Statement_period_id";
                            ddlReportingSchedule.DataSource     = workFlowDropdown.Tables[1];
                            ddlReportingSchedule.DataBind();
                            ddlReportingSchedule.Items.Insert(0, new ListItem("-"));

                            mpeReportingSchedule.Show();
                        }
                        else
                        {
                            if (workFlowDropdown.Tables[0].Rows.Count > 0)
                            {
                                txtNotes.Text = Convert.ToString(workFlowDropdown.Tables[0].Rows[0][0]);
                                txtNotes.Text = Regex.Replace(txtNotes.Text, @"&lt;.+?&gt;|&nbsp;|&apos;|&amp;nbsp;", "").Trim();
                            }
                            else
                            {
                                msgView.SetMessage("There are no WorkFlow Notes available for this Royaltor!", MessageType.Warning, PositionType.Auto);
                                return;
                            }
                        }
                    }
                    else
                    {
                        ExceptionHandler("Error in getting data for WorkFlow Notes", string.Empty);
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler("Error in getting data for WorkFlow Notes", ex.Message);
            }
        }
        /// <summary>
        /// When we click on Contract button, this method executes
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnContract_Click(object sender, EventArgs e)
        {
            try
            {
                txtNotes.Text = string.Empty;

                if (txtRoyaltor.Text != "")
                {
                    string royaltorId = txtRoyaltor.Text.Substring(0, txtRoyaltor.Text.IndexOf("-") - 1);
                    notesOverviewBL = new NotesOverviewBL();

                    DataSet contractNotesData = notesOverviewBL.GetNotesData(royaltorId, "CONTRACT", string.Empty, out errorId);
                    notesOverviewBL = null;

                    if (errorId != 2)
                    {
                        if (contractNotesData.Tables[0].Rows.Count > 0)
                        {
                            txtNotes.Text = Convert.ToString(contractNotesData.Tables[0].Rows[0][0]);
                            txtNotes.Text = Regex.Replace(txtNotes.Text, @"&lt;.+?&gt;|&nbsp;|&apos;|&amp;nbsp;", "").Trim();
                        }
                        else
                        {
                            msgView.SetMessage("There are no Contract Notes available for this Royaltor!", MessageType.Warning, PositionType.Auto);
                            return;
                        }
                    }
                    else
                    {
                        ExceptionHandler("Error in getting data for Contract Notes", string.Empty);
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler("Error in getting data for Contract Notes", ex.Message);
            }
        }