protected void lnkbtnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         if (!string.IsNullOrEmpty(txtNotes.Text))
         {
             OrganizationInfo o = new OrganizationInfo(OrganizationID);
             standardstewardshipIds = System.Configuration.ConfigurationManager.AppSettings["StewardshipStandardIDs"];
             OrganizationInfo.SetStatus(OrganizationStatus.Deleted, OrganizationID, txtNotes.Text, o.OrganizationTypeId, standardstewardshipIds);
             Response.Redirect(pageId);
             lblinfo.Text    = "Successfully deleted";
             lblinfo.Visible = true;
         }
         else
         {
             string script = string.Format("alert('{0}');", "Cannot delete please provide notes for deleting.");
             if (Page != null && !Page.ClientScript.IsClientScriptBlockRegistered("alert"))
             {
                 Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "alert", script, true /* addScriptTags */);
             }
         }
     }
     catch (Exception ex)
     {
         new SqlLog().InsertSqlLog(currentUserInfo.UserId, "viewStakeHolder.lnkbtnDelete_Click", ex);
     }
 }
    protected void lnkbtnApprove_Click(object sender, EventArgs e)
    {
        lblinfo.Visible        = false;
        standardstewardshipIds = System.Configuration.ConfigurationManager.AppSettings["StewardshipStandardIDs"];
        OrganizationInfo o = new OrganizationInfo(OrganizationID);

        OrganizationInfo.SetStatus(OrganizationStatus.Accepted, OrganizationID, txtNotes.Text, o.OrganizationTypeId, standardstewardshipIds);
        DataSet ds = UserInfo.getDefaultUsers(OrganizationID);

        if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
        {
            UserInfo user = new UserInfo(Convert.ToInt32(ds.Tables[0].Rows[0]["UserId"].ToString()));
            if (!user.IsApproved)
            {
                Emails email = new Emails();
                email.To      = user.Login;
                email.URL     = ConfigurationManager.AppSettings["EmailUrl"].ToString() + "ChangePassword.aspx?userId=" + Encryption.Encrypt(user.UserId.ToString());
                email.From    = "*****@*****.**";
                email.Subject = "Registration Approval Email";
                Thread Email_Thread = new Thread(() => SendEmails(email, Emails.EmailType.ApplicationApprovedEmail.ToString()));
                Email_Thread.Start();
            }
        }
        Response.Redirect(pageId);
        lblinfo.Text    = "Successfully Approved";
        lblinfo.Visible = true;
    }
 protected void gvLatestSteward_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Approve")
     {
         OrganizationInfo o = new OrganizationInfo(Convert.ToInt32(e.CommandArgument));
         standardIds = System.Configuration.ConfigurationManager.AppSettings["StewardshipStandardIDs"];
         OrganizationInfo.SetStatus(OrganizationStatus.Accepted, o.OrganizationId, "Approved from dashboard", o.OrganizationTypeId, standardIds);
         DataSet ds = UserInfo.getDefaultUsers(o.OrganizationId);
         if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
         {
             UserInfo user = new UserInfo(Convert.ToInt32(ds.Tables[0].Rows[0]["UserId"].ToString()));
             if (!user.IsApproved)
             {
                 Emails email = new Emails();
                 email.To      = user.Login;
                 email.URL     = ConfigurationManager.AppSettings["EmailUrl"].ToString() + "ChangePassword.aspx?userId=" + Encryption.Encrypt(user.UserId.ToString());
                 email.From    = "*****@*****.**";
                 email.Subject = "Registration Approval Email";
                 //If thread doesnt works then uncomment the commented area below and comment 2 lines of threading.
                 Thread Email_Thread = new Thread(() => SendEmails(email, Emails.EmailType.ApplicationApprovedEmail.ToString()));
                 Email_Thread.Start();
                 //SendEmails(email, Emails.EmailType.ApplicationApprovedEmail.ToString());
             }
         }
         Response.Redirect("/Dashboard/admindashboard.aspx");//,false);
         //Context.ApplicationInstance.CompleteRequest();
     }
 }
    protected void btndelYes_Click(object sender, EventArgs e)
    {
        OrganizationInfo o = new OrganizationInfo(OrganizationID);

        OrganizationInfo.SetStatus(OrganizationStatus.Deleted, OrganizationID, txtNotes.Text, o.OrganizationTypeId, standardstewardshipIds);
        Response.Redirect(pageId);
        lblinfo.Text      = "Successfully deleted";
        lblinfo.Visible   = true;
        dlgcnfdel.Visible = false;
    }
    protected void lnkbtnPending_Click(object sender, EventArgs e)
    {
        OrganizationInfo o = new OrganizationInfo(OrganizationID);

        standardstewardshipIds = System.Configuration.ConfigurationManager.AppSettings["StewardshipStandardIDs"];
        OrganizationInfo.SetStatus(OrganizationStatus.Pending, OrganizationID, txtNotes.Text, o.OrganizationTypeId, standardstewardshipIds);
        Response.Redirect(pageId);
        lblinfo.Text    = "Successfully deleted";
        lblinfo.Visible = true;
    }
 protected void lnkbtnPending_Click(object sender, EventArgs e)
 {
     try{
         OrganizationInfo o = new OrganizationInfo(OrganizationID);
         standardstewardshipIds = System.Configuration.ConfigurationManager.AppSettings["StewardshipStandardIDs"];
         OrganizationInfo.SetStatus(OrganizationStatus.Pending, OrganizationID, txtNotes.Text, o.OrganizationTypeId, standardstewardshipIds);
         Response.Redirect(pageId);
         lblinfo.Text    = "Successfully deleted";
         lblinfo.Visible = true;
     }
     catch (Exception ex)
     {
         new SqlLog().InsertSqlLog(currentUserInfo.UserId, "viewStakeHolder.lnkbtnPending_click", ex);
     }
 }