当前位置: 首页>>代码示例>>C#>>正文


C# DataAccessLayer.SaveFeedback方法代码示例

本文整理汇总了C#中DataAccessLayer.SaveFeedback方法的典型用法代码示例。如果您正苦于以下问题:C# DataAccessLayer.SaveFeedback方法的具体用法?C# DataAccessLayer.SaveFeedback怎么用?C# DataAccessLayer.SaveFeedback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataAccessLayer的用法示例。


在下文中一共展示了DataAccessLayer.SaveFeedback方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SaveDataToReportDB

        private Boolean SaveDataToReportDB()
        {
            bool blnDataSaved = false;

            try
            {
                string FirstName = "";
                string Surname = "";

                if (txtName.Value.IndexOf(" ") != -1)
                {
                    FirstName = txtName.Value.Substring(0, txtName.Value.IndexOf(" ")).Trim();
                    Surname = txtName.Value.Substring(txtName.Value.IndexOf(" ") + 1).Trim();
                }
                else
                {
                    FirstName = txtName.Value.Trim();
                }

                //Store Feedback Entitiy Details
                Feedback objFeedback = new Feedback();

                //Store Customer Entitiy Details
                Customer objCustomer = new Customer();
                objCustomer.EmailAddress = txtEmail.Value.Trim();
                objCustomer.Firstname = FirstName;
                objCustomer.Surname = Surname;
                objCustomer.HomeClubID = currentClub.ClubId.Rendered;
                objCustomer.SubscribeToNewsletter = chkSubscribe.Checked;
                objCustomer.TelephoneNumber = txtPhone.Value.Trim();
                objFeedback.Customer = objCustomer;
                objFeedback.FeedbackSubject = "Club Enquiry";
                objFeedback.FeedbackSubjectDetail = "Virgin Active Website";
                objFeedback.FeedbackTypeID = Constants.FeedbackType.ClubEnquiry;
                objFeedback.PrimaryClubID = currentClub.ClubId.Rendered;
                objFeedback.SubmissionDate = DateTime.Now;

                //Add Comment
                Comment objComment = new Comment();

                objComment.CommentDetail = drpHowDidYouFindUs.SelectedValue.ToString();
                objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                objComment.SortOrder = 1;
                objComment.Subject = "How did you find out about us";

                List<Comment> objComments = new List<Comment>();
                objComments.Add(objComment);
                objFeedback.Comments = objComments;

                string connection = Sitecore.Configuration.Settings.GetSetting("ConnectionString_VirginActiveReports");
                DataAccessLayer dal = new DataAccessLayer(connection);
                if (dal.SaveFeedback(Context.User.Identity.Name, enquiryItem.DisplayName, objFeedback) > 0)
                {
                    blnDataSaved = true;
                }

            }
            catch (Exception ex)
            {
                Log.Error(String.Format("Error saving form data to reports db {1}: {0}", ex.Message, currentClub.Clubname.Raw), this);
                mm.virginactive.common.EmailMessagingService.ErrorEmailNotification.SendMail(ex);
            }

            return blnDataSaved;
        }
开发者ID:jon-mcmr,项目名称:Virgin-Tds,代码行数:65,代码来源:ClubEnquiryForm.ascx.cs

示例2: SaveDataToReportDB

        private Boolean SaveDataToReportDB()
        {
            bool blnDataSaved = false;

            try
            {
                string FirstName = "";
                string Surname = "";

                if (txtName.Value.IndexOf(" ") != -1)
                {
                    FirstName = txtName.Value.Substring(0, txtName.Value.IndexOf(" ")).Trim();
                    Surname = txtName.Value.Substring(txtName.Value.IndexOf(" ") + 1).Trim();
                }
                else
                {
                    FirstName = txtName.Value.Trim();
                }

                //Store Feedback Entitiy Details
                Feedback objFeedback = new Feedback();

                //Store Customer Entitiy Details
                Customer objCustomer = new Customer();
                objCustomer.EmailAddress = txtEmail.Value.Trim();
                objCustomer.Firstname = FirstName;
                objCustomer.Surname = Surname;
                objCustomer.MembershipNumber = txtMembership.Value.Trim();
                objCustomer.HomeClubID = club.ClubId.Rendered;
                objCustomer.TelephoneNumber = txtPhone.Value;
                objFeedback.Customer = objCustomer;
                objFeedback.FeedbackSubject = "Health And Beauty Enquiry";
                objFeedback.FeedbackSubjectDetail = "Virgin Active Website";
                objFeedback.FeedbackTypeID = Constants.FeedbackType.HealthAndBeautyFeedback;
                objFeedback.PrimaryClubID = club.ClubId.Rendered;
                objFeedback.SubmissionDate = DateTime.Now;
                //objFeedback.PreferredCallbackDate = Convert.ToDateTime(txtPreferredDay.Value.Trim(), System.Globalization.CultureInfo.CreateSpecificCulture("en-GB");
                //objFeedback.PreferredCallbackTime = drpPreferredTime.SelectedValue.ToString() != Translate.Text("Select") ? drpPreferredTime.SelectedValue.ToString() : "";

                //Add Comment
                Comment objComment = new Comment();

                objComment.CommentDetail = drpTreatment.SelectedValue.ToString() != Translate.Text("Select") ? drpTreatment.SelectedValue.ToString() : "";
                objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                objComment.SortOrder = 1;
                objComment.Subject = "Treatment";

                List<Comment> objComments = new List<Comment>();
                objComments.Add(objComment);

                objComment = new Comment();
                objComment.CommentDetail = txtPreferredDay.Value.Trim();
                objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                objComment.SortOrder = 2;
                objComment.Subject = "Preferred Treatment Day";

                objComments.Add(objComment);

                objComment = new Comment();
                objComment.CommentDetail = drpPreferredTime.SelectedValue.ToString() != Translate.Text("Select") ? drpPreferredTime.SelectedValue.ToString() : "";
                objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                objComment.SortOrder = 3;
                objComment.Subject = "Preferred Treatment Time";

                objComments.Add(objComment);

                objFeedback.Comments = objComments;

                string connection = Sitecore.Configuration.Settings.GetSetting("ConnectionString_VirginActiveReports");
                DataAccessLayer dal = new DataAccessLayer(connection);
                if (dal.SaveFeedback(Context.User.Identity.Name, listing.DisplayName, objFeedback) > 0)
                {
                    blnDataSaved = true;
                }

            }
            catch (Exception ex)
            {
                Log.Error(String.Format("Error saving form data to reports db {1}: {0}", ex.Message, club.Clubname.Raw), this);
                mm.virginactive.common.EmailMessagingService.ErrorEmailNotification.SendMail(ex);
            }

            return blnDataSaved;
        }
