Exemple #1
0
        private void LoadPolicy()
        {
            int UserID = UserContext.UserID;


            int FileID = int.Parse(Request.QueryString["FileID"].ToString());

            BusinessServices.Event objPolicy = new BusinessServices.Event();

            // if the policy as not accepted, enable to checkbox
            if (!objPolicy.CheckFileAccepted(FileID, UserID))
            {
                //string ConfirmationMessage = "I have read and understood the event";
                //this.chkAgree.Text = ConfirmationMessage;
                btnFinish.Visible = true;
            }
            else
            {
                this.chkAgree.Enabled = false;
                this.chkAgree.Checked = true;
                string lastAccepted = objPolicy.GetLastAccepted(UserID, UserContext.UserData.OrgID, FileID);
                this.chkAgree.Text = ResourceManager.GetString("lblLastAccepted") + " " + lastAccepted;
                btnFinish.Visible  = false;
            }


            DataTable dtPolicy = objPolicy.GetFileName(FileID);


            // string PolicyName = objPolicy.GetFileName(FileID);

            string FileName = dtPolicy.Rows[0]["FileName"].ToString();



            string PolicyDir = @"\General\CPDEvent\" + UserContext.UserData.OrgID.ToString();

            this.pdfFrame.Attributes["src"] = PolicyDir + @"\" + dtPolicy.Rows[0]["FileName"].ToString();
            this.pdfFrame.Visible           = true;
        }
Exemple #2
0
        protected void btnFinish_Click(object sender, System.EventArgs e)
        {
            int FileID        = int.Parse(Request.QueryString["FileID"].ToString());
            int EventPeriodId = int.Parse(Request.QueryString["EventPeriodId"].ToString());
            int UserID        = UserContext.UserID;


            BusinessServices.Event objEvent = new BusinessServices.Event();
            // Only want to do anything if user has read and understood the policy
            if (this.chkAgree.Checked)
            {
                // Check if policy marked as accepted
                // If not then mark user as accepted the policy
                if (!objEvent.CheckFileAccepted(FileID, UserID))
                {
                    objEvent.AcceptFile(FileID, UserID);
                }
            }
            // Response.Redirect("/MyTraining.aspx");
            Response.Write("<script language='javascript'> {opener.location.reload(); self.close(); }</script>");
            //Page.ClientScript.RegisterOnSubmitStatement(typeof(Page), "closePage", "window.onunload = CloseWindow();");
        }