Ejemplo n.º 1
0
        protected void DenyFormBtn_Click(object sender, EventArgs e)
        {
            FormResult.Visible = false;
            //updating a form not, creating it
            if (Request.QueryString["pfid"] != null)
            {
                string  denyText = DenyReason.Text;
                int     formId   = int.Parse(Request.QueryString["pfid"]);
                Form    f        = FormUtil.GetForm(formId);
                Project p        = ProjectUtil.GetProject(f.ProjectId);

                User user = (User)Session["User"];
                FormUtil.DenyForm(formId, denyText, user.RoleId);
                FormResult.CssClass = "success";
                FormResult.Text     = "Denied form " + f.FormName;
                if (denyText.Length > 0)
                {
                    FormResult.Text += ": " + denyText;
                }
                else
                {
                    denyText = "None specified";
                }
                Log.Info(user.Identity + " denied " + CompanyUtil.GetCompanyName(p.CompanyId) + "'s form " + f.FormName + " - " + p.Name + " with reason: " + denyText);
                Response.Redirect("Forms.aspx?pfid=" + formId);
                FormResult.Visible = true;
            }
        }