예제 #1
0
        public static int GetLandingPageId(string value)
        {
            if (_LandingPages.IsNullOrEmpty())
            {
                _LandingPages = CatalogRepository.GetAll <LandingPageInfo>();
            }
            var entity = _LandingPages.FirstOrDefault(c => c.Name.Equals(value, StringComparison.CurrentCultureIgnoreCase));

            if (entity == null)
            {
                entity = new LandingPageInfo {
                    Name = value
                };
                entity.Id = CatalogRepository.Create(entity);
                _LandingPages.Add(entity);
            }
            return(entity.Id);
        }
예제 #2
0
파일: LandingPage.cs 프로젝트: HungNV88/CRM
        public string Edit(FormDataCollection form)
        {
            var retVal    = string.Empty;
            var operation = form.Get("oper");
            var id        = form.Get("Id").Split(',')[0].ToInt32();

            if (string.IsNullOrEmpty(operation))
            {
                return(retVal);
            }

            LandingPageInfo info;

            switch (operation)
            {
            case "edit":
                info = CatalogRepository.GetInfo <LandingPageInfo>(id);
                if (info != null)
                {
                    info.Name = form.Get("Name");
                    CatalogRepository.Update(info);
                }
                break;

            case "add":
                info = new LandingPageInfo {
                    Name = form.Get("Name")
                };
                CatalogRepository.Create(info);
                break;

            case "del":
                CatalogRepository.Delete <LandingPageInfo>(id);
                break;
            }
            StoreData.ReloadData <LandingPageInfo>();
            return(retVal);
        }
 public LandingPageInfoC(LandingPageInfo info)
 {
     count  = info.Count;
     fields = Common.NewStructArray <LandingPageInfoField, LandingPageInfoField>(info.fields, (i, x) => x);
 }
예제 #4
0
 /// <summary>
 /// Updates the information displayed on the user's party invite landing page.
 ///
 /// Only updates from the party leader will cause an immediate change in the information shown on the landing page. However, updates by other users will still be stored and used later to update the landing page if a new user becomes the party leader.
 /// </summary>
 /// <param name="info">Refer to the [PartyKit documentation](https://docs.trail.gg/docs/rich-landing-page) to see how to use this parameter to control different parts of the landing page.</param>
 public static Result UpdateInviteLandingPageInfo(LandingPageInfo info)
 {
     return(trail_ptk_update_invite_landing_page_info(SDK.Raw, info.CBinding));
 }