예제 #1
0
        private void UpdateADInfo_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                string targets = Request["TargetFID"];
                if ((String.IsNullOrEmpty(targets) || targets == ",") && this.type.SelectedIndex < 10)
                {
                    base.RegisterStartupScript("", "<script>alert('请您先选取相关的投放范围,再点击提交按钮');showadhint(Form1.type.value);showparameters(Form1.parameters.value);</script>");
                    return;
                }
                if (this.endtime.SelectedDate.ToString().IndexOf("1900") == 0)
                {
                    base.RegisterStartupScript("", "<script>alert('结束时间不能为空');showadhint(Form1.type.value);showparameters(Form1.parameters.value);</script>");
                    return;
                }
                if (this.starttime.SelectedDate.ToString().IndexOf("1900") < 0 && this.endtime.SelectedDate.ToString().IndexOf("1900") < 0 && Convert.ToDateTime(this.starttime.SelectedDate.ToString()) >= Convert.ToDateTime(this.endtime.SelectedDate.ToString()))
                {
                    base.RegisterStartupScript("", "<script>alert('生效时间应该早于结束时间');showadhint(Form1.type.value);showparameters(Form1.parameters.value);</script>");
                    return;
                }
                if (this.endtime.SelectedDate < DateTime.Now)
                {
                    base.RegisterStartupScript("", "<script>alert('您选择的结束日期已过期,请重新选择一个大于今天的日期');showadhint(Form1.type.value);showparameters(Form1.parameters.value);</script>");
                    return;
                }
                string code;
                if (this.type.SelectedValue == Convert.ToInt16(AdType.QuickEditorBgAd).ToString())
                {
                    code = this.imglink.Text + "\r" + this.imgsrc.Text;
                }
                else
                {
                    code = this.GetCode();
                }

                //Advertisements.UpdateAdvertisement(DNTRequest.GetInt("advid", 0), available.SelectedValue.ToInt(), type.SelectedValue, displayorder.Text.ToInt(), title.Text, targets, GetParameters(), text, starttime.SelectedDate.ToString(), endtime.SelectedDate.ToString());

                var entity = Advertisement.FindByID(DNTRequest.GetInt("advid", 0));
                if (entity != null)
                {
                    entity.Available    = Int32.Parse(available.SelectedValue);
                    entity.Type         = type.SelectedValue;
                    entity.DisplayOrder = Int32.Parse(displayorder.Text);
                    entity.Title        = title.Text;

                    targets           = targets.IndexOf("全部") >= 0 ? ",全部," : ("," + targets + ",");
                    entity.Targets    = targets;
                    entity.Parameters = GetParameters();
                    entity.Code       = code;
                    entity.StartTime  = starttime.SelectedDate;
                    entity.EndTime    = endtime.SelectedDate;
                    entity.Save();
                }

                base.Response.Redirect("advsgrid.aspx");
            }
        }
예제 #2
0
        public string CreateInviteCodePriceString()
        {
            string text = "";

            for (int i = 0; i < 8; i++)
            {
                BBX.Control.TextBox textBox = this.FindControl("invitecodeprice" + i.ToString()) as BBX.Control.TextBox;
                text = text + textBox.Text.ToDouble() + ",";
            }
            return(text.Trim(','));
        }