protected void Button_Edit_Click(object sender, EventArgs e)
        {
            string ErrorMessage = String.Empty;

            if (String.IsNullOrEmpty(TextBox_PageName.Text))
            {
                ErrorMessage += "页面名称不能为空\\n";
            }
            if (String.IsNullOrEmpty(TextBox_PageTitle.Text))
            {
                ErrorMessage += "页面标题不能为空\\n";
            }

            if (!String.IsNullOrEmpty(ErrorMessage))
            {
                MessageBox.Show(this, ErrorMessage);
            }


            PageModel page = PageControler.GetModel(PageID);

            page.PageTitle = TextBox_PageTitle.Text;

            PageControler.Update(page);
        }
Beispiel #2
0
 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName.ToLower() == "d")
     {
         int ProductID = Convert.ToInt32(e.CommandArgument);
         bll.Delete(ProductID);
         BindData(AspNetPager.CurrentPageIndex);
         MessageBox.Show(this, "删除成功!");
         PageControler.Publish(7, true);
     }
     if (e.CommandName.ToLower() == "f")
     {
         int ProductID = Convert.ToInt32(e.CommandArgument);
         bll.ChangeStatus(ProductID, (int)PawnProductStatus.冻结);
         BindData(AspNetPager.CurrentPageIndex);
         PageControler.Publish(7, true);
     }
     if (e.CommandName.ToLower() == "m")
     {
         int ProductID = Convert.ToInt32(e.CommandArgument);
         bll.ChangeStatus(ProductID, (int)PawnProductStatus.尚未收当);
         BindData(AspNetPager.CurrentPageIndex);
         PageControler.Publish(7, true);
     }
 }
Beispiel #3
0
        protected void Button_Add_Click(object sender, EventArgs e)
        {
            string ErrorMessage = String.Empty;

            if (String.IsNullOrEmpty(TextBox_PageName.Text))
            {
                ErrorMessage += "页面名称不能为空\\n";
            }
            if (String.IsNullOrEmpty(TextBox_PageTitle.Text))
            {
                ErrorMessage += "页面标题不能为空\\n";
            }

            if (!String.IsNullOrEmpty(ErrorMessage))
            {
                MessageBox.Show(this, ErrorMessage);
            }

            PageModel page = new PageModel();

            page.PageName       = TextBox_PageName.Text;
            page.PageTitle      = TextBox_PageTitle.Text + "_鼎鼎商城";
            page.Category       = (int)PageCategory.SalesPage;
            page.PhysicalPath   = String.Format(Element.NameRule, DateTime.Today.ToString("yyMM"), DateTime.Today.ToString("dd"), page.PageName);
            page.TempatePath    = DropDownList_Template.SelectedValue;
            page.Author         = "";
            page.LastModify     = "";
            page.CreateTime     = DateTime.Now;
            page.UpdateTime     = page.CreateTime;
            page.SelfClassid    = 0;
            page.ExtendPageInfo = "";

            PageControler.Insert(page);
            MessageBox.Show(this, "添加成功!");
        }
 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName.ToLower() == "d")
     {
         int PageID = Convert.ToInt32(e.CommandArgument);
         PageControler.Delete(PageID);
         BindData(AspNetPager.CurrentPageIndex);
     }
 }
        private void BindData(int PageIndex)
        {
            int       RecordCount = 0;
            DataTable dt          = PageControler.GetList(PageIndex, AspNetPager.PageSize, PageCategory.ChannelPage, out RecordCount);

            GridView1.DataSource = dt;
            GridView1.DataBind();
            AspNetPager.RecordCount = RecordCount;
        }
Beispiel #6
0
 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "d")
     {
         int RentID = Convert.ToInt32(e.CommandArgument);
         bll.Delete(RentID);
         PageControler.Publish(7, true);
     }
 }
        private void BindData()
        {
            PageModel page = PageControler.GetModel(PageID);

            DropDownList_Template.DataSource     = TemplateControler.GetTemplateList(PageCategory.HelpCenter);
            DropDownList_Template.DataTextField  = "name";
            DropDownList_Template.DataValueField = "fullname";
            DropDownList_Template.DataBind();

            DropDownList_Template.SelectedValue = page.TempatePath;
            TextBox_PageName.Text  = page.PageName;
            TextBox_PageTitle.Text = page.PageTitle;
        }
Beispiel #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PageID = int.Parse(Request.QueryString["pageid"]);
            if (!IsPostBack)
            {
                Stream PageStream = new ResponseFilter(Response.Filter);

                Response.Filter = PageStream;

                PageModel page = PageControler.GetModel(PageID);

                this.Title = page.PageTitle;
            }
        }
Beispiel #9
0
        private void BindData()
        {
            PageModel model = PageControler.GetModel(PageID);

            Label_PageTitle.InnerText = model.PageTitle;

            GridView1.DataSource = TemplateControler.GetTagList(PageID);
            GridView1.DataBind();

            string PreviewUrl = String.Empty, FormalUrl = String.Empty;

            PageControler.GetPageUrl(PageID, Config.PageCategories["ChannelPage"], out PreviewUrl, out FormalUrl);

            Link_Preview.NavigateUrl = PreviewUrl;
            Link_Formal.NavigateUrl  = FormalUrl;
        }
Beispiel #10
0
        protected void Button_Publish_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < GridView1.Rows.Count; i++)
            {
                if (((CheckBox)GridView1.Rows[i].FindControl("chkItem")).Checked == true)
                {
                    string ServerID = GridView1.Rows[i].Cells[2].Text;
                    int    TagID    = int.Parse(GridView1.Rows[i].Cells[3].Text);
                    string TagTitle = ((DataBoundLiteralControl)GridView1.Rows[i].Cells[1].Controls[0]).Text;

                    string Content = ((TextBox)(editWrap.FindControl(ServerID + "-Eidtor").FindControl("TextBox_Content"))).Text;

                    TagContentModel TagContent = new TagContentModel();
                    TagContent.PageID   = PageID;
                    TagContent.ServerID = ServerID;
                    TagContent.TagID    = TagID;
                    TagContent.Content  = Content;

                    TagControler.TagContentImport(TagContent);
                }
            }
            PageControler.Publish(PageID);
            MessageBox.Show(this, "发布成功!");
        }
Beispiel #11
0
 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "d")
     {
         int NewsID = Convert.ToInt32(e.CommandArgument);
         bll.Delete(NewsID);
         BindData(AspNetPager.CurrentPageIndex);
         PageControler.Publish(6, true);
     }
     if (e.CommandName == "ss")
     {
         int NewsID = Convert.ToInt32(e.CommandArgument);
         bll.SetSplendid(NewsID, true);
         BindData(AspNetPager.CurrentPageIndex);
         PageControler.Publish(6, true);
     }
     if (e.CommandName == "ds")
     {
         int NewsID = Convert.ToInt32(e.CommandArgument);
         bll.SetSplendid(NewsID, false);
         BindData(AspNetPager.CurrentPageIndex);
         PageControler.Publish(6, true);
     }
 }
        protected void Button_Add_Click(object sender, EventArgs e)
        {
            string ErrorMessage = String.Empty;

            if (String.IsNullOrEmpty(TextBox_RentName.Text))
            {
                ErrorMessage += "商品名称不能为空\\n";
            }
            if (String.IsNullOrEmpty(TextBox_Stock.Text) || !PageValidate.IsNumber(TextBox_Stock.Text))
            {
                ErrorMessage += "商品数量不正确\\n";
            }
            if (String.IsNullOrEmpty(TextBox_Keywords.Text))
            {
                ErrorMessage += "关键词不能为空\\n";
            }
            if (String.IsNullOrEmpty(TextBox_RentPrice.Text) || !PageValidate.IsDecimal(TextBox_RentPrice.Text))
            {
                ErrorMessage += "出租价格不正确\\n";
            }
            if (String.IsNullOrEmpty(TextBox_CashPledge.Text) || !PageValidate.IsDecimal(TextBox_CashPledge.Text))
            {
                ErrorMessage += "出租押金不正确\\n";
            }
            if (String.IsNullOrEmpty(TextBox_MaxRentDays.Text) || !PageValidate.IsNumber(TextBox_MaxRentDays.Text))
            {
                ErrorMessage += "最大出租时间不正确\\n";
            }
            if (String.IsNullOrEmpty(TextBox_Brief.Text))
            {
                ErrorMessage += "商品简介不能为空\\n";
            }
            if (String.IsNullOrEmpty(FileUpload_MainImage.FileName))
            {
                ErrorMessage += "商品图片不能为空\\n";
            }

            if (!String.IsNullOrEmpty(ErrorMessage))
            {
                MessageBox.Show(this, ErrorMessage);
                return;
            }

            int RentID = CommDataHelper.GetNewSerialNum(AppType.MagicWorld);

            string[] ProductImages;
            if (MagicWorldImageRule.SaveProductMainImage(RentID, FileUpload_MainImage.PostedFile, out ProductImages))
            {
                RentProductModel model = new RentProductModel();

                model.RentID      = RentID;
                model.RentName    = TextBox_RentName.Text;
                model.Stock       = Convert.ToInt32(TextBox_Stock.Text);
                model.Keywords    = TextBox_Keywords.Text.Replace(",", ",");
                model.CashPledge  = Convert.ToDecimal(TextBox_CashPledge.Text);
                model.RentPrice   = Convert.ToDecimal(TextBox_RentPrice.Text);
                model.MaxRentTime = Convert.ToInt32(TextBox_MaxRentDays.Text);
                model.Brief       = TextBox_Brief.Text;
                model.SmallImage  = ProductImages[0];
                model.MediumImage = ProductImages[1];

                model.CategoryID   = CategoryID;
                model.CategoryPath = Hidden_CategoryPath.Value;
                model.CreateTime   = DateTime.Now;
                model.UpdateTime   = DateTime.Now;
                model.Status       = (int)RentProductStatus.申请中;

                new RentProductBll().Add(model);

                PageControler.Publish(7, true);

                Response.Redirect("List.aspx");
            }
            else
            {
                MessageBox.Show(this, "图片上传失败!");
            }
        }
        protected void Button_Submit_Click(object sender, EventArgs e)
        {
            bool isEndCate = false;
            int  SelectedParentCategoryID = NewsCategorySelect1.GetSelectedRegionInfo(out isEndCate).CateID;

            string strErr = String.Empty;

            if (TextBox_Title.Text == String.Empty)
            {
                strErr += "新闻标题不能为空!\\n";
            }
            if (TextBox_Author.Text == String.Empty)
            {
                strErr += "新闻作者不能为空!\\n";
            }
            if (TextBox_NewsFrom.Text == String.Empty)
            {
                strErr += "新闻来源不能为空!\\n";
            }
            if (TextBox_Tags.Text == String.Empty)
            {
                strErr += "新闻标签不能为空!\\n";
            }
            if (!isEndCate)
            {
                strErr += "新闻不能添加在非末级分类下!\\n";
            }

            if (strErr != String.Empty)
            {
                MessageBox.Show(this, strErr);
                return;
            }

            int       NewsID = CommDataHelper.GetNewSerialNum("ne");
            NewsModel model  = new NewsModel();

            model.NewsId     = NewsID;
            model.Title      = TextBox_Title.Text;
            model.SubTitle   = TextBox_SubTitle.Text;
            model.Author     = TextBox_Author.Text;
            model.From       = TextBox_NewsFrom.Text;
            model.CategoryID = SelectedParentCategoryID;
            model.Tags       = TextBox_Tags.Text;
            model.Brief      = TextBox_Brief.Text;
            model.Content    = TextBox_Content.Text;
            model.InsertTime = DateTime.Now;
            model.ModifyTime = DateTime.Now;
            model.ProductId  = String.IsNullOrEmpty(TextBox_ProductID.Text) ? "0" : TextBox_ProductID.Text;


            model.NewsType      = 1;
            model.Status        = 1;
            model.ImageUrl      = "";
            model.SmallImageUrl = "";
            model.VideoUrl      = "";

            if (!String.IsNullOrEmpty(FileUpload_Image.FileName))
            {
                string ImageUrl = String.Empty;

                if (NewsImageRule.SaveNewsImage(NewsID, FileUpload_Image.PostedFile, out ImageUrl))
                {
                    model.ImageUrl = ImageUrl;
                }
                else
                {
                    MessageBox.Show(this, "图片上传失败,请检查格式及大小是否正确。");
                    return;
                }
            }
            if (!String.IsNullOrEmpty(FileUpload_Video.FileName))
            {
                string VideoUrl = String.Empty;

                if (NewsVideoRule.SaveNewsVideo(NewsID, FileUpload_Video.PostedFile, out VideoUrl))
                {
                    model.VideoUrl = VideoUrl;
                }
                else
                {
                    MessageBox.Show(this, "视频上传失败,请检查格式及大小是否正确。");
                    return;
                }
            }

            bll.Add(model);
            PageControler.Publish(6, true);
            Response.Redirect("List.aspx");
        }
        protected void Button_Edit_Click(object sender, EventArgs e)
        {
            string ErrorMessage = String.Empty;

            if (String.IsNullOrEmpty(TextBox_RentName.Text))
            {
                ErrorMessage += "商品名称不能为空\\n";
            }
            if (String.IsNullOrEmpty(TextBox_Stock.Text) || !PageValidate.IsNumber(TextBox_Stock.Text))
            {
                ErrorMessage += "商品数量不正确\\n";
            }
            if (String.IsNullOrEmpty(TextBox_Keywords.Text))
            {
                ErrorMessage += "关键词不能为空\\n";
            }
            if (String.IsNullOrEmpty(TextBox_RentPrice.Text) || !PageValidate.IsDecimal(TextBox_RentPrice.Text))
            {
                ErrorMessage += "出租价格不正确\\n";
            }
            if (String.IsNullOrEmpty(TextBox_MaxRentDays.Text) || !PageValidate.IsNumber(TextBox_MaxRentDays.Text))
            {
                ErrorMessage += "最大出租天数不正确\\n";
            }
            if (String.IsNullOrEmpty(TextBox_Brief.Text))
            {
                ErrorMessage += "商品简介不能为空\\n";
            }

            if (!String.IsNullOrEmpty(ErrorMessage))
            {
                MessageBox.Show(this, ErrorMessage);
                return;
            }

            RentProductModel rent = bll.GetModel(RentID);

            if (!String.IsNullOrEmpty(FileUpload_MainImage.FileName))
            {
                string[] ProductImages;

                if (MagicWorldImageRule.SaveProductMainImage(rent.RentID, FileUpload_MainImage.PostedFile, out ProductImages))
                {
                    rent.SmallImage  = ProductImages[0];
                    rent.MediumImage = ProductImages[1];
                }
                else
                {
                    MessageBox.Show(this, "图片上传失败");
                    return;
                }
            }

            rent.RentName    = TextBox_RentName.Text;
            rent.RentPrice   = Convert.ToDecimal(TextBox_RentPrice.Text);
            rent.MaxRentTime = Convert.ToInt32(TextBox_MaxRentDays.Text);
            rent.Stock       = Convert.ToInt32(TextBox_Stock.Text);
            rent.Keywords    = TextBox_Keywords.Text;
            rent.Brief       = TextBox_Brief.Text;

            bll.Update(rent);

            PageControler.Publish(7, true);
            Response.Redirect("List.aspx");
        }
Beispiel #15
0
        protected void Button_Submit_Click(object sender, EventArgs e)
        {
            NewsModel model = bll.GetModel(NewsID);
            bool      IsEndClass;

            int SelectedParentCategoryID = NewsCategorySelect1.GetSelectedRegionInfo(out IsEndClass).CateID;

            string strErr = String.Empty;

            if (TextBox_Title.Text == String.Empty)
            {
                strErr += "新闻标题不能为空!\\n";
            }
            if (TextBox_Author.Text == String.Empty)
            {
                strErr += "新闻作者不能为空!\\n";
            }
            if (TextBox_NewsFrom.Text == String.Empty)
            {
                strErr += "新闻来源不能为空!\\n";
            }
            if (TextBox_Tags.Text == String.Empty)
            {
                strErr += "新闻标签不能为空!\\n";
            }
            if (!IsEndClass)
            {
                strErr += "新闻不能添加在非末级分类下!\\n";
            }

            if (strErr != String.Empty)
            {
                MessageBox.Show(this, strErr);
                return;
            }

            model.Title      = TextBox_Title.Text;
            model.SubTitle   = TextBox_SubTitle.Text;
            model.Author     = TextBox_Author.Text;
            model.From       = TextBox_NewsFrom.Text;
            model.CategoryID = SelectedParentCategoryID;
            model.Tags       = TextBox_Tags.Text;
            model.Brief      = TextBox_Brief.Text;
            model.Content    = TextBox_Content.Text;
            model.ModifyTime = DateTime.Now;
            model.ProductId  = String.IsNullOrEmpty(TextBox_ProductID.Text) ? "0" : TextBox_ProductID.Text;

            if (!String.IsNullOrEmpty(FileUpload_Image.FileName))
            {
                string ImageUrl = String.Empty;

                if (NewsImageRule.SaveNewsImage(NewsID, FileUpload_Image.PostedFile, out ImageUrl))
                {
                    model.ImageUrl = ImageUrl;
                }
                else
                {
                    MessageBox.Show(this, "图片上传失败,请检查格式及大小是否正确。");
                    return;
                }
            }
            if (!String.IsNullOrEmpty(FileUpload_Video.FileName))
            {
                string VideoUrl = String.Empty;

                if (NewsVideoRule.SaveNewsVideo(NewsID, FileUpload_Video.PostedFile, out VideoUrl))
                {
                    model.VideoUrl = VideoUrl;
                }
                else
                {
                    MessageBox.Show(this, "视频上传失败,请检查格式及大小是否正确。");
                    return;
                }
            }

            bll.Update(model);
            PageControler.Publish(6, true);
            Response.Redirect("List.aspx?page=" + CurrentPageIndex);
        }