示例#1
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            SolutionCategoryBll scbll = new SolutionCategoryBll();
            int scenceId = int.Parse(lblSenceId.Text);
            int cateId   = int.Parse(lblCateId.Text);
            SolutionCategoryModel scmodel = scbll.GetModel(scenceId, cateId);

            if (scmodel == null)
            {
                scmodel         = new SolutionCategoryModel();
                scmodel.CateId  = cateId;
                scmodel.SenceId = scenceId;
            }
            scmodel.IsShow   = chkIsShow.Checked;
            scmodel.Remark   = txtRemark.Text.Trim();
            scmodel.Position = txtPosition.Text.Trim();
            string fullurl, shorturl, message;

            if (CommonImageUpload.Upload(this.fulImage, out fullurl, out shorturl, out message))
            {
                scmodel.CateImage = shorturl;
            }

            scbll.Save(scmodel);
            SaveCateConditions();
            Response.Redirect("ShowClassicalScence.aspx?id=" + scenceId, true);
        }
示例#2
0
        private void ShowInfo(int scenceId, int cateId)
        {
            SolutionCategoryBll   scbll   = new SolutionCategoryBll();
            SolutionCategoryModel scmodel = scbll.GetModel(scenceId, cateId);
            CategoryModelBll      cbll    = new CategoryModelBll();
            CategoryModel         cmodel  = cbll.GetModel(cateId);

            if (cmodel == null)
            {
                throw new NoName.NetShop.Common.ShopException("分类不存在", true);
            }

            InitConditionItems(cateId);

            if (scmodel != null)
            {
                lblCateId.Text    = scmodel.CateId.ToString();
                lblSenceId.Text   = scmodel.SenceId.ToString();
                chkIsShow.Checked = scmodel.IsShow;
                txtRemark.Text    = scmodel.Remark;
                txtPosition.Text  = scmodel.Position;

                if (!String.IsNullOrEmpty(scmodel.CateImage))
                {
                    this.imgCate.Visible  = true;
                    this.imgCate.ImageUrl = Common.CommonImageUpload.GetCommonImageFullUrl(scmodel.CateImage);
                }
                else
                {
                    this.imgCate.Visible = false;
                }
                PresetConditionItems(scenceId, cateId);
            }
            else
            {
                lblCateId.Text  = cmodel.CateId.ToString();
                lblSenceId.Text = scenceId.ToString();
                txtRemark.Text  = cmodel.CateName;
            }
        }