Esempio n. 1
0
        private void GetApprovalStatus()
        {
            cmdTestingApprove.Enabled = false;
            cmdFinalApprove.Enabled   = false;

            tTestingApprovedBy.Text  = "Not Approved";
            tTestingApproveDate.Text = "";
            tFinalApprovedBy.Text    = "Not Approved";
            tFinalApproveDate.Text   = "";
            //tRequestBy.Text = "Not Requested";
            //tRequestDate.Text = "";

            if (tRequestBy.Text == "Not Requested")
            {
                cmdFinalApprove.Enabled   = false;
                cmdTestingApprove.Enabled = false;
                return;
            }

            try
            {
                cmdTestingApprove.Enabled = false;
                cmdFinalApprove.Enabled   = false;

                if (UserIsApprover)
                {
                    cmdFinalApprove.Enabled = true;
                }

                if (UserIsTester)
                {
                    cmdTestingApprove.Enabled = true;
                }

                using (DataStuff sn = new DataStuff())
                {
                    DataTable dt = sn.ProjectGetApprovalStatusRelease(ServerName, ProjectName);

                    if (dt.Rows.Count > 0)
                    {
                        foreach (DataRow row in dt.Rows)
                        {
                            if (row["FunctionName"].ToString() == "Approve Testing")
                            {
                                tTestingApprovedBy.Text   = row["UserName"].ToString();
                                tTestingApproveDate.Text  = row["ApproveDate"].ToString();
                                cmdTestingApprove.Enabled = false;
                            }

                            if (row["FunctionName"].ToString() == "Approve Final")
                            {
                                tFinalApprovedBy.Text   = row["UserName"].ToString();
                                tFinalApproveDate.Text  = row["ApproveDate"].ToString();
                                cmdFinalApprove.Enabled = false;
                            }
                        }
                    }
                }
            }

            catch
            {
            }
        }