Exemplo n.º 1
0
        private StringBuilder UpdateDonorList(string id, string field, string value, string donorEventListId)
        {
            var sbReturn = new StringBuilder();

            try
            {
                var donorList = new DonorList(id);

                switch (field)
                {
                    case "AccountName":
                        donorList.AccountName = value;
                        break;
                    case "AddressLine1":
                        donorList.AddressLine1 = value;
                        break;
                    case "City":
                        donorList.City = value;
                        break;
                    case "State":
                        donorList.State = value;
                        break;
                    case "PostCode":
                        donorList.PostCode = value;
                        break;
                    case "PhoneNumber":
                        donorList.PhoneNumber = value;
                        break;
                    case "Email":
                        donorList.EmailAddress = value;
                        break;
                }

                //                donorList.Update();
                donorList.Save();

                var donorEventList = new DonorEventList(User.Identity.Name, int.Parse(donorEventListId))
                {
                    UpdatedInfo = true,
                    UpdatedInfoDateTime = DateTime.Now,
                    UpdatedInfo_User = User.Identity.Name
                };
                donorEventList.Update();

                sbReturn.Append("True");
            }
            catch
            {
                sbReturn.Append("Error");
            }

            return sbReturn;
        }
        protected void btnUpdateDemo_Click(object sender, EventArgs e)
        {
            var donorEventList = new DonorEventList(User.Identity.Name, int.Parse(Request["delid"]))
            {
                UpdatedInfo = false,
                UpdatedInfo_User = null,
                UpdatedInfoDateTime = DateTime.Parse("1/1/1000")
            };
            donorEventList.Update();

            Response.Redirect("DonorEventListDetails.aspx?delid=" + donorEventList.pk_DonorEventList);
        }