コード例 #1
0
 /// <summary>
 /// 修改优先级
 /// </summary>
 /// <param name="id"></param>
 /// <param name="sort"></param>
 private void SetLeavel(int id, int sitelevel)
 {
     YXShop.BLL.Accessories.Hailhellowlink bll = new YXShop.BLL.Accessories.Hailhellowlink();
     bll.Amend(id, "sitelevel", sitelevel);
     Response.Write("ok");
 }
コード例 #2
0
        /// <summary>
        /// 保存
        /// </summary>
        protected void Save()
        {
            YXShop.BLL.Accessories.Hailhellowlink   bll   = new YXShop.BLL.Accessories.Hailhellowlink();
            YXShop.Model.Accessories.Hailhellowlink model = new YXShop.Model.Accessories.Hailhellowlink();
            SOSOshop.BLL.SysParameter sp = new SOSOshop.BLL.SysParameter();
            model.SiteName = this.txtSiteName.Text.Trim();
            model.SiteUrl  = this.txtSiteUrl.Text.Trim();
            if (this.txtSiteLogo.Text.Trim() != null && this.txtSiteLogo.Text.Trim() != "" && !this.fuSmallImages.HasFile)
            {
                model.SiteLogo = this.txtSiteLogo.Text.Trim();
            }
            else
            {
                //获取图片
                ChangeHope.Common.UploadFile uf = new ChangeHope.Common.UploadFile();
                uf.ExtensionLim  = ".gif,.jpg,.jpeg,.dmp";
                uf.FileLengthLim = sp.ImageSize;
                uf.PostedFile    = this.fuSmallImages;
                uf.SavePath      = "/yxuploadfile/brand";
                if (uf.Upload())
                {
                    if (uf.HaveLoad)
                    {
                        model.SiteLogo = uf.FilePath;
                    }
                    else
                    {
                        if (ViewState["SiteImages"] != null)
                        {
                            model.SiteLogo = ViewState["SiteImages"].ToString();
                        }
                        else
                        {
                            model.SiteLogo = string.Empty;
                        }
                    }
                }
                else
                {
                    this.ltlMsg.Text     = "操作失败," + uf.Message + "";
                    this.pnlMsg.Visible  = true;
                    this.pnlMsg.CssClass = "actionErr";
                    return;
                }
            }
            //model.SiteLogo = this.txtSiteLogo.Text.Trim();
            model.SiteLevel      = Convert.ToInt32(this.txtSiteLevel.Text.Trim());
            model.SiteContent    = this.txtSiteContent.Text.Trim();
            model.SiteLinkType   = Convert.ToInt32(this.rablistLinkType.SelectedValue);
            model.SiteState      = Convert.ToInt32(this.rablistSiteState.SelectedValue);
            model.SiteClickCount = this.txtSiteClickCount.Text == string.Empty ? 0 : Convert.ToInt32(this.txtSiteClickCount.Text.Trim());
            model.Aread          = this.hfAread.Value != string.Empty ? this.hfAread.Value : "0";



            if (ViewState["ID"] != null)
            {
                model.ID         = Convert.ToInt32(ViewState["ID"].ToString());
                model.PutoutID   = Convert.ToInt32(ViewState["PutoutID"]);
                model.PutoutTyID = Convert.ToInt32(ViewState["PutoutTyID"]);
                model.UpdateDate = DateTime.Now;
                model.CreateDate = Convert.ToDateTime(ViewState["CreateDate"].ToString());
                bll.Amend(model);
                this.ltlMsg.Text = "操作成功,已保存该信息";
                this.BandInfo(model.ID);//刷新
                this.pnlMsg.Visible  = true;
                this.pnlMsg.CssClass = "actionOk";
            }
            else
            {
                //添加时的类型
                model.PutoutTyID = 0;
                SOSOshop.Model.AdminInfo adminModel = (SOSOshop.Model.AdminInfo)SOSOshop.BLL.AdministrorManager.Get();
                //管理员ID
                model.PutoutID   = adminModel.AdminId;
                model.CreateDate = DateTime.Now;
                model.UpdateDate = DateTime.Now;
                bll.Add(model);
                this.ltlMsg.Text     = "操作成功,已添加该信息";
                this.pnlMsg.Visible  = true;
                this.pnlMsg.CssClass = "actionOk";
            }
        }