示例#1
0
        public CategoryTemplate SaveInfo()
        {
            CategoryTemplate categoryTemplate = this.TemplateService.GetCategoryTemplateById(this.CategoryTemplateId);

            if (categoryTemplate != null)
            {
                categoryTemplate.Name         = txtName.Text;
                categoryTemplate.TemplatePath = txtTemplatePath.Text;
                categoryTemplate.DisplayOrder = txtDisplayOrder.Value;
                categoryTemplate.UpdatedOn    = DateTime.UtcNow;
                this.TemplateService.UpdateCategoryTemplate(categoryTemplate);
            }
            else
            {
                DateTime now = DateTime.UtcNow;
                categoryTemplate = new CategoryTemplate()
                {
                    Name         = txtName.Text,
                    TemplatePath = txtTemplatePath.Text,
                    DisplayOrder = txtDisplayOrder.Value,
                    CreatedOn    = now,
                    UpdatedOn    = now
                };
                this.TemplateService.InsertCategoryTemplate(categoryTemplate);
            }

            return(categoryTemplate);
        }
        public string GetAllcategorySubcategoryJson(string sid, string nwid)
        {
            string           data = "";
            CategoryTemplate obj  = new CategoryTemplate();

            data = obj.GetAllCategorriesSubcategoriesJson(sid, nwid);
            return(data);
        }
        public string CategoryDescription(string sid, string nwid, string cid)
        {
            string           data = "";
            CategoryTemplate obj  = new CategoryTemplate();

            data = obj.CategoryDescription(sid, nwid, cid);
            return(data);
        }
        public string GetSubcatJson(string sid, string nwid, string catalias, string cid)
        {
            string           data = "";
            CategoryTemplate obj  = new CategoryTemplate();

            data = obj.GetSubcatJson(sid, nwid, catalias, cid);
            return(data);
        }
        public string GetQuicklink(string sid, string nwid, string cid)
        {
            string           data = "";
            CategoryTemplate obj  = new CategoryTemplate();

            data = obj.CategoryQuickLink(sid, nwid, cid);
            return(data);
        }
        public string GetStreamdata(string site_id, string nwid)
        {
            string           data = "";
            CategoryTemplate obj  = new CategoryTemplate();

            data = obj.GetStreamJson(site_id, nwid);
            return(data);
        }
示例#7
0
        /// <summary>
        /// Updates the category template
        /// </summary>
        /// <param name="categoryTemplate">Category template</param>
        public virtual void UpdateCategoryTemplate(CategoryTemplate categoryTemplate)
        {
            if (categoryTemplate == null)
            {
                throw new ArgumentNullException(nameof(categoryTemplate));
            }

            _categoryTemplateRepository.Update(categoryTemplate);
        }
        public virtual void InsertCategoryTemplate(CategoryTemplate categoryTemplate)
        {
            if (categoryTemplate == null)
            {
                throw new ArgumentNullException("categoryTemplate");
            }

            _categoryTemplateRepository.Insert(categoryTemplate);
        }
示例#9
0
        /// <summary>
        /// Delete category template
        /// </summary>
        /// <param name="categoryTemplate">Category template</param>
        public virtual void DeleteCategoryTemplate(CategoryTemplate categoryTemplate)
        {
            if (categoryTemplate == null)
            {
                throw new ArgumentNullException("categoryTemplate");
            }

            _categoryTemplateRepository.Delete(categoryTemplate);
            //_unitOfWork.Commit();
        }
示例#10
0
        public virtual IActionResult CategoryTemplateDelete(int id)
        {
            //try to get a category template with the specified id
            CategoryTemplate template = _categoryTemplateService.GetCategoryTemplateById(id)
                                        ?? throw new ArgumentException("No template found with the specified id");

            _categoryTemplateService.DeleteCategoryTemplate(template);

            return(new NullJsonResult());
        }