开发者ID:jon-mcmr,项目名称:Virgin-Tds,代码行数:84,代码来源:ClubHealthAndBeautyListing.ascx.cs

示例3: btnSubmit_Click

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (Page.IsValid == true)
                {
                    //Get User from Session
                    //Check Session
                    User objUser = new User();
                    if (Session["sess_User_landing"] != null)
                    {
                        objUser = (User)Session["sess_User_landing"];

                        clubId = objUser.BrowsingHistory.LandingClubID;
                        profile = objUser.BrowsingHistory.LandingProfile;
                        region = objUser.BrowsingHistory.LandingRegion;
                    }

                    //Get Club Data

                    if (!String.IsNullOrEmpty(clubId))
                    {
                        clubItem = SitecoreHelper.GetClubOnClubId(clubId);

                        if (clubItem != null)
                        {

                            //Store Feedback Entitiy Details
                            Feedback objFeedback = new Feedback();

                            //Store Customer Entitiy Details
                            Customer objCustomer = new Customer();

                            string FirstName = "";
                            string Surname = "";

                            if (txtName.Value.IndexOf(" ") != -1)
                            {
                                FirstName = txtName.Value.Substring(0, txtName.Value.IndexOf(" ")).Trim();
                                Surname = txtName.Value.Substring(txtName.Value.IndexOf(" ") + 1).Trim();
                            }
                            else
                            {
                                FirstName = txtName.Value.Trim();
                            }

                            objCustomer.EmailAddress = txtEmail.Value;
                            objCustomer.Firstname = FirstName;
                            objCustomer.Surname = Surname;
                            objCustomer.HomeClubID = clubItem.ClubId.Rendered;
                            objCustomer.TelephoneNumber = txtPhone.Value;
                            objCustomer.SubscribeToNewsletter = chkSubscribe.Checked;

                            objFeedback.Customer = objCustomer;
                            objFeedback.FeedbackSubject = "Landing Enquiry"; //Landing Enquiry
                            objFeedback.FeedbackSubjectDetail = "Virgin Active Website Landing Page"; //Virgin Active Website Landing Page
                            objFeedback.FeedbackTypeID = Convert.ToInt32(currentLanding.LandingBase.LandingId.Rendered);
                            objFeedback.PrimaryClubID = clubItem.ClubId.Rendered;
                            objFeedback.SubmissionDate = DateTime.Now;

                            //Add Comment
                            Comment objComment = new Comment();

                            //objComment.CommentDetail = source.Items[source.SelectedIndex].Value;
                            objComment.CommentDetail = currentLanding.LandingBase.LandingIdName.Rendered;// "Q1 Landing Page -2013"; //Other
                            objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                            objComment.SortOrder = 1;
                            objComment.Subject = Translate.Text("How did you hear about us?");

                            List<Comment> objComments = new List<Comment>();
                            objComments.Add(objComment);

                            objFeedback.Comments = objComments;

                            string connection = Sitecore.Configuration.Settings.GetSetting("ConnectionString_VirginActiveReports");
                            DataAccessLayer dal = new DataAccessLayer(connection);
                            int successFlag = dal.SaveFeedback(Context.User.Identity.Name, currentItem.DisplayName, objFeedback);

                            if (successFlag > 0)
                            {
                                //Data is sent to client via email
                                SendAdminEmail();

                                //Data is sent to client via service
                                SendEnquiryDataService();

                                //Data is sent to customer via email
                                SendConfirmationEmail();

                                //Save objFeedback back to session
                                Session["sess_Customer"] = objCustomer;

                                //Redirect to 'Whats Next' Page
                                Sitecore.Links.UrlOptions urlOptions = new Sitecore.Links.UrlOptions();
                                urlOptions.AlwaysIncludeServerUrl = true;
                                urlOptions.AddAspxExtension = false;
                                urlOptions.LanguageEmbedding = LanguageEmbedding.Never;

                                Item whatNextItem = currentItem.InnerItem.Parent.Axes.SelectSingleItem(String.Format("descendant-or-self::*[@@tid = '{0}']", Settings.LandingPagesWhatsNextTemplate));

//.........这里部分代码省略.........
开发者ID:jon-mcmr,项目名称:Virgin-Tds,代码行数:101,代码来源:LandingEnquiryForm.ascx.cs

示例4: btnSubmit_Click

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {

                //Store Feedback Entitiy Details
                Feedback objFeedback = new Feedback();

                //Store Customer Entitiy Details
                Customer objCustomer = new Customer();

                objCustomer.EmailAddress = email.Value;
                //objCustomer.Firstname = "";
                //objCustomer.Surname = "";
                //objCustomer.HomeClubID = "";
                //objCustomer.SubscribeToNewsletter = false;
                //objCustomer.TelephoneNumber = "";
                //objCustomer.MembershipNumber = "";
                //objCustomer.Gender = "";
                //objCustomer.AddressLine1 = "";
                //objCustomer.AddressLine2 = "";
                //objCustomer.AddressLine3 = "";
                //objCustomer.AddressLine4 = "";
                //objCustomer.Postcode = "";

                objFeedback.Customer = objCustomer;
                objFeedback.FeedbackSubject = campaign.CampaignBase.Campaigntype.Raw;
                objFeedback.FeedbackSubjectDetail = campaign.CampaignBase.Campaignname.Rendered;
                objFeedback.FeedbackTypeID = Convert.ToInt32(campaign.CampaignBase.CampaignId.Rendered);
                objFeedback.PrimaryClubID = "";
                objFeedback.SubmissionDate = DateTime.Now;

                string connection = Sitecore.Configuration.Settings.GetSetting("ConnectionString_VirginActiveReports");
                DataAccessLayer dal = new DataAccessLayer(connection);
                int successFlag = dal.SaveFeedback(Context.User.Identity.Name, campaign.DisplayName, objFeedback);

                //Data is sent to client via email
                SendAdminEmail();

                if (campaign.CampaignBase.Sendconfirmationemail.Checked == true)
                {
                    //Data is sent to customer via email
                    SendConfirmationEmail();
                }

                formToComplete.Visible = false;
                formCompleted.Visible = true;

                //System.Threading.Thread.Sleep(5000);
                pnlForm.Update();
                //ClearFormFields();

            }
            catch (Exception ex)
            {
                Log.Error(String.Format("Error storing campaign details: {0}", ex.Message), this);
                mm.virginactive.common.EmailMessagingService.ErrorEmailNotification.SendMail(ex);
            }
        }
开发者ID:jon-mcmr,项目名称:Virgin-Tds,代码行数:59,代码来源:LondonTriathlonII.ascx.cs

示例5: SaveDataToReportDB

        private Boolean SaveDataToReportDB()
        {
            bool blnDataSaved = false;

            try
            {
                //Store Feedback Entitiy Details
                Feedback objFeedback = new Feedback();

                //Store Customer Entitiy Details
                Customer objCustomer = new Customer();
                objCustomer.EmailAddress = txtEmail.Value.Trim();
                objCustomer.Firstname = txtFirstName.Value.Trim();
                objCustomer.Surname = txtSurname.Value.Trim();
                objCustomer.MembershipNumber = txtMembership.Value.Trim();
                objCustomer.HomeClubID = "";

                DateTime datDateOfBirth;
                if (DateTime.TryParse(drpDOBDay.SelectedValue + "/" + drpDOBMonth.SelectedValue + "/" + drpDOBYear.SelectedValue, out datDateOfBirth))
                {
                    objCustomer.DateOfBirth = datDateOfBirth;
                }
                objCustomer.AddressLine1 = txtAddress1.Value.Trim();
                objCustomer.AddressLine2 = txtAddress2.Value.Trim();
                objCustomer.AddressLine3 = txtAddress3.Value.Trim();
                objCustomer.AddressLine4 = (txtAddress4.Value.Trim() + " " + txtAddress5.Value.Trim()).Trim();
                objCustomer.Postcode = txtPostcode2.Value.Trim();
                //objCustomer.PublishDetails = false;
                //objCustomer.SubscribeToNewsletter = false;
                objCustomer.TelephoneNumber = txtHomeNo.Value.Trim();
                objCustomer.AlternativeTelephoneNumber = txtMobileNo.Value.Trim();
                objFeedback.Customer = objCustomer;
                objFeedback.FeedbackSubject = "Personal Details Update";
                objFeedback.FeedbackSubjectDetail = "Virgin Active Website";
                objFeedback.FeedbackTypeID = Constants.FeedbackType.PersonalDetails;
                objFeedback.PrimaryClubID = "";
                objFeedback.SubmissionDate = DateTime.Now;

                //Add Comment
                Comment objComment = new Comment();

                objComment.CommentDetail = hdnRecordId.Value.Trim();
                objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                objComment.SortOrder = 1;
                objComment.Subject = "Record ID";

                List<Comment> objComments = new List<Comment>();
                objComments.Add(objComment);

                //Add Comment
                objComment = new Comment();

                objComment.CommentDetail = txtHomeNo.Value.Trim();
                objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                objComment.SortOrder = 2;
                objComment.Subject = "Home Telephone No.";

                objComments.Add(objComment);

                //Add Comment
                objComment = new Comment();

                objComment.CommentDetail = txtMobileNo.Value.Trim();
                objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                objComment.SortOrder = 3;
                objComment.Subject = "Mobile Telephone No.";

                objComments.Add(objComment);

                //Add Comment
                objComment = new Comment();

                objComment.CommentDetail = txtWorkNo.Value.Trim();
                objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                objComment.SortOrder = 4;
                objComment.Subject = "Work Telephone No.";

                objComments.Add(objComment);

                //Add Comment
                objComment = new Comment();

                objComment.CommentDetail = chkContactByMarketing.Checked == true ? "Y" : "N";
                objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                objComment.SortOrder = 5;
                objComment.Subject = "Contact By Marketing";

                objComments.Add(objComment);

                objFeedback.Comments = objComments;

                string connection = Sitecore.Configuration.Settings.GetSetting("ConnectionString_VirginActiveReports");
                DataAccessLayer dal = new DataAccessLayer(connection);
                if (dal.SaveFeedback(Context.User.Identity.Name, currentItem.DisplayName, objFeedback) > 0)
                {
                    blnDataSaved = true;
                }

            }
            catch (Exception ex)
//.........这里部分代码省略.........
开发者ID:jon-mcmr,项目名称:Virgin-Tds,代码行数:101,代码来源:PersonalDetails.ascx.cs

示例6: btnSubmit_Click

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (Page.IsValid == true)
                {
                    //check if we have a valid club selected
                    Boolean blnClubSuccessfullySelected =  clubFindSelect.SelectedIndex != 0;

                    if (blnClubSuccessfullySelected == true)
                    {
                        //Guid id = new Guid(
                        currentClub = (ClubItem)Sitecore.Context.Database.GetItem(clubFindSelect.SelectedValue);

                        if (currentClub != null)
                        {

                            //Store Feedback Entitiy Details
                            Feedback objFeedback = new Feedback();

                            //Store Customer Entitiy Details
                            Customer objCustomer = new Customer();

                            string FirstName = "";
                            string Surname = "";

                            if (txtName.Value.IndexOf(" ") != -1)
                            {
                                FirstName = txtName.Value.Substring(0, txtName.Value.IndexOf(" ")).Trim();
                                Surname = txtName.Value.Substring(txtName.Value.IndexOf(" ") + 1).Trim();
                            }
                            else
                            {
                                FirstName = txtName.Value.Trim();
                            }

                            objCustomer.EmailAddress = txtEmail.Value;
                            objCustomer.Firstname = FirstName;
                            objCustomer.Surname = Surname;
                            objCustomer.HomeClubID = currentClub.ClubId.Rendered;
                            objCustomer.TelephoneNumber = txtPhone.Value;

                            objFeedback.Customer = objCustomer;
                            objFeedback.FeedbackSubject = currentCampaign.CampaignBase.Campaigntype.Raw;
                            objFeedback.FeedbackSubjectDetail = currentCampaign.CampaignBase.Campaignname.Rendered;
                            objFeedback.FeedbackTypeID = Convert.ToInt32(currentCampaign.CampaignBase.CampaignId.Rendered);
                            objFeedback.PrimaryClubID = currentClub.ClubId.Rendered;
                            objFeedback.SubmissionDate = DateTime.Now;

                            //Add Comment
                            Comment objComment = new Comment();

                            //objComment.CommentDetail = source.Items[source.SelectedIndex].Value;
                            objComment.CommentDetail = drpHowDidYouFindUs.SelectedValue;
                            objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                            objComment.SortOrder = 1;
                            objComment.Subject = Translate.Text("How did you hear about us?");

                            List<Comment> objComments = new List<Comment>();
                            objComments.Add(objComment);

                            objFeedback.Comments = objComments;

                            string connection = Sitecore.Configuration.Settings.GetSetting("ConnectionString_VirginActiveReports");
                            DataAccessLayer dal = new DataAccessLayer(connection);
                            int successFlag = dal.SaveFeedback(Context.User.Identity.Name, currentCampaign.DisplayName, objFeedback);

                            if (successFlag > 0)
                            {
                                //Data is sent to client via email
                                SendAdminEmail();

                                if (currentCampaign.CampaignBase.Isweblead.Checked == true)
                                {
                                    //Data is sent to client via service
                                    SendEnquiryDataService();
                                }

                                //get managers info
                                List<ManagerItem> staffMembers = null;
                                if (currentClub.InnerItem.Axes.SelectItems(String.Format("descendant-or-self::*[@@tid = '{0}']", ManagerItem.TemplateId)) != null)
                                {
                                    staffMembers = currentClub.InnerItem.Axes.SelectItems(String.Format("descendant-or-self::*[@@tid = '{0}']", ManagerItem.TemplateId)).ToList().ConvertAll(x => new ManagerItem(x));

                                    manager = staffMembers.First();
                                }

                                if (currentCampaign.CampaignBase.Sendconfirmationemail.Checked == true)
                                {
                                    //Data is sent to customer via email
                                    SendConfirmationEmail();
                                }

                                //imageStatic.Attributes.Add("style", "display:none;");
                                formToComplete.Attributes.Add("style", "display:none;");
                                pnlEnquiryPanel.Visible = false;
                                formCompleted.Visible = true;
                                formCompleted.Attributes.Add("style", "display:block;");
                                //ClearFormFields();
                                pnlForm.Update();
//.........这里部分代码省略.........
开发者ID:jon-mcmr,项目名称:Virgin-Tds,代码行数:101,代码来源:ModuleEnquiry.ascx.cs

示例7: btnSubmit_Click

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                bool blnIsValid = clubFindSelect.SelectedIndex != 0;

                if (blnIsValid == true)
                {
                    currentClub = (ClubItem)Sitecore.Context.Database.GetItem(clubFindSelect.SelectedValue);

                    if (currentClub != null)
                    {

                    //Store Feedback Entitiy Details
                    Feedback objFeedback = new Feedback();

                    //Store Customer Entitiy Details
                    Customer objCustomer = new Customer();

                    string FirstName = "";
                    string Surname = "";

                    if (yourname.Value.IndexOf(" ") != -1)
                    {
                        FirstName = yourname.Value.Substring(0, yourname.Value.IndexOf(" ")).Trim();
                        Surname = yourname.Value.Substring(yourname.Value.IndexOf(" ") + 1).Trim();
                    }
                    else
                    {
                        FirstName = yourname.Value.Trim();
                    }

                    objCustomer.EmailAddress = email.Value;
                    objCustomer.Firstname = FirstName;
                    objCustomer.Surname = Surname;
                    //objCustomer.HomeClubID = txtClubCode.Value;
                    objCustomer.HomeClubID = currentClub.ClubId.Rendered;
                    objCustomer.SubscribeToNewsletter = false;
                    objCustomer.TelephoneNumber = contact.Value;

                    objFeedback.Customer = objCustomer;
                    objFeedback.FeedbackSubject = campaign.CampaignBase.Campaigntype.Raw;
                    objFeedback.FeedbackSubjectDetail = campaign.CampaignBase.Campaignname.Rendered;
                    objFeedback.FeedbackTypeID = Convert.ToInt32(campaign.CampaignBase.CampaignId.Rendered);
                    objFeedback.PrimaryClubID = currentClub.ClubId.Rendered;
                    objFeedback.SubmissionDate = DateTime.Now;

                    string connection = Sitecore.Configuration.Settings.GetSetting("ConnectionString_VirginActiveReports");
                    DataAccessLayer dal = new DataAccessLayer(connection);
                    int successFlag = dal.SaveFeedback(Context.User.Identity.Name, campaign.DisplayName, objFeedback);

                    if (successFlag > 0)
                    {
                        //Data is sent to client via email
                        SendAdminEmail();

                        if (campaign.CampaignBase.Isweblead.Checked == true)
                        {
                            //Data is sent to client via service
                            SendEnquiryDataService();
                        }

                        //get managers info
                        List<ManagerItem> staffMembers = null;
                        if (currentClub.InnerItem.Axes.SelectItems(String.Format("descendant-or-self::*[@@tid = '{0}']", ManagerItem.TemplateId)) != null)
                        {
                            staffMembers = currentClub.InnerItem.Axes.SelectItems(String.Format("descendant-or-self::*[@@tid = '{0}']", ManagerItem.TemplateId)).ToList().ConvertAll(x => new ManagerItem(x));

                            manager = staffMembers.First();
                        }

                        if (campaign.CampaignBase.Sendconfirmationemail.Checked == true)
                        {
                            //Data is sent to customer via email
                            SendConfirmationEmail();
                        }

                        imageStatic.Attributes.Add("style", "display:none;");
                        innerForm.Attributes.Add("style", "display:none;");
                        formCompleted.Attributes.Add("style", "display:block;");

                        string classNames = article.Attributes["class"];
                        article.Attributes.Add("class", classNames.Length > 0 ? classNames + " ImageOverlay" : "ImageOverlay");
                        ClearFormFields();
                    }
                    else
                    {
                        imageStatic.Attributes.Add("style", "display:none;");
                        innerForm.Attributes.Add("style", "display:block;");
                        formCompleted.Attributes.Add("style", "display:none;");

                        string classNames = article.Attributes["class"];
                        article.Attributes.Add("class", classNames.Length > 0 ? classNames + " ImageOverlay" : "ImageOverlay");

                        Log.Error(String.Format("Error storing campaign details"), this);
                    }
                }
                else
                {
                    imageStatic.Attributes.Add("style", "display:none;");
//.........这里部分代码省略.........
开发者ID:jon-mcmr,项目名称:Virgin-Tds,代码行数:101,代码来源:ReferAFriend.ascx.cs

示例8: btnSubmit_Click


//.........这里部分代码省略.........
                            objComment.SortOrder = 3;
                            objComment.Subject = "Top Size";

                            objComments.Add(objComment);

                            objComment = new Comment();
                            objComment.CommentDetail = teamname.Value.Trim();
                            objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                            objComment.SortOrder = 4;
                            objComment.Subject = "Team Name";

                            objComments.Add(objComment);

                            objComment = new Comment();
                            objComment.CommentDetail = nextofkin.Value.Trim();
                            objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                            objComment.SortOrder = 5;
                            objComment.Subject = "Next Of Kin";

                            objComments.Add(objComment);

                            objComment = new Comment();
                            objComment.CommentDetail = nextofkinnumber.Value.Trim();
                            objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                            objComment.SortOrder = 6;
                            objComment.Subject = "Next Of Kin Contact No.";

                            objComments.Add(objComment);

                            objFeedback.Comments = objComments;

                            string connection = Sitecore.Configuration.Settings.GetSetting("ConnectionString_VirginActiveReports");
                            DataAccessLayer dal = new DataAccessLayer(connection);
                            int successFlag = dal.SaveFeedback(Context.User.Identity.Name, campaign.DisplayName, objFeedback);

                            if (successFlag > 0)
                            {

                                //get managers info
                                List<ManagerItem> staffMembers = null;
                                if (currentClub.InnerItem.Axes.SelectItems(String.Format("descendant-or-self::*[@@tid = '{0}']", ManagerItem.TemplateId)) != null)
                                {
                                    staffMembers = currentClub.InnerItem.Axes.SelectItems(String.Format("descendant-or-self::*[@@tid = '{0}']", ManagerItem.TemplateId)).ToList().ConvertAll(x => new ManagerItem(x));

                                    manager = staffMembers.First();
                                }

                                if (campaign.CampaignBase.Sendconfirmationemail.Checked == true)
                                {
                                    //Data is sent to customer via email
                                    SendConfirmationEmail();
                                }

                                pnlForm.Attributes.Add("style", "display:none;");
                                pnlThanks.Attributes.Add("style", "display:block;");

                                string classNames = wrapper.Attributes["class"];
                                wrapper.Attributes.Add("class", "wrapper-thanks");
                                //ClearFormFields();
                            }
                            else
                            {
                                pnlForm.Attributes.Add("style", "display:block;");
                                pnlThanks.Attributes.Add("style", "display:none;");

                                //string classNames = article.Attributes["class"];
开发者ID:jon-mcmr,项目名称:Virgin-Tds,代码行数:67,代码来源:LondonTriathlon.ascx.cs

示例9: btnSubmit_Click


//.........这里部分代码省略.........
                    {
                        FirstName = yourname.Value.Trim();
                    }

                    objCustomer.Firstname = FirstName;
                    objCustomer.Surname = Surname;
                    //objCustomer.HomeClubID = txtClubCode.Value;
                    objCustomer.HomeClubID = clubID;
                    objCustomer.SubscribeToNewsletter = subscribe.Checked;
                    objCustomer.TelephoneNumber = contact.Value;

                    objFeedback.Customer = objCustomer;
                    objFeedback.FeedbackSubject = "Your Story";
                    objFeedback.FeedbackSubjectDetail = "Share Your Success";
                    objFeedback.FeedbackTypeID = Constants.FeedbackType.ShareYourSuccessCompetition;
                    //objFeedback.PrimaryClubID = txtClubCode.Value;
                    objFeedback.PrimaryClubID = ClubID;
                    objFeedback.SubmissionDate = DateTime.Now;

                    //Add Comment
                    Comment objComment = new Comment();

                    objComment.CommentDetail = story.Value;
                    objComment.CommentImageTypeID = Constants.CommentImageType.CompetitionAnswer;
                    objComment.SortOrder = 1;
                    objComment.Subject = "Your Story";

                    List<Comment> objComments = new List<Comment>();
                    objComments.Add(objComment);
                    objFeedback.Comments = objComments;

                    ////Add Image
                    if (objImage != null)
                    {
                        List<mm.virginactive.screportdal.Models.Image> objImages = new List<mm.virginactive.screportdal.Models.Image>();
                        objImages.Add(objImage);
                        objFeedback.Images = objImages;
                    }

                    string connection = Sitecore.Configuration.Settings.GetSetting("ConnectionString_VirginActiveReports");
                    DataAccessLayer dal = new DataAccessLayer(connection);
                    int successFlag = dal.SaveFeedback(Context.User.Identity.Name, campaign.DisplayName, objFeedback);

                    // Successfully deleted
                    if (successFlag > 0)
                    {

                        //Data is sent to client via email
                        SendAdminEmail();

                        imageCarousel.Attributes.Add("style", "display:none;");
                        innerstory.Attributes.Add("style", "display:none;");
                        innerform.Attributes.Add("style", "display:none;");
                        formSummary.Attributes.Add("style", "display:none;");
                        formCompleted.Attributes.Add("style", "display:block;");

                        string classNames = article.Attributes["class"];
                        article.Attributes.Add("class", classNames.Length > 0 ? classNames + " ImageOverlay" : "ImageOverlay");
                        ClearFormFields();
                    }
                    else
                    {
                        imageCarousel.Attributes.Add("style", "display:none;");
                        innerstory.Attributes.Add("style", "display:none;");
                        innerform.Attributes.Add("style", "display:none;");
                        formSummary.Attributes.Add("style", "display:block;");
                        formCompleted.Attributes.Add("style", "display:none;");

                        string classNames = article.Attributes["class"];
                        article.Attributes.Add("class", classNames.Length > 0 ? classNames + " ImageOverlay" : "ImageOverlay");

                        cvFormSubmission.IsValid = false;
                        cvFormSubmission.ErrorMessage = Translate.Text("Error uploading details");
                        Log.Error(String.Format("Error storing campaign details"), this);
                    }
                }
                else
                {
                    imageCarousel.Attributes.Add("style", "display:none;");
                    innerstory.Attributes.Add("style", "display:none;");
                    innerform.Attributes.Add("style", "display:block;");
                    formSummary.Attributes.Add("style", "display:none;");
                    formCompleted.Attributes.Add("style", "display:none;");

                    string classNames = article.Attributes["class"];
                    article.Attributes.Add("class", classNames.Length > 0 ? classNames + " ImageOverlay" : "ImageOverlay");

                    cvImageSubmission.IsValid = false;
                    cvImageSubmission.ErrorMessage = Translate.Text("File size limit 5Mb");
                    cvImageSubmission.Attributes.Add("style", "display:none;");

                }

            }
            catch (Exception ex)
            {
                Log.Error(String.Format("Error storing campaign details: {0}", ex.Message), this);
                mm.virginactive.common.EmailMessagingService.ErrorEmailNotification.SendMail(ex);
            }
        }
开发者ID:jon-mcmr,项目名称:Virgin-Tds,代码行数:101,代码来源:FeedbackCampaign.ascx.cs

示例10: SaveDataToReportDB


//.........这里部分代码省略.........
                if(txtDOBDay2.Value != "DD")
                {
                    objComment.CommentDetail = txtDOBDay2.Value.Trim() != "" ? txtDOBDay2.Value.Trim() + "/" + txtDOBMonth2.Value.Trim() + "/" + txtDOBYear2.Value.Trim() : "";
                }
                else
                {
                    objComment.CommentDetail = "";
                }
                objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                objComment.SortOrder = 10;
                objComment.Subject = "Team Member 2 Date of Birth";

                objComments.Add(objComment);

                objComment = new Comment();
                objComment.CommentDetail = radMale2.Checked ? "M" : radFemale2.Checked ? "F" : "";
                objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                objComment.SortOrder = 11;
                objComment.Subject = "Team Member 2 Gender";

                objComments.Add(objComment);

                objComment = new Comment();
                objComment.CommentDetail = txtFirstName3.Value.Trim();
                objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                objComment.SortOrder = 12;
                objComment.Subject = "Team Member 3 First Name";

                objComment = new Comment();
                objComment.CommentDetail = txtSurname3.Value.Trim();
                objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                objComment.SortOrder = 13;
                objComment.Subject = "Team Member 3 Surname";

                objComments.Add(objComment);

                objComment = new Comment();
                if (txtDOBDay3.Value != "DD")
                {
                    objComment.CommentDetail = txtDOBDay3.Value.Trim() != "" ? txtDOBDay3.Value.Trim() + "/" + txtDOBMonth3.Value.Trim() + "/" + txtDOBYear3.Value.Trim() : "";
                }
                else
                {
                    objComment.CommentDetail = "";
                }
                objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                objComment.SortOrder = 14;
                objComment.Subject = "Team Member 3 Date of Birth";

                objComments.Add(objComment);

                objComment = new Comment();
                objComment.CommentDetail = radMale3.Checked ? "M" : radFemale3.Checked ? "F" : "";
                objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                objComment.SortOrder = 15;
                objComment.Subject = "Team Member 3 Gender";

                objComments.Add(objComment);

                objComment = new Comment();
                objComment.CommentDetail = txtNOKFirstName.Value.Trim() + " " + txtNOKSurname.Value.Trim();
                objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                objComment.SortOrder = 16;
                objComment.Subject = "Next of Kin Name";

                objComments.Add(objComment);

                objComment = new Comment();
                objComment.CommentDetail = txtNOKRelationship.Value.Trim();
                objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                objComment.SortOrder = 17;
                objComment.Subject = "Next of Kin Relationship";

                objComments.Add(objComment);

                objComment = new Comment();
                objComment.CommentDetail = txtNOKPhoneNumber.Value.Trim();
                objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                objComment.SortOrder = 18;
                objComment.Subject = "Next of Kin Phone Number";

                objComments.Add(objComment);

                objFeedback.Comments = objComments;

                string connection = Sitecore.Configuration.Settings.GetSetting("ConnectionString_VirginActiveReports");
                DataAccessLayer dal = new DataAccessLayer(connection);
                if (dal.SaveFeedback(Context.User.Identity.Name, currentItem.DisplayName, objFeedback) > 0)
                {
                    blnDataSaved = true;
                }

            }
            catch (Exception ex)
            {
                Log.Error(String.Format("Error saving form data to reports db: {0}", ex.Message), this);
            }

            return blnDataSaved;
        }
开发者ID:jon-mcmr,项目名称:Virgin-Tds,代码行数:101,代码来源:IndoorRegistration.ascx.cs

示例11: btnSubmit_Click

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (clubFindSelect1.SelectedIndex != 0 && clubFindSelect2.SelectedIndex != 0)
                {
                    primaryClub = (ClubItem)Sitecore.Context.Database.GetItem(clubFindSelect1.SelectedValue);
                    secondaryClub = (ClubItem)Sitecore.Context.Database.GetItem(clubFindSelect2.SelectedValue);

                    if (primaryClub != null && secondaryClub != null)
                    {
                        //Store Feedback Entitiy Details
                        Feedback objFeedback = new Feedback();

                        //Store Customer (Referer's) Entitiy Details
                        Customer objCustomer = new Customer();

                        objCustomer.EmailAddress = email1.Value;
                        objCustomer.Firstname = firstName1.Value;
                        objCustomer.Surname = surname1.Value;
                        objCustomer.HomeClubID = primaryClub.ClubId.Rendered;
                        objCustomer.SubscribeToNewsletter = subscribe.Checked;
                        objCustomer.TelephoneNumber = number1.Value.Trim();
                        objCustomer.MembershipNumber = memberNo.Value.Trim();

                        objFeedback.Customer = objCustomer;
                        objFeedback.FeedbackSubject = campaign.CampaignBase.Campaigntype.Raw;
                        objFeedback.FeedbackSubjectDetail = campaign.CampaignBase.Campaignname.Rendered;
                        objFeedback.FeedbackTypeID = Convert.ToInt32(campaign.CampaignBase.CampaignId.Rendered);
                        objFeedback.PrimaryClubID = primaryClub.ClubId.Rendered;
                        objFeedback.SubmissionDate = DateTime.Now;

                        //Store Referee's Details
                        List<Comment> objComments = new List<Comment>();
                        //Add Comment
                        Comment objComment = new Comment();
                        objComment.CommentDetail = secondaryClub.ClubId.Rendered;
                        objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                        objComment.SortOrder = 1;
                        objComment.Subject = "Friend's Preferred Club";

                        objComments.Add(objComment);

                        objComment = new Comment();
                        objComment.CommentDetail = firstName2.Value.Trim();
                        objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                        objComment.SortOrder = 2;
                        objComment.Subject = "Friend's First Name";

                        objComments.Add(objComment);

                        objComment = new Comment();
                        objComment.CommentDetail = surname2.Value.Trim();
                        objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                        objComment.SortOrder = 3;
                        objComment.Subject = "Friend's Surname";

                        objComments.Add(objComment);

                        objComment = new Comment();
                        objComment.CommentDetail = email2.Value.Trim();
                        objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                        objComment.SortOrder = 4;
                        objComment.Subject = "Friend's Email";

                        objComments.Add(objComment);

                        objComment = new Comment();
                        objComment.CommentDetail = number2.Value.Trim();
                        objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                        objComment.SortOrder = 5;
                        objComment.Subject = "Friend's Number";

                        objComments.Add(objComment);

                        objComment = new Comment();
                        objComment.CommentDetail = permission.Checked == true? "Y" : "N" ;
                        objComment.CommentImageTypeID = Constants.CommentImageType.QuestionnaireAnswer;
                        objComment.SortOrder = 6;
                        objComment.Subject = "Permission to be contacted";

                        objComments.Add(objComment);

                        objFeedback.Comments = objComments;

                        string connection = Sitecore.Configuration.Settings.GetSetting("ConnectionString_VirginActiveReports");
                        DataAccessLayer dal = new DataAccessLayer(connection);
                        int successFlag = dal.SaveFeedback(Context.User.Identity.Name, campaign.DisplayName, objFeedback);

                        if (successFlag > 0)
                        {

                            //Data is sent to client via email
                            SendAdminEmail();

                            if (campaign.CampaignBase.Isweblead.Checked == true)
                            {
                                //Data is sent to client via service
                                SendEnquiryDataService();
                            }
//.........这里部分代码省略.........
开发者ID:jon-mcmr,项目名称:Virgin-Tds,代码行数:101,代码来源:ReferAFriendII.ascx.cs

示例12: btnSubmit_Click

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (Page.IsValid == true)
                {
                    //check if we have a valid club selected
                    Boolean blnClubSuccessfullySelected = clubFindSelect.SelectedIndex != 0;

                    currentClub = (ClubItem)Sitecore.Context.Database.GetItem(clubFindSelect.SelectedValue);

                    if (currentClub != null)
                    {
                        //Store Feedback Entitiy Details
                        Feedback objFeedback = new Feedback();

                        //Store Customer Entitiy Details
                        Customer objCustomer = new Customer();

                        string FirstName = "";
                        string Surname = "";

                        if (txtName.Value.IndexOf(" ") != -1)
                        {
                            FirstName = txtName.Value.Substring(0, txtName.Value.IndexOf(" ")).Trim();
                            Surname = txtName.Value.Substring(txtName.Value.IndexOf(" ") + 1).Trim();
                        }
                        else
                        {
                            FirstName = txtName.Value.Trim();
                        }

                        objCustomer.EmailAddress = txtEmail.Value;
                        objCustomer.Firstname = FirstName;
                        objCustomer.Surname = Surname;
                        //objCustomer.HomeClubID = txtClubCode.Value;
                        objCustomer.HomeClubID = currentClub.ClubId.Rendered;
                        objCustomer.SubscribeToNewsletter = chkSubscribe.Checked;
                        objCustomer.TelephoneNumber = txtPhone.Value;

                        objFeedback.Customer = objCustomer;
                        //objFeedback.FeedbackSubject = campaign.CampaignBase.Campaigntype.Raw;
                        objFeedback.FeedbackSubject = !String.IsNullOrEmpty(campaign.CampaignBase.Campaigntype.Raw) ? campaign.CampaignBase.Campaigntype.Raw : "";
                        objFeedback.FeedbackSubjectDetail = campaign.CampaignBase.Campaignname.Rendered;
                        objFeedback.FeedbackTypeID = Convert.ToInt32(campaign.CampaignBase.CampaignId.Rendered);
                        objFeedback.PrimaryClubID = currentClub.ClubId.Rendered;
                        objFeedback.SubmissionDate = DateTime.Now;

                        //Save to session (required for confirmation page)
                        Session["sess_FormSubmission"] = objFeedback;

                        string connection = Sitecore.Configuration.Settings.GetSetting("ConnectionString_VirginActiveReports");
                        DataAccessLayer dal = new DataAccessLayer(connection);
                        int successFlag = dal.SaveFeedback(Context.User.Identity.Name, campaign.DisplayName, objFeedback);

                        if (successFlag > 0)
                        {
                            //Data is sent to client via email
                            SendAdminEmail();

                            if (campaign.CampaignBase.Isweblead.Checked == true)
                            {
                                //Data is sent to client via service
                                SendEnquiryDataService();
                            }

                            //get managers info
                            List<ManagerItem> staffMembers = null;
                            if (currentClub.InnerItem.Axes.SelectItems(String.Format("descendant-or-self::*[@@tid = '{0}']", ManagerItem.TemplateId)) != null)
                            {
                                staffMembers = currentClub.InnerItem.Axes.SelectItems(String.Format("descendant-or-self::*[@@tid = '{0}']", ManagerItem.TemplateId)).ToList().ConvertAll(x => new ManagerItem(x));

                                manager = staffMembers.First();
                            }

                            if (campaign.CampaignBase.Sendconfirmationemail.Checked == true)
                            {
                                //Data is sent to customer via email
                                SendConfirmationEmail();
                            }

                            //Get enquiries link
                            string ClubEnquiriesUrl = "";
                            PageSummaryItem enqForm = new PageSummaryItem(Sitecore.Context.Database.GetItem(ItemPaths.EnquiryForm));
                            if (enqForm != null)
                            {
                                ClubEnquiriesUrl = enqForm.Url;
                            }

                            Response.Redirect(ClubEnquiriesUrl + "?action=confirm");
                        }
                        else
                        {
                            Log.Error(String.Format("Error submitting campaign form (mobile) -save to db"), this);
                        }
                    }
                    else
                    {
                        Log.Error(String.Format("Error submitting campaign form (mobile) -setting current club"), this);
                    }
//.........这里部分代码省略.........
开发者ID:jon-mcmr,项目名称:Virgin-Tds,代码行数:101,代码来源:MobileStaticCampaign.ascx.cs


注:本文中的DataAccessLayer.SaveFeedback方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。