Beispiel #1
0
        private void BindUserGorupMaxspaceattachsize()
        {
            DataTable    dt = DatabaseProvider.GetInstance().GetUserGroupMaxspaceattachsize();
            int          i  = 1;
            HtmlTableRow tr = new HtmlTableRow();

            foreach (DataRow dr in dt.Rows)
            {
                if (i % 2 == 1)
                {
                    tr = new HtmlTableRow();
                }
                HtmlTableCell td = new HtmlTableCell("td");
                td.Controls.Add(new LiteralControl(dr["grouptitle"].ToString()));
                tr.Cells.Add(td);
                td = new HtmlTableCell("td");
                Discuz.Control.TextBox tb = new Discuz.Control.TextBox();
                tb.ID                = "maxspaceattachsize" + dr["groupid"].ToString();
                tb.Size              = 10;
                tb.MaxLength         = 9;
                tb.Text              = dr["maxspaceattachsize"].ToString();
                tb.RequiredFieldType = "数据校验";
                td.Controls.Add(tb);
                tr.Cells.Add(td);
                tr.Cells.Add(GetTD("maxspaceattachsize" + dr["groupid"].ToString()));
                groupattachsize.Rows.Add(tr);
                i++;
            }
        }
Beispiel #2
0
        private void UpdateADInfo_Click(object sender, EventArgs e)
        {
            #region 编辑广告信息

            if (this.CheckCookie())
            {
                string targetlist = DNTRequest.GetString("TargetFID");

                if ((targetlist == "") || (targetlist == ","))
                {
                    base.RegisterStartupScript("", "<script>alert('请您先选取相关的投放范围,再点击提交按钮');showadhint(Form1.type.value);showparameters(Form1.parameters.value);</script>");
                    return;
                }

                string starttimestr = starttime.SelectedDate.ToString();
                string endtimestr   = endtime.SelectedDate.ToString();
                if (starttimestr.IndexOf("1900") < 0 && endtimestr.IndexOf("1900") < 0)
                {
                    if (Convert.ToDateTime(starttime.SelectedDate.ToString()) >= Convert.ToDateTime(endtime.SelectedDate.ToString()))
                    {
                        base.RegisterStartupScript("", "<script>alert('生效时间应该早于结束时间');showadhint(Form1.type.value);showparameters(Form1.parameters.value);</script>");
                        return;
                    }
                }

                string code = string.Empty;

                if (type.SelectedValue == Convert.ToInt16(AdType.QuickEditorBgAd).ToString())
                {
                    code  = imglink.Text + "\r";
                    code += imgsrc.Text;
                }
                else
                {
                    code = GetCode();
                }

                targetlist = targetlist.IndexOf("全部") >= 0 ? ",全部," : "," + targetlist + ",";
                DatabaseProvider.GetInstance().UpdateAdvertisement(DNTRequest.GetInt("advid", 0), Utils.StrToInt(available.SelectedValue, 0), type.SelectedValue, Utils.StrToInt(displayorder.Text, 0),
                                                                   tbtitle.Text, targetlist, GetParameters(), code,
                                                                   starttimestr.IndexOf("1900") >= 0 ? "1900-1-1" : starttimestr,
                                                                   endtimestr.IndexOf("1900") >= 0 ? "2555-1-1" : endtimestr);

                Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/Advertisements");
                Response.Redirect("global_advsgrid.aspx");
                //base.RegisterStartupScript( "PAGE",  "window.location.href='global_advsgrid.aspx';");
            }

            #endregion
        }
Beispiel #3
0
        private void UpdateADInfo_Click(object sender, EventArgs e)
        {
            #region 编辑广告信息

            if (this.CheckCookie())
            {
                string targetlist = DNTRequest.GetString("TargetFID");

                if ((targetlist == "") || (targetlist == ","))
                {
                    base.RegisterStartupScript("", "<script>alert('请您先选取相关的投放范围,再点击提交按钮');showadhint(Form1.type.value);showparameters(Form1.parameters.value);</script>");
                    return;
                }

                string starttimestr = starttime.SelectedDate.ToString();
                string endtimestr = endtime.SelectedDate.ToString();
                if (starttimestr.IndexOf("1900") < 0 && endtimestr.IndexOf("1900") < 0)
                {
                    if (Convert.ToDateTime(starttime.SelectedDate.ToString()) >= Convert.ToDateTime(endtime.SelectedDate.ToString()))
                    {
                        base.RegisterStartupScript("", "<script>alert('生效时间应该早于结束时间');showadhint(Form1.type.value);showparameters(Form1.parameters.value);</script>");
                        return;
                    }
                }

                string code = string.Empty;

                if (type.SelectedValue == Convert.ToInt16(AdType.QuickEditorBgAd).ToString())
                {
                    code = imglink.Text + "\r";
                    code += imgsrc.Text;
                }
                else
                {
                    code = GetCode();
                }
                
                targetlist = targetlist.IndexOf("全部") >= 0 ? ",全部," : "," + targetlist + ",";
                DatabaseProvider.GetInstance().UpdateAdvertisement(DNTRequest.GetInt("advid", 0), Utils.StrToInt(available.SelectedValue, 0), type.SelectedValue, Utils.StrToInt(displayorder.Text, 0),
                                                        tbtitle.Text, targetlist, GetParameters(), code,
                                                        starttimestr.IndexOf("1900") >= 0 ? "1900-1-1" : starttimestr,
                                                        endtimestr.IndexOf("1900") >= 0 ? "2555-1-1" : endtimestr);

                 Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/Advertisements");
                 Response.Redirect("global_advsgrid.aspx");
                 //base.RegisterStartupScript( "PAGE",  "window.location.href='global_advsgrid.aspx';");
                
            }

            #endregion
        }
        private void BindUserGorupMaxspaceattachsize()
        {
            DataTable dt = DatabaseProvider.GetInstance().GetUserGroupMaxspaceattachsize();
            int i = 1;
            HtmlTableRow tr = new HtmlTableRow();
            foreach (DataRow dr in dt.Rows)
            {
                if (i % 2 == 1)
                {
                    tr = new HtmlTableRow();
                }
                HtmlTableCell td = new HtmlTableCell("td");
                td.Controls.Add(new LiteralControl(dr["grouptitle"].ToString()));
                tr.Cells.Add(td);
                td = new HtmlTableCell("td");
                Discuz.Control.TextBox tb = new Discuz.Control.TextBox();
                tb.ID = "maxspaceattachsize" + dr["groupid"].ToString();
                tb.Size = 10;
                tb.MaxLength = 9;
                tb.Text = dr["maxspaceattachsize"].ToString();
                tb.RequiredFieldType = "数据校验";
                td.Controls.Add(tb);
                tr.Cells.Add(td);
                tr.Cells.Add(GetTD("maxspaceattachsize" + dr["groupid"].ToString()));
                groupattachsize.Rows.Add(tr);
                i++;
            }

        }