示例#11
0
        /// <summary>
        /// Delete category template
        /// </summary>
        /// <param name="categoryTemplate">Category template</param>
        public virtual void DeleteCategoryTemplate(CategoryTemplate categoryTemplate)
        {
            if (categoryTemplate == null)
            {
                throw new ArgumentNullException(nameof(categoryTemplate));
            }

            _categoryTemplateRepository.Delete(categoryTemplate);

            //event notification
            _eventPublisher.EntityDeleted(categoryTemplate);
        }
        /// <summary>
        /// Delete category template
        /// </summary>
        /// <param name="categoryTemplate">Category template</param>
        public virtual async Task DeleteCategoryTemplate(CategoryTemplate categoryTemplate)
        {
            if (categoryTemplate == null)
            {
                throw new ArgumentNullException("categoryTemplate");
            }

            await _categoryTemplateRepository.DeleteAsync(categoryTemplate);

            //event notification
            await _eventPublisher.EntityDeleted(categoryTemplate);
        }
        /// <summary>
        /// Inserts category template
        /// </summary>
        /// <param name="categoryTemplate">Category template</param>
        public virtual async Task InsertCategoryTemplate(CategoryTemplate categoryTemplate)
        {
            if (categoryTemplate == null)
            {
                throw new ArgumentNullException("categoryTemplate");
            }

            await _categoryTemplateRepository.InsertAsync(categoryTemplate);

            //event notification
            await _mediator.EntityInserted(categoryTemplate);
        }
示例#14
0
        /// <summary>
        /// Inserts category template
        /// </summary>
        /// <param name="categoryTemplate">Category template</param>
        public virtual void InsertCategoryTemplate(CategoryTemplate categoryTemplate)
        {
            if (categoryTemplate == null)
            {
                throw new ArgumentNullException("categoryTemplate");
            }

            _categoryTemplateRepository.Insert(categoryTemplate);

            //event notification
            _eventPublisher.EntityInserted(categoryTemplate);
        }
        public string Getsitesportandcasino(string site_id, string nwid)
        {
            string           data = "";
            CategoryTemplate obj  = new CategoryTemplate();

            data = obj.Getsitesportandcasino(site_id, nwid);
            if (string.IsNullOrEmpty(data))
            {
                data = "[]";
            }
            return(data);
        }
        public string GetAllTicketSportsJson()
        {
            string           data = "";
            CategoryTemplate obj  = new CategoryTemplate();

            data = obj.GetallTicketsports();
            if (string.IsNullOrEmpty(data))
            {
                data = "[]";
            }
            return(data);
        }
示例#17
0
        /// <summary>
        /// Delete category template
        /// </summary>
        /// <param name="categoryTemplate">Category template</param>
        public virtual void DeleteCategoryTemplate(CategoryTemplate categoryTemplate)
        {
            if (categoryTemplate == null)
            {
                throw new ArgumentNullException("categoryTemplate");
            }

            _categoryTemplateRepository.Delete(categoryTemplate);

            _cacheManager.RemoveByPattern(CATEGORYTEMPLATES_PATTERN_KEY);

            //event notification
            _eventPublisher.EntityDeleted(categoryTemplate);
        }
示例#18
0
 protected void SaveButton_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         try
         {
             CategoryTemplate categoryTemplate = Save();
             Response.Redirect("CategoryTemplates.aspx");
         }
         catch (Exception exc)
         {
             ProcessException(exc);
         }
     }
 }
示例#19
0
 protected void SaveAndStayButton_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         try
         {
             CategoryTemplate categoryTemplate = Save();
             Response.Redirect("CategoryTemplateDetails.aspx?CategoryTemplateID=" + categoryTemplate.CategoryTemplateId.ToString());
         }
         catch (Exception exc)
         {
             ProcessException(exc);
         }
     }
 }
