Пример #1
0
 public void CloneSection(List <dtoCallSection <dtoCallField> > sections, long idSection)
 {
     if (UserContext.isAnonymous)
     {
         View.DisplaySessionTimeout();
     }
     else
     {
         CallForPaperType type        = View.CallType;
         long             idCall      = View.IdCall;
         Int32            idCommunity = View.IdCommunity;
         FieldsSection    section     = CallService.CloneSection(idCall, sections, idSection);
         if (section == null)
         {
             View.DisplayError(EditorErrors.CloningSection);
         }
         else
         {
             if (View.CallType == CallForPaperType.CallForBids)
             {
                 View.SendUserAction(idCommunity, View.IdCallModule, idCall, ModuleCallForPaper.ActionType.AddSectionToCall);
             }
             else
             {
                 View.SendUserAction(idCommunity, View.IdCallModule, idCall, ModuleRequestForMembership.ActionType.AddSectionToRequest);
             }
             View.ReloadEditor(RootObject.CallSubmissionEditorSectionAdded(section.Id, type, idCall, idCommunity, View.PreloadView));
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            var modelGenerator = new FieldsSection <User>();

            modelGenerator.CreateForm();
            dynamicPlaceHolder.Controls.Add(modelGenerator);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            var modelGenerator = new FieldsSection <User>();

            modelGenerator.CreateForm();
            var user = new User()
            {
                FirstName = "Erich", LastName = "Gamma", Role = Role.Administrator, IsMale = true
            };

            modelGenerator.FillControls(user);
            dynamicPlaceHolder.Controls.Add(modelGenerator);
        }
        public void TestFieldsSection()
        {
            FieldsSection section = FieldsSection.GetInstance();

            Assert.IsNotNull(section);
            Assert.AreEqual(@"uid", section.RecordId);
            Assert.AreEqual(@"ArticleNumber", section.ProductNumber);
            Assert.AreEqual(@"MasterProductNumber", section.MasterProductNumber);
            Assert.AreEqual(@"EAN", section.Ean);
            Assert.AreEqual(@"Name", section.ProductName);
            Assert.AreEqual(@"Brand", section.Brand);
            Assert.AreEqual(@"Description", section.Description);
            Assert.AreEqual(@"Price", section.Price);
            Assert.AreEqual(@"ImageURL", section.ImageUrl);
            Assert.AreEqual(@"ProductURL", section.Deeplink);
        }
Пример #5
0
        private void LoadSections(BaseForPaper call)
        {
            View.LoadSubmitterTypes(CallService.GetCallAvailableSubmittersType(call));
            List <dtoCallSection <dtoCallField> > sections = CallService.GetEditorSections(call);
            List <lm.Comol.Core.Wizard.NavigableWizardItem <WizardCallStep> > steps = RequestService.GetAvailableSteps(call.Id, WizardCallStep.SubmissionEditor, call.Type);

            //View.InitializeAddFieldControl(call.Id);
            if (sections == null || sections.Count == 0)
            {
                if (!CallService.isNewCall(call))
                {
                    View.DisplayError(EditorErrors.NoSections);
                }
                else
                {
                    FieldsSection section = CallService.AddSection(call, View.DefaultSectionName, View.DefaultSectionDescription);
                    if (section != null)
                    {
                        sections = new List <dtoCallSection <dtoCallField> >();
                        sections.Add(new dtoCallSection <dtoCallField>()
                        {
                            Id = section.Id, Description = section.Description, DisplayOrder = section.DisplayOrder, Name = section.Name
                        });
                        View.LoadSections(sections);
                    }
                }
                View.LoadWizardSteps(call.Id, call.Type, View.IdCommunity, steps);
            }
            else
            {
                View.LoadWizardSteps(call.Id, call.Type, View.IdCommunity, steps);
                View.LoadSections(sections);
            }


            if (steps.Where(s => s.Id == WizardCallStep.SubmittersType && (s.Status == Core.Wizard.WizardItemStatus.valid || s.Status == Core.Wizard.WizardItemStatus.warning)).Any())
            {
                View.SetActionUrl(CallStandardAction.PreviewCall, RootObject.PreviewCall(call.Type, call.Id, View.IdCommunity, View.PreloadView));
            }
        }
        public string CreateJavaScriptClickCode(Record record, string sid = null)
        {
            if (String.IsNullOrEmpty(sid))
            {
                sid = HttpContextFactory.Current.Session.SessionID;
            }

            string query = FFParameters.Query.Replace(@"'", @"\'");

            int position = record.Position;

            string clickCode = "";

            if (position != 0 && query != "")
            {
                string channel = FFParameters.Channel;

                int    currentPageNumber = SearchAdapter.Paging.CurrentPage;
                string originalPageSize  = SearchAdapter.ProductsPerPageOptions.DefaultOption.Label;

                int originalPosition = record.OriginalPosition;
                if (originalPosition == 0)
                {
                    originalPosition = position;
                }

                string campaign   = record.Campaign;
                bool   instoreAds = record.InstoreAds;

                string id       = record.ID;
                string masterId = (string)record.GetFieldValue(FieldsSection.GetInstance().MasterProductNumber);

                sid = Regex.Replace(sid, "['\"\\\0]", @"\$&");

                clickCode = String.Format("tracking.click('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}', '{9}', '{10}');",
                                          channel, sid, id, masterId, query, position, originalPosition, currentPageNumber, originalPageSize, campaign, instoreAds);
            }

            return(clickCode);
        }