Пример #1
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            try
            {
                AstroDiceMod model = new AstroDiceMod
                {
                    House         = ((((-(int.Parse(this.gong.Value) / 30) + 4) + 12) - 1) % 12) + 1,
                    Constellation = ((((360 - ((int.Parse(this.gong.Value) - 90) - Convert.ToInt16(Math.Floor(decimal.Parse(this.xingzuo.Value))))) / 30) + 12) % 12) + 1,
                    Question      = this.flashtitle.Value
                };
                Literal2.Text = stars[int.Parse(this.dice.Value)] + "<br />";
                if (this.dice.Value == "10")
                {
                    this.dice.Value = "15";
                }
                else if (this.dice.Value == "11")
                {
                    this.dice.Value = "32";
                }
                model.Star            = int.Parse(this.dice.Value) + 1;
                this.ViewState["Pic"] = model.Pic;
                AstroDiceBll.GetInstance().Add(model);
                this.dice.Value    = model.Star.ToString();
                this.gong.Value    = model.House.ToString();
                this.xingzuo.Value = model.Constellation.ToString();
                Literal1.Text      = PublicValue.GetAstroStar(model.Star) + "  " + model.House + "宫  " + PublicValue.GetConstellation(model.Constellation);


                Literal2.Text += house[model.House - 1] + "<br />";
                Literal2.Text += constellation[model.Constellation - 1];

                string content = "#占星骰子# #" + Literal1.Text + "# “" + flashtitle.Value + "”,求占卜师解答!";
                //string[] tmp = HiddenField1.Value.Split(new char[] { '|' });
                //for (int i = 0; i < tmp.Length; i++)
                //{
                //    if (tmp[i] != "")
                //    {
                //        content += " @" + tmp[i];
                //    }
                //}
                content      += " @蓝雪鳳兒 @青花 @一然 @采薇 @山有扶苏 @黄小鞋";
                TextBox1.Text = content;

                Button1.PostBackUrl = "http://share.v.t.qq.com/index.php?c=share&a=index&url=" + Server.UrlEncode("http://astro.fashion.qq.com/app/astrodice.htm") +
                                      "&pic=" + Server.UrlEncode("http://app.ssqian.com/WebResources/DicePic/" + filename.Value + ".jpg") + "&appkey=801402959&title=" + Server.UrlEncode(content.Replace("@蓝雪鳳兒 @青花 @一然 @采薇 @山有扶苏 @黄小鞋", "@iamsnowsnow @bubuzhanxing @yiraneasy @susan1114 @god82953378 @yellowlittleshoes") + " 好玩好准的占星骰子,亲们也来试试:") + "&line1=&line2=&line3=";
            }
            catch
            {
            }
        }
Пример #2
0
 // Methods
 protected void Button1_Click(object sender, EventArgs e)
 {
     try
     {
         AstroDiceMod model = new AstroDiceMod
         {
             House         = ((((-(int.Parse(this.gong.Value) / 30) + 4) + 12) - 1) % 12) + 1,
             Constellation = ((((360 - ((int.Parse(this.gong.Value) - 90) - Convert.ToInt16(Math.Floor(decimal.Parse(this.xingzuo.Value))))) / 30) + 12) % 12) + 1,
             Question      = this.flashtitle.Value
         };
         if (this.dice.Value == "10")
         {
             this.dice.Value = "15";
         }
         else if (this.dice.Value == "11")
         {
             this.dice.Value = "32";
         }
         model.Star            = int.Parse(this.dice.Value) + 1;
         model.TS              = DateTime.Now;
         model.UserSysNo       = QQWeiBoUserBll.GetInstance().GetRecordByName(this.wb_name).SysNo;
         model.Source          = 1;
         model.Pic             = "";
         this.ViewState["Pic"] = model.Pic;
         AstroDiceBll.GetInstance().Add(model);
         this.LinkButton8.Text              = PublicValue.GetAstroStar(model.Star) + "  ";
         this.LinkButton9.Text              = model.House + "宫  ";
         this.LinkButton10.Text             = PublicValue.GetConstellation(model.Constellation);
         this.LinkButton8.Style["display"]  = "";
         this.LinkButton9.Style["display"]  = "";
         this.LinkButton10.Style["display"] = "";
         this.dice.Value    = model.Star.ToString();
         this.gong.Value    = model.House.ToString();
         this.xingzuo.Value = model.Constellation.ToString();
         this.LinkButton8_Click(this.LinkButton8, e);
         this.TextBox1.Text = string.Concat(new object[] { "#占星骰子# #", PublicValue.GetAstroStar(model.Star), " ", model.House, "宫 ", PublicValue.GetConstellation(model.Constellation), "# “", model.Question, "”,求占卜师解答!亲们也来试试吧! http://app.t.qq.com/app/play/801272340" });
     }
     catch
     {
     }
 }