示例#20
0
        public void GetBonusdata()
        {
            string bonusparent = "", bonusorder = "";
            string siteid = "", order = "", bonusfor = "", constr = "";
            string data = "";

            try
            {
                siteid = Request.Form["siteid"];
            }
            catch (Exception ex)
            {
            }
            try
            {
                order = Request.Form["order"];
            }
            catch (Exception ex)
            {
            }
            try
            {
                bonusfor = Request.Form["bonusfor"];
            }
            catch (Exception ex)
            {
            }

            try
            {
                constr = Request.Form["networkid"];
            }
            catch (Exception ex)
            {
            }

            try
            {
                CategoryTemplate obj = new CategoryTemplate();
                data = obj.GetBonusJson(siteid, order, bonusfor, constr);
                obj  = null;
            }
            catch (Exception ex)
            {
                data = "[]";
            }
            ltresult.Text = data;
        }
        public void Can_save_and_load_categoryTemplate()
        {
            var categoryTemplate = new CategoryTemplate()
            {
                Name         = "Name 1",
                ViewPath     = "ViewPath 1",
                DisplayOrder = 1,
            };

            var fromDb = SaveAndLoadEntity(categoryTemplate);

            fromDb.ShouldNotBeNull();
            fromDb.Name.ShouldEqual("Name 1");
            fromDb.ViewPath.ShouldEqual("ViewPath 1");
            fromDb.DisplayOrder.ShouldEqual(1);
        }
示例#22
0
        public virtual IActionResult CategoryTemplateAdd(CategoryTemplateModel model)
        {
            if (!ModelState.IsValid)
            {
                return(Json(new DataSourceResult {
                    Errors = ModelState.SerializeErrors()
                }));
            }

            CategoryTemplate template = new CategoryTemplate();

            template = model.ToEntity(template);
            _categoryTemplateService.InsertCategoryTemplate(template);

            return(new NullJsonResult());
        }
示例#23
0
        private void CreateChildControlsTree()
        {
            category = CategoryManager.GetCategoryById(this.CategoryId);
            if (category != null)
            {
                Control child = null;

                CategoryTemplate categoryTemplate = category.CategoryTemplate;
                if (categoryTemplate == null)
                {
                    throw new NopException(string.Format("Category template path can not be empty. CategoryID={0}", category.CategoryId));
                }

                child = base.LoadControl(categoryTemplate.TemplatePath);
                this.CategoryPlaceHolder.Controls.Add(child);
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (Request.QueryString["catname"] != null && Request.QueryString["siteid"] != null && Request.QueryString["networkid"] != null && Request.QueryString["catid"] != null)
         {
             if (Request.QueryString["userid"] != null)
             {
                 userid = Request.QueryString["userid"];
             }
             networkid          = Request.QueryString["networkid"];
             Session["SITE_NW"] = Request.QueryString["networkid"];
             siteid             = Request.QueryString["siteid"];
             catalias           = Request.QueryString["catname"];
             catid            = Request.QueryString["catid"];
             Strlinks         = GetLink(siteid, networkid);
             catjson          = GetSubcatJson(siteid, networkid, catalias, catid);
             quicklink        = GetQuicklink(siteid, networkid, catid);
             catdesc          = CategoryDescription(siteid, networkid, catid);
             allcatsubcatjson = GetAllcategorySubcategoryJson(siteid, networkid);
             StreamData       = GetStreamdata(siteid, networkid);
             SportAndCasino   = Getsitesportandcasino(siteid, networkid);
             centraltableurl  = string.Format("http://admin.writersllc.com/posttableindesc.aspx?siteid={0}&networkid={1}&userid={2}&temp=1", siteid, networkid, userid);
             if (!Page.IsPostBack)
             {
                 SetTemplateData();
             }
             else
             {
                 CategoryTemplate obj = new CategoryTemplate();
                 result = obj.SaveTemplate(catid, siteid, networkid, Request.Form["hddata"]);
                 if (result == "saved")
                 {
                     Page.RegisterStartupScript("onsave", "<script>closePOP();</script>");
                 }
             }
             Allsports      = GetAllSportsJson();
             AllTicketSport = GetAllTicketSportsJson();
         }
     }
     catch (Exception ex)
     {
         CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.Client, "CategoryTemaplate", ex);
     }
 }
