Пример #1
0
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            int id      = RequestHelper.GetQueryString <int>("Id");
            var adImage = AdImageBLL.Read(id);

            adImage.Title         = Title.Text;
            adImage.SubTitle      = SubTitle.Text;
            adImage.LinkUrl       = StringHelper.Substring(LinkUrl.Text.Trim(), 192, false);
            adImage.ImageUrl      = ImageUrl.Text;
            adImage.OrderId       = int.Parse(OrderId.Text);
            adImage.MobileLinkUrl = BgColor.Text.Trim();
            int _classId = 0;

            int.TryParse(ProductClass.Text, out _classId);
            adImage.ClassId = _classId;

            string alertMessage = ShopLanguage.ReadLanguage("UpdateOK");

            if (adImage.Id > 0)
            {
                CheckAdminPower("UpdateAdImage", PowerCheckType.Single);
                AdImageBLL.Update(adImage);
                AdminLogBLL.Add(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("AdImage"), adImage.Id);
            }
            else
            {
                CheckAdminPower("AddAdImage", PowerCheckType.Single);
                adImage.AdType = RequestHelper.GetQueryString <int>("fp_type");
                adImage.Tm     = DateTime.Now;
                id             = AdImageBLL.Add(adImage);
                AdminLogBLL.Add(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("AdImage"), id);
                alertMessage = ShopLanguage.ReadLanguage("AddOK");
            }
            ScriptHelper.Alert(alertMessage, "FpImage.aspx?fp_type=" + adImage.AdType + "");
        }
Пример #2
0
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            int id      = RequestHelper.GetQueryString <int>("Id");
            var adImage = AdImageBLL.Read(id);

            adImage.Title          = Title.Text;
            adImage.SubTitle       = SubTitle.Text;
            adImage.MobileLinkUrl  = LinkUrl.Text;
            adImage.MobileImageUrl = ImageUrl.Text;
            adImage.OrderId        = int.Parse(OrderId.Text);
            adImage.Tm             = DateTime.Now;

            string alertMessage = ShopLanguage.ReadLanguage("UpdateOK");

            if (adImage.Id > 0)
            {
                CheckAdminPower("UpdateAdImage", PowerCheckType.Single);
                AdImageBLL.Update(adImage);
                AdminLogBLL.Add(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("AdImage"), adImage.Id);
            }
            else
            {
                CheckAdminPower("AddAdImage", PowerCheckType.Single);
                adImage.AdType  = RequestHelper.GetQueryString <int>("ad_type");
                adImage.ClassId = RequestHelper.GetQueryString <int>("class_id");
                id = AdImageBLL.Add(adImage);
                AdminLogBLL.Add(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("AdImage"), id);
                alertMessage = ShopLanguage.ReadLanguage("AddOK");
            }
            ScriptHelper.Alert(alertMessage, RequestHelper.RawUrl);
        }