Exemple #1
0
        protected void btnRealDelete_Click(object sender, EventArgs e)
        {
            Entity.IsArchived = true;
            db.SubmitChanges();

            NoticeManager.SetMessage("Item removed", "list.aspx");
        }
        protected void btnReinstate_Click(object sender, EventArgs e)
        {
            CRM_FundraisingGiftProfile.IsArchived = false;
            db.SubmitChanges();

            NoticeManager.SetMessage("Item reinstated");
        }
        protected void lnkAutoSearch(object sender, EventArgs e)
        {
            IContact Item = new ContactManager().Contacts.SingleOrDefault(c => c.Reference == acContact.SelectedID);

            if (Item != null)
            {
                if (!Entity.CRM_CalendarInvites.Any((a => a.Reference == Item.Reference)))
                {
                    CRM_CalendarInvite CRM_CalendarInvite = new CRM_CalendarInvite()
                    {
                        CRM_CalendarID     = Entity.ID,
                        IsAttended         = false,
                        IsBooked           = false,
                        IsCancelled        = false,
                        IsInvited          = false,
                        LastAmendedAdminID = AdminUser.ID,
                        Reference          = Item.Reference,
                        ContactName        = Item.DisplayName,
                        LastUpdated        = UKTime.Now
                    };

                    db.CRM_CalendarInvites.InsertOnSubmit(CRM_CalendarInvite);
                    db.SubmitChanges();
                }
            }

            NoticeManager.SetMessage(Item.DisplayName + " tagged to " + Entity.DisplayName);
        }
        protected void lnkRunQuery_Click(object sender, EventArgs e)
        {
            foreach (RepeaterItem item in rptQuery.Items)
            {
                DataQuery dq = (DataQuery)item.FindControl("ucDataQuery");
                dq.lnkSave_Click(sender, e);
            }
            var query = HttpUtility.ParseQueryString(Request.Url.Query);

            if (query["query"] != null)
            {
                query.Remove("query");
                query.Remove("data");
                query.Remove("mailout");
                query.Remove("emailing");
                query.Remove("groupbyrel");
                query.Remove("groupbyaddress");
            }

            string redirect = Request.Url.AbsolutePath + (query.Count == 0 ? "?" : "?" + query + "&") + "query=" + ddlExistingQueries.SelectedValue;

            redirect += "&data=" + rbNone.Checked + "&mailout=" + rbMailOut.Checked + "&emailing=" + rbEmail.Checked + "&groupbyrel=" + chkGroupByRelationship.Checked + "&groupbyaddress=" + chkGroupByAddress.Checked;


            NoticeManager.SetMessage("Query Complete", redirect);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(Request.QueryString["attend"]) && Request.QueryString["attend"] == "true")
            {
                CanAttend = true;
            }

            ucNavCal.Entity          = Entity;
            btnSendRSVP.EventHandler = btnSendRSVP_Click;
            myInvite = Entity.CRM_CalendarAdmins.FirstOrDefault(f => f.AdminID == AdminUser.ID);

            if (!Page.IsPostBack)
            {
                ddlStatus.DataSource = Enumeration.GetAll <CRM_CalendarAdmin.StatusTypes>();
                ddlStatus.DataBind();

                if (CanAttend)
                {
                    ddlStatus.SelectedValue = ((byte)CRM_CalendarAdmin.StatusTypes.Attending).ToString();
                }
                else
                {
                    ddlStatus.SelectedValue = ((byte)CRM_CalendarAdmin.StatusTypes.NotAttending).ToString();
                }
            }

            if (myInvite == null)
            {
                NoticeManager.SetMessage("You are no longer tagged on this event to RSVP, or are not logged in as the person who received this email", "/admin");
            }
            else
            {
                Admin = db.Admins.Single(c => c.ID == myInvite.CRM_Calendar.CreatedByAdminID);
            }
        }
        protected void btnRealDelete_Click(object sender, EventArgs e)
        {
            db.CRM_AnnualPassTypes.DeleteOnSubmit(Entity);
            db.SubmitChanges();

            NoticeManager.SetMessage("Item removed", "list.aspx");
        }
Exemple #7
0
        protected void lnkSelectNew_Click(object sender, EventArgs e)
        {
            CRM_Person person = db.CRM_Persons.Single(c => c.ID.ToString() == ucACNewPerson.SelectedID);

            AddPersonToPass(person.Reference);
            NoticeManager.SetMessage(person.Fullname + " added to pass " + Entity.MembershipNumber);
        }
        protected void btnRealDelete_Click(object sender, EventArgs e)
        {
            FormField.IsArchived = true;
            db.SubmitChanges();

            NoticeManager.SetMessage("Form Field Deleted", "list.aspx");
        }
Exemple #9
0
        protected void lnkNew_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(txtCurrent_New.Text) || String.IsNullOrEmpty(txtRedirect_New.Text))
            {
                if (String.IsNullOrEmpty(txtCurrent_New.Text))
                {
                    txtCurrent_New.addStyle("border:1px solid red;");
                }

                if (String.IsNullOrEmpty(txtRedirect_New.Text))
                {
                    txtRedirect_New.addStyle("border:1px solid red;");
                }
            }
            else
            {
                CRM.Code.Models.Redirect redirect = new CRM.Code.Models.Redirect();
                db.Redirects.InsertOnSubmit(redirect);

                redirect.CurrentUrl  = (txtCurrent_New.Text.StartsWith("/") || txtCurrent_New.Text.StartsWith("http")) ? txtCurrent_New.Text : "/" + txtCurrent_New.Text;
                redirect.RedirectUrl = (txtRedirect_New.Text.StartsWith("/") || txtRedirect_New.Text.StartsWith("http")) ? txtRedirect_New.Text : "/" + txtRedirect_New.Text;
                db.SubmitChanges();
                NoticeManager.SetMessage("404 Redirect Added");
            }
        }
Exemple #10
0
        protected void btnReinstate_Click(object sender, EventArgs e)
        {
            PersonOrganisation.IsArchived = false;
            db.SubmitChanges();

            NoticeManager.SetMessage("Item reinstated");
        }
 protected void btnSubmitChanges_Click(object sender, EventArgs e)
 {
     if (Page.IsValid && ucCustomFields.IsValid())
     {
         SaveRecord(false);
         NoticeManager.SetMessage("Person Updated");
     }
 }
        protected void btnRealDelete_Click(object sender, EventArgs e)
        {
            db.Admins.DeleteOnSubmit(Entity);

            db.SubmitChanges();

            NoticeManager.SetMessage("Admin Deleted", "list.aspx");
        }
Exemple #13
0
 protected void ddlAddParticipant_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddlAddParticipant.SelectedValue != "")
     {
         AddAdminToTask(Convert.ToInt32(ddlAddParticipant.SelectedValue));
         NoticeManager.SetMessage(ddlAddParticipant.SelectedItem.Text + " added");
     }
 }
Exemple #14
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                SaveRecord(true);

                NoticeManager.SetMessage("Item Added", "../finance/details.aspx?id=" + Entity.ID);
            }
        }
        protected void btnRealDelete_Click(object sender, EventArgs e)
        {
            string backList = BackURL;

            db.Medias.DeleteOnSubmit(CurrentMedia);
            db.SubmitChanges();

            NoticeManager.SetMessage("Media Deleted", backList);
        }
Exemple #16
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                SaveRecord(true);

                NoticeManager.SetMessage("Note Added", "details.aspx?id=" + Entity.ID + "&" + Request.QueryString);
            }
        }
Exemple #17
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                SaveRecord(true);

                NoticeManager.SetMessage("Pass Created, start adding members", "details.aspx?id=" + Entity.ID + "&pid=" + CRM_AnnualPass.ID);
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                SaveRecord(true);

                NoticeManager.SetMessage("Media Added", BackURL);
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Page.IsValid && ucCustomFields.IsValid())
            {
                SaveRecord(true);

                NoticeManager.SetMessage("Item Added", "details.aspx?id=" + Entity.ID);
            }
        }
Exemple #20
0
        protected void lnkRemove_Click(object sender, EventArgs e)
        {
            LinkButton lnk = (LinkButton)sender;

            CRM.Code.Models.Redirect redirect = db.Redirects.FirstOrDefault(p => p.ID.ToString() == lnk.CommandArgument);
            db.Redirects.DeleteOnSubmit(redirect);
            db.SubmitChanges();
            NoticeManager.SetMessage("404 Redirect Removed");
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                SaveRecord(true);

                NoticeManager.SetMessage("Card Created, start adding passes", "details.aspx?id=" + Entity.ID);
            }
        }
        protected void btnSubmitChanges_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                SaveRecord(false);

                NoticeManager.SetMessage("Your details have been updated");
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                SaveRecord(true);

                NoticeManager.SetMessage("Item Added", "details.aspx?id=" + Entity.ID + "&pid=" + CRM_FundraisingGiftProfile.ID);
            }
        }
Exemple #24
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                SaveRecord(true);

                NoticeManager.SetMessage("Item Added", "list.aspx");
            }
        }
Exemple #25
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                SaveRecord(true);

                NoticeManager.SetMessage("Item Added", "details.aspx?id=" + Entity.ID + "&pid=" + PersonOrganisation.ID);
            }
        }
Exemple #26
0
        protected void lnkCreateNew_Click(object sender, EventArgs e)
        {
            CRM_Address address = new CRM_Address()
            {
                AddressLine1 = txtAddress1.Text,
                AddressLine2 = txtAddress2.Text,
                AddressLine3 = txtAddress3.Text,
                AddressLine4 = "",
                AddressLine5 = "",
                CountryID    = db.Countries.First().ID,
                County       = txtCounty.Text,
                Postcode     = txtPostcode.Text,
                Town         = txtCity.Text
            };

            db.CRM_Addresses.InsertOnSubmit(address);
            db.SubmitChanges();

            CRM_Person person = new CRM_Person()
            {
                DateAdded        = UKTime.Now,
                CRM_AddressID    = address.ID,
                DateModified     = UKTime.Now,
                DateOfBirth      = null,
                Firstname        = txtFirstname.Text,
                IsArchived       = false,
                IsChild          = false,
                IsConcession     = false,
                IsContactEmail   = (bool)Entity.DoNotEmail,
                IsContactPost    = (bool)Entity.DoNotMail,
                IsGiftAid        = false,
                Lastname         = txtLastname.Text,
                PrimaryEmail     = txtEmail.Text,
                PrimaryTelephone = txtTelephone.Text,
                Title            = ddlTitle.SelectedItem.Text,
                WebsiteAccountID = Entity.OriginAccountID,
                IsCarerMinder    = false,
                PreviousNames    = "",
                LegacyID         = null,
                IsMale           = null,
                AddressType      = 0,
                Telephone2       = "",
                PrimaryAddressID = address.ID,
                Password         = "",
                TempCode         = ""
            };

            db.CRM_Persons.InsertOnSubmit(person);
            db.SubmitChanges();

            ApplyCustomField(person, 2, 22);
            ApplyConstituentsToSelected(person);

            AddRelationship(person);

            NoticeManager.SetMessage("Record added (" + person.Reference + ")");
        }
        protected void btnSubmitChanges_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                SaveRecord(false);

                NoticeManager.SetMessage("Question Updated");
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                SaveRecord(true);

                NoticeManager.SetMessage("Field Added", "details.aspx?id=" + FormField.ID);
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                SaveRecord(true);

                NoticeManager.SetMessage("Calendar Added", Entity.NextStageURL);
            }
        }
        protected void Page_PreInit(object sender, EventArgs e)
        {
            AuthAdmin authAdmin = new AuthAdmin(db);

            AdminUser = authAdmin.Authorise();


            if (AdminUser == null)
            {
                Session.Remove("IsAuthorized");
                Response.Redirect("/admin/login.aspx?redirect=" + Request.RawUrl);
            }
            else
            {
                string currentURL = GetCurrentURL();

                if (currentURL.StartsWith("\\admin"))
                {
                    int adminLength = "\\admin".Length;
                    currentURL = currentURL.Substring(adminLength, currentURL.Length - adminLength);
                }
                AdminPermission = AdminUser.CRM_SystemAccessAdmins.SingleOrDefault(s => s.CRM_SystemAccess != null && s.CRM_SystemAccess.Path.ToLower() == currentURL.ToLower());

                bool CanView = true;

                if (!Request.RawUrl.StartsWith("/admin/default.aspx"))
                {
                    if (AdminPermission == null || !AdminPermission.IsRead)
                    {
                        CanView = false;

                        AdminPermission = AdminUser.CRM_SystemAccessAdmins.SingleOrDefault(s => s.CRM_SystemAccess == null && ((string)s.BespokeURL).ToLower() == Request.RawUrl);


                        if (AdminPermission == null || !AdminPermission.IsRead)
                        {
                            CanView = false;
                        }
                        else if (AdminPermission != null)
                        {
                            CanView = true;
                        }
                    }
                }

                if (!CanView)
                {
                    NoticeManager.SetMessage("You do not have permission to view this page, please contact a Master Admin", "/admin");
                }


                IsAuthorised            = true;
                Session["IsAuthorized"] = true;
            }
        }