示例#25
0
        public virtual IActionResult CategoryTemplateUpdate(CategoryTemplateModel model)
        {
            if (!ModelState.IsValid)
            {
                return(Json(new DataSourceResult {
                    Errors = ModelState.SerializeErrors()
                }));
            }

            //try to get a category template with the specified id
            CategoryTemplate template = _categoryTemplateService.GetCategoryTemplateById(model.Id)
                                        ?? throw new ArgumentException("No template found with the specified id");

            template = model.ToEntity(template);
            _categoryTemplateService.UpdateCategoryTemplate(template);

            return(new NullJsonResult());
        }
示例#26
0
        public async Task <IActionResult> CategoryTemplateAdd(CategoryTemplateModel model)
        {
            if (!ModelState.IsValid)
            {
                return(Json(new DataSourceResult {
                    Errors = ModelState.SerializeErrors()
                }));
            }
            if (ModelState.IsValid)
            {
                var template = new CategoryTemplate();
                template = model.ToEntity(template);
                await _categoryTemplateService.InsertCategoryTemplate(template);

                return(new NullJsonResult());
            }
            return(ErrorForKendoGridJson(ModelState));
        }
        public CategoryTemplate SaveInfo()
        {
            CategoryTemplate categoryTemplate = TemplateManager.GetCategoryTemplateById(this.CategoryTemplateId);

            if (categoryTemplate != null)
            {
                categoryTemplate = TemplateManager.UpdateCategoryTemplate(categoryTemplate.CategoryTemplateId, txtName.Text,
                                                                          txtTemplatePath.Text, txtDisplayOrder.Value, categoryTemplate.CreatedOn, DateTime.Now);
            }
            else
            {
                DateTime now = DateTime.Now;
                categoryTemplate = TemplateManager.InsertCategoryTemplate(txtName.Text,
                                                                          txtTemplatePath.Text, txtDisplayOrder.Value, now, now);
            }

            return(categoryTemplate);
        }
示例#28
0
        public virtual IActionResult CategoryTemplateAdd(CategoryTemplateModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageMaintenance))
            {
                return(AccessDeniedView());
            }

            if (!ModelState.IsValid)
            {
                return(ErrorJson(ModelState.SerializeErrors()));
            }

            var template = new CategoryTemplate();

            template = model.ToEntity(template);
            _categoryTemplateService.InsertCategoryTemplate(template);

            return(Json(new { Result = true }));
        }
        void FillCategories(CategoryTree category, Guid parentId)
        {
            var dbCategory = new CategoryTemplate
            {
                BoardId      = Uid,
                Name         = category.Name,
                HasRemoved   = false,
                LastChangeId = null,
                ParentId     = parentId
            };

            DCT.Context.Db1.CategoryTemplates.Add(dbCategory);
            DCT.Context.Db1.SaveChanges();

            foreach (var c in category.Children)
            {
                FillCategories(c, dbCategory.Id);
            }
        }
        private void BindData()
        {
            CategoryTemplate categoryTemplate = TemplateManager.GetCategoryTemplateById(this.CategoryTemplateId);

            if (categoryTemplate != null)
            {
                this.txtName.Text          = categoryTemplate.Name;
                this.txtTemplatePath.Text  = categoryTemplate.TemplatePath;
                this.txtDisplayOrder.Value = categoryTemplate.DisplayOrder;
                this.pnlCreatedOn.Visible  = true;
                this.pnlUpdatedOn.Visible  = true;
                this.lblCreatedOn.Text     = DateTimeHelper.ConvertToUserTime(categoryTemplate.CreatedOn).ToString();
                this.lblUpdatedOn.Text     = DateTimeHelper.ConvertToUserTime(categoryTemplate.UpdatedOn).ToString();
            }
            else
            {
                this.pnlCreatedOn.Visible = false;
                this.pnlUpdatedOn.Visible = false;
            }
        }