Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lblUserName.Text = Session["name"].ToString();

            User user = (User)Session["newLogin"];

            lbluserID.Text = user.UserID.ToString();


            string policyId = "DB676D6E-5CF5-42CA-850E-57ACF020865C";

            var ace = new AccessControl();
            var ap  = ace.GetAccessPolicy(user.UserID, policyId);

            btnCancel.Visible = false;
            btnSubmit.Visible = false;

            Process.TrainingController listTraining = new Process.TrainingController();

            GridView1.DataSource =
                listTraining.ListTraining(0);

            GridView1.DataBind();

            DateTime time = DateTime.Now;

            lblSubmitDate.Text = Convert.ToString(time);
        }
Example #2
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            Process.TrainingController newlogin = new Process.TrainingController();

            Session["newLogin"] = newlogin.LoginVerify(txtusername.Text, txtPassword.Text);
            User user = (User)Session["newLogin"];

            string name = txtusername.Text.Trim();

            //if (Session["newLogin"].ToString() != null)
            //{

            //        Session["name"] = name;
            //        Response.Redirect("Apply.aspx");

            //}
            if (user.ToString() != null && user.UserID.ToString() == "4")
            {
                Session["name"] = name;
                Response.Redirect("Apply.aspx");
            }
            else
            {
                Session["name"] = name;
                Response.Redirect("ApproveReject.aspx");
                // Response.Write("You does not had access");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            lblUserName.Text = Session["name"].ToString();

            User user = (User)Session["newLogin"];

            lbluserID.Text = user.UserID.ToString();


            string policyId = "6BC456FC-6359-487B-B9BF-71BBA8FD1F7E";


            TrainingController tc = new TrainingController();

            AccessPolicy accPolicy;

            accPolicy = tc.GetUserPermission(user.UserID, policyId);

            if (accPolicy.HasNoAccess())
            {
                Response.Redirect("Default.aspx");
            }

            Process.TrainingController listTraining = new Process.TrainingController();

            GridView1.DataSource =
                listTraining.ListTraining(0);

            GridView1.DataBind();

            DateTime time = DateTime.Now;

            lblSubmitDate.Text = Convert.ToString(time);
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Process.TrainingController listTraining = new Process.TrainingController();

            GridView1.DataSource =
                listTraining.ListTraining(0);

            GridView1.DataBind();
        }
Example #5
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            TrainingRequest newTraining = new TrainingRequest();

            newTraining.CorrelationID = Guid.NewGuid();
            newTraining.UserName      = lblUserName.Text;
            newTraining.StartDate     = Convert.ToDateTime(txtStartDate.Text);
            newTraining.EndDate       = Convert.ToDateTime(txtEndDate.Text);
            newTraining.RequestStatus = lblStatus.Text;
            newTraining.TrainingName  = txtTrainingName.Text;
            newTraining.SubmitDate    = Convert.ToDateTime(lblSubmitDate.Text);

            Process.TrainingController submitTraining = new Process.TrainingController();
            submitTraining.Apply(newTraining);

            Page.Response.Redirect(Page.Request.Url.ToString(), true);
        }
Example #6
0
        protected void btnCancel_Click(object sender, EventArgs e)
        {
            TrainingRequest cancelTraining = new TrainingRequest();

            cancelTraining.TRequestID    = lblRequestID.Text;
            cancelTraining.UserName      = lblUserName.Text;
            cancelTraining.CorrelationID = Guid.Parse(lblguid.Text);
            cancelTraining.StartDate     = Convert.ToDateTime(txtStartDate.Text);
            cancelTraining.EndDate       = Convert.ToDateTime(txtEndDate.Text);
            cancelTraining.RequestStatus = "Cancelled";
            cancelTraining.TrainingName  = txtTrainingName.Text;
            cancelTraining.SubmitDate    = Convert.ToDateTime(lblSubmitDate.Text);

            Process.TrainingController CancelledTraining = new Process.TrainingController();
            CancelledTraining.Cancel(cancelTraining);
            Page.Response.Redirect(Page.Request.Url.ToString(), true);
        }
Example #7
0
        protected void btnApprove_Click(object sender, EventArgs e)
        {
            TrainingRequest approveTraining = new TrainingRequest();

            approveTraining.TRequestID    = lblRequestID.Text;
            approveTraining.UserName      = lblUserName.Text;
            approveTraining.CorrelationID = Guid.Parse(lblguid.Text);
            approveTraining.StartDate     = Convert.ToDateTime(txtStartDate.Text);
            approveTraining.EndDate       = Convert.ToDateTime(txtEndDate.Text);
            //approveTraining.CorrelationID = Guid.Parse(lblguid.Text);
            approveTraining.RequestStatus = "Approval";
            approveTraining.TrainingName  = txtTrainingName.Text;
            approveTraining.SubmitDate    = Convert.ToDateTime(lblSubmitDate.Text);
            Process.TrainingController approvalTraining = new Process.TrainingController();
            approvalTraining.Approve(approveTraining);


            Page.Response.Redirect(Page.Request.Url.ToString(), true);
        }
Example #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lblUserName.Text = Session["name"].ToString();

            User user = (User)Session["newLogin"];

            lbluserID.Text = user.UserID.ToString();


            string policyId = "DB676D6E-5CF5-42CA-850E-57ACF020865C";

            //business
            //var ace = new AccessControl();
            //var ap = ace.GetAccessPolicy(user.UserID, policyId);

            // TODO: call UIPC to get the user's access.

            //if (ap.HasFullAccess())
            //{
            //    btnApprove.Visible = false;
            //    btnReject.Visible = false;
            //    btnExport.Visible = false;
            //}


            Process.TrainingController listTraining = new Process.TrainingController();

            GridView1.DataSource =
                listTraining.ListTraining(0);

            GridView1.DataBind();

            DateTime time = DateTime.Now;

            lblSubmitDate.Text = Convert.ToString(time);
        }