示例#1
0
        /// <summary>
        /// 增加一条数据
        /// </summary>

        public int Add(LoveRoseMod model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into Apps.dbo.LoveRose(");
            strSql.Append("BirthTime,Area,Source,TS)");
            strSql.Append(" values (");
            strSql.Append("@BirthTime,@Area,@Source,@TS)");
            strSql.Append(";select SCOPE_IDENTITY()");
            SqlCommand cmd = new SqlCommand(strSql.ToString());

            SqlParameter[] parameters =
            {
                new SqlParameter("@BirthTime", SqlDbType.DateTime),
                new SqlParameter("@Area",      SqlDbType.Int,       4),
                new SqlParameter("@Source",    SqlDbType.Int,       4),
                new SqlParameter("@TS",        SqlDbType.DateTime),
            };
            if (model.BirthTime != AppConst.DateTimeNull)
            {
                parameters[0].Value = model.BirthTime;
            }
            else
            {
                parameters[0].Value = System.DBNull.Value;
            }
            cmd.Parameters.Add(parameters[0]);
            if (model.Area != AppConst.IntNull)
            {
                parameters[1].Value = model.Area;
            }
            else
            {
                parameters[1].Value = System.DBNull.Value;
            }
            cmd.Parameters.Add(parameters[1]);
            if (model.Source != AppConst.IntNull)
            {
                parameters[2].Value = model.Source;
            }
            else
            {
                parameters[2].Value = System.DBNull.Value;
            }
            cmd.Parameters.Add(parameters[2]);
            if (model.TS != AppConst.DateTimeNull)
            {
                parameters[3].Value = model.TS;
            }
            else
            {
                parameters[3].Value = System.DBNull.Value;
            }
            cmd.Parameters.Add(parameters[3]);

            return(SqlHelper.ExecuteNonQuery(cmd, parameters));
        }
示例#2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>

        public LoveRoseMod GetModel(int SysNo)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select SysNo, BirthTime, Area, Source, TS from Apps.dbo.LoveRose");
            strSql.Append(" where SysNo=@SysNo ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@SysNo", SqlDbType.Int, 4)
            };
            parameters[0].Value = SysNo;
            LoveRoseMod model = new LoveRoseMod();
            DataSet     ds    = SqlHelper.ExecuteDataSet(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["SysNo"].ToString() != "")
                {
                    model.SysNo = int.Parse(ds.Tables[0].Rows[0]["SysNo"].ToString());
                }
                if (ds.Tables[0].Rows[0]["BirthTime"].ToString() != "")
                {
                    model.BirthTime = DateTime.Parse(ds.Tables[0].Rows[0]["BirthTime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Area"].ToString() != "")
                {
                    model.Area = int.Parse(ds.Tables[0].Rows[0]["Area"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Source"].ToString() != "")
                {
                    model.Source = int.Parse(ds.Tables[0].Rows[0]["Source"].ToString());
                }
                if (ds.Tables[0].Rows[0]["TS"].ToString() != "")
                {
                    model.TS = DateTime.Parse(ds.Tables[0].Rows[0]["TS"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
示例#3
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(LoveRoseMod model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into Apps.dbo.LoveRose(");
            strSql.Append("BirthTime,Area,Source,TS)");
            strSql.Append(" values (");
            strSql.Append("@BirthTime,@Area,@Source,@TS)");
            strSql.Append(";select SCOPE_IDENTITY()");
            SqlCommand cmd = new SqlCommand(strSql.ToString());
            SqlParameter[] parameters = {
                 new SqlParameter("@BirthTime",SqlDbType.DateTime),
                 new SqlParameter("@Area",SqlDbType.Int,4),
                 new SqlParameter("@Source",SqlDbType.Int,4),
                 new SqlParameter("@TS",SqlDbType.DateTime),
             };
            if (model.BirthTime != AppConst.DateTimeNull)
                parameters[0].Value = model.BirthTime;
            else
                parameters[0].Value = System.DBNull.Value;
            cmd.Parameters.Add(parameters[0]);
            if (model.Area != AppConst.IntNull)
                parameters[1].Value = model.Area;
            else
                parameters[1].Value = System.DBNull.Value;
            cmd.Parameters.Add(parameters[1]);
            if (model.Source != AppConst.IntNull)
                parameters[2].Value = model.Source;
            else
                parameters[2].Value = System.DBNull.Value;
            cmd.Parameters.Add(parameters[2]);
            if (model.TS != AppConst.DateTimeNull)
                parameters[3].Value = model.TS;
            else
                parameters[3].Value = System.DBNull.Value;
            cmd.Parameters.Add(parameters[3]);

            return SqlHelper.ExecuteNonQuery(cmd, parameters);
        }
示例#4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public int Update(LoveRoseMod model)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("update Apps.dbo.LoveRose set ");
     strSql.Append("BirthTime=@BirthTime,");
     strSql.Append("Area=@Area,");
     strSql.Append("Source=@Source,");
     strSql.Append("TS=@TS");
     strSql.Append(" where SysNo=@SysNo ");
     SqlCommand cmd = new SqlCommand(strSql.ToString());
     SqlParameter[] parameters = {
          new SqlParameter("@SysNo",SqlDbType.Int,4),
          new SqlParameter("@BirthTime",SqlDbType.DateTime),
          new SqlParameter("@Area",SqlDbType.Int,4),
          new SqlParameter("@Source",SqlDbType.Int,4),
          new SqlParameter("@TS",SqlDbType.DateTime)
      };
     if (model.SysNo != AppConst.IntNull)
         parameters[0].Value = model.SysNo;
     else
         parameters[0].Value = System.DBNull.Value;
     cmd.Parameters.Add(parameters[0]);
     if (model.BirthTime != AppConst.DateTimeNull)
         parameters[1].Value = model.BirthTime;
     else
         parameters[1].Value = System.DBNull.Value;
     cmd.Parameters.Add(parameters[1]);
     if (model.Area != AppConst.IntNull)
         parameters[2].Value = model.Area;
     else
         parameters[2].Value = System.DBNull.Value;
     cmd.Parameters.Add(parameters[2]);
     if (model.Source != AppConst.IntNull)
         parameters[3].Value = model.Source;
     else
         parameters[3].Value = System.DBNull.Value;
     cmd.Parameters.Add(parameters[3]);
     if (model.TS != AppConst.DateTimeNull)
         parameters[4].Value = model.TS;
     else
         parameters[4].Value = System.DBNull.Value;
     cmd.Parameters.Add(parameters[4]);
     return SqlHelper.ExecuteNonQuery(cmd, parameters);
 }
示例#5
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public LoveRoseMod GetModel(int SysNo)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("select SysNo, BirthTime, Area, Source, TS from Apps.dbo.LoveRose");
     strSql.Append(" where SysNo=@SysNo ");
     SqlParameter[] parameters = {
     new SqlParameter("@SysNo", SqlDbType.Int,4 )
      		};
     parameters[0].Value = SysNo;
     LoveRoseMod model = new LoveRoseMod();
     DataSet ds = SqlHelper.ExecuteDataSet(strSql.ToString(), parameters);
     if (ds.Tables[0].Rows.Count > 0)
     {
         if (ds.Tables[0].Rows[0]["SysNo"].ToString() != "")
         {
             model.SysNo = int.Parse(ds.Tables[0].Rows[0]["SysNo"].ToString());
         }
         if (ds.Tables[0].Rows[0]["BirthTime"].ToString() != "")
         {
             model.BirthTime = DateTime.Parse(ds.Tables[0].Rows[0]["BirthTime"].ToString());
         }
         if (ds.Tables[0].Rows[0]["Area"].ToString() != "")
         {
             model.Area = int.Parse(ds.Tables[0].Rows[0]["Area"].ToString());
         }
         if (ds.Tables[0].Rows[0]["Source"].ToString() != "")
         {
             model.Source = int.Parse(ds.Tables[0].Rows[0]["Source"].ToString());
         }
         if (ds.Tables[0].Rows[0]["TS"].ToString() != "")
         {
             model.TS = DateTime.Parse(ds.Tables[0].Rows[0]["TS"].ToString());
         }
         return model;
     }
     else
     {
         return null;
     }
 }
示例#6
0
        /// <summary>
        /// 更新一条数据
        /// </summary>

        public int Update(LoveRoseMod model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Apps.dbo.LoveRose set ");
            strSql.Append("BirthTime=@BirthTime,");
            strSql.Append("Area=@Area,");
            strSql.Append("Source=@Source,");
            strSql.Append("TS=@TS");
            strSql.Append(" where SysNo=@SysNo ");
            SqlCommand cmd = new SqlCommand(strSql.ToString());

            SqlParameter[] parameters =
            {
                new SqlParameter("@SysNo",     SqlDbType.Int,       4),
                new SqlParameter("@BirthTime", SqlDbType.DateTime),
                new SqlParameter("@Area",      SqlDbType.Int,       4),
                new SqlParameter("@Source",    SqlDbType.Int,       4),
                new SqlParameter("@TS",        SqlDbType.DateTime)
            };
            if (model.SysNo != AppConst.IntNull)
            {
                parameters[0].Value = model.SysNo;
            }
            else
            {
                parameters[0].Value = System.DBNull.Value;
            }
            cmd.Parameters.Add(parameters[0]);
            if (model.BirthTime != AppConst.DateTimeNull)
            {
                parameters[1].Value = model.BirthTime;
            }
            else
            {
                parameters[1].Value = System.DBNull.Value;
            }
            cmd.Parameters.Add(parameters[1]);
            if (model.Area != AppConst.IntNull)
            {
                parameters[2].Value = model.Area;
            }
            else
            {
                parameters[2].Value = System.DBNull.Value;
            }
            cmd.Parameters.Add(parameters[2]);
            if (model.Source != AppConst.IntNull)
            {
                parameters[3].Value = model.Source;
            }
            else
            {
                parameters[3].Value = System.DBNull.Value;
            }
            cmd.Parameters.Add(parameters[3]);
            if (model.TS != AppConst.DateTimeNull)
            {
                parameters[4].Value = model.TS;
            }
            else
            {
                parameters[4].Value = System.DBNull.Value;
            }
            cmd.Parameters.Add(parameters[4]);
            return(SqlHelper.ExecuteNonQuery(cmd, parameters));
        }
示例#7
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(LoveRoseMod model)
 {
     dal.Update(model);
 }
示例#8
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(LoveRoseMod model)
 {
     return dal.Add(model);
 }
示例#9
0
        protected void Unnamed1_Click(object sender, EventArgs e)
        {
            AstroMod m_astro = new AstroMod();

            m_astro.type = PublicValue.AstroType.benming;
            #region 设置实体各种参数
            m_astro.birth = DateTime.Parse(HiddenField4.Value);
            SYS_DistrictMod dis = SYS_DistrictBll.GetInstance().GetModel(int.Parse(HiddenField2.Value));
            if (string.IsNullOrEmpty(dis.Latitude) || string.IsNullOrEmpty(dis.longitude))
            {
                SYS_DistrictMod tmp = SYS_DistrictBll.GetInstance().GetModel(dis.UpSysNo);
                dis.Latitude  = tmp.Latitude;
                dis.longitude = tmp.longitude;
            }
            m_astro.position = new LatLng(dis);
            if (HiddenField1.Value == "1")
            {
                m_astro.IsDayLight = AppEnum.BOOL.True;
            }
            else if (HiddenField1.Value == "0")
            {
                m_astro.IsDayLight = AppEnum.BOOL.False;
            }
            else
            {
                m_astro.IsDayLight = (AppEnum.BOOL)Convert.ToInt16(PublicDeal.GetInstance().IsDayLight(m_astro.birth, 0));
            }
            if (HiddenField6.Value == "g1")
            {
                m_astro.Gender = AppEnum.Gender.male;
            }
            else
            {
                m_astro.Gender = AppEnum.Gender.female;
            }

            m_astro.zone = -8;

            for (int i = 1; i < 21; i++)
            {
                m_astro.startsShow.Add(i, "");
            }
            m_astro.aspectsShow.Clear();
            for (int i = 1; i < 6; i++)
            {
                m_astro.aspectsShow.Add(i, 5);
            }
            #endregion

            AstroBiz.GetInstance().GetParamters(ref m_astro);
            Dictionary <PublicValue.AstroStar, Star> m_star = new Dictionary <PublicValue.AstroStar, Star>();
            foreach (Star tmpstar in m_astro.Stars)
            {
                m_star.Add(tmpstar.StarName, tmpstar);
            }
            string jsstr = "";
            //吉星
            List <PublicValue.AstroStar> goodstars = new List <PublicValue.AstroStar>();
            goodstars.Add(PublicValue.AstroStar.Jup);
            goodstars.Add(PublicValue.AstroStar.Ven);
            //凶星
            Dictionary <PublicValue.AstroStar, int> badstars = new Dictionary <PublicValue.AstroStar, int>();
            List <PublicValue.AstroStar>            tmpbad   = new List <PublicValue.AstroStar>();
            tmpbad.Add(PublicValue.AstroStar.Mar);
            tmpbad.Add(PublicValue.AstroStar.Sat);
            tmpbad.Add(PublicValue.AstroStar.Ura);
            tmpbad.Add(PublicValue.AstroStar.Nep);
            tmpbad.Add(PublicValue.AstroStar.Plu);
            List <PublicValue.AstroStar> twelve = PublicDeal.GetInstance().GetGongMasters(m_astro.Stars, 12, false);
            List <PublicValue.AstroStar> eight  = PublicDeal.GetInstance().GetGongMasters(m_astro.Stars, 8, false);
            List <PublicValue.AstroStar> seven  = PublicDeal.GetInstance().GetGongMasters(m_astro.Stars, 7, false);
            List <PublicValue.AstroStar> two    = PublicDeal.GetInstance().GetGongMasters(m_astro.Stars, 2, false);
            foreach (PublicValue.AstroStar tmp in tmpbad)
            {
                badstars.Add(tmp, 1);
            }
            foreach (PublicValue.AstroStar tmp in eight)
            {
                if (!tmpbad.Contains(tmp))
                {
                    if (!badstars.ContainsKey(tmp))
                    {
                        badstars.Add(tmp, 1);
                    }
                }
                else
                {
                    badstars[tmp]++;
                }
            }
            foreach (PublicValue.AstroStar tmp in twelve)
            {
                if (!tmpbad.Contains(tmp))
                {
                    if (!badstars.ContainsKey(tmp))
                    {
                        badstars.Add(tmp, 1);
                    }
                }
                else
                {
                    badstars[tmp]++;
                }
            }
            List <PublicValue.AstroStar> mingzhu = PublicDeal.GetInstance().GetGongMasters(m_astro.Stars, 1, false);
            foreach (PublicValue.AstroStar tmp in mingzhu)
            {
                if (!tmpbad.Contains(tmp))
                {
                    if (!badstars.ContainsKey(tmp))
                    {
                        badstars.Add(tmp, 1);
                    }
                }
                else
                {
                    badstars[tmp]++;
                }
            }


            #region 花
            //Label1.Text = "1.金星星座为:" + PublicValue.GetConstellation(m_star[PublicValue.AstroStar.Ven].Constellation) + "<br/>";
            jsstr           += "showItem('hua', " + (int)m_star[PublicValue.AstroStar.Ven].Constellation + ");";
            ViewState["hua"] = (int)m_star[PublicValue.AstroStar.Ven].Constellation;
            #endregion

            #region 金星元素
            int venusEle = 0;
            venusEle = (int)PublicDeal.GetInstance().GetConstellationElement(m_star[PublicValue.AstroStar.Ven].Constellation);
            //Label1.Text += "2.金星星座元素为:" + PublicValue.GetElement(PublicDeal.GetInstance().GetConstellationElement(m_star[PublicValue.AstroStar.Ven].Constellation)) + "<br />";
            #endregion

            #region 红杏
            bool hongxing = false;
            if (PublicDeal.GetInstance().HasPhase(m_star[PublicValue.AstroStar.Ven], m_star[PublicValue.AstroStar.Jun], PublicValue.Phase.he, AppConst.DecimalNull) ||
                PublicDeal.GetInstance().HasPhase(m_star[PublicValue.AstroStar.Ven], m_star[PublicValue.AstroStar.Jun], PublicValue.Phase.chong, AppConst.DecimalNull) ||
                PublicDeal.GetInstance().HasPhase(m_star[PublicValue.AstroStar.Ven], m_star[PublicValue.AstroStar.Jun], PublicValue.Phase.xing, AppConst.DecimalNull))
            {
                hongxing = true;
            }
            ////Label1.Text += "金星:" + ((int)m_star[PublicValue.AstroStar.Ven].Constellation) * 30 + " " + m_star[PublicValue.AstroStar.Ven].Degree + " " + m_star[PublicValue.AstroStar.Ven].Cent / 60 * 100;
            ////Label1.Text += "婚神:" + ((int)m_star[PublicValue.AstroStar.Jun].Constellation) * 30 + " " + m_star[PublicValue.AstroStar.Jun].Degree + " " + m_star[PublicValue.AstroStar.Jun].Cent / 60 * 100;
            //Label1.Text += "3.是否有红杏:" + (hongxing==true ? "有" : "没有") + "<br />";
            jsstr += "showItem('hongxing', " + (hongxing == true ? "1" : "0") + ");";
            if (hongxing)
            {
                li5.Style["display"] = "";
            }
            #endregion

            #region 蜜蜂
            int beecount = 0;
            List <PublicValue.AstroStar> beestars = PublicDeal.GetInstance().GetGongMasters(m_astro.Stars, 7, false);
            //Label1.Text += "7宫主:";
            foreach (PublicValue.AstroStar tmpstar in beestars)
            {
                //Label1.Text += PublicValue.GetAstroStar(tmpstar);
            }
            //Label1.Text += "<br />";
            //Label1.Text += "凶星:";
            foreach (PublicValue.AstroStar tmpstar in badstars.Keys)
            {
                //Label1.Text += PublicValue.GetAstroStar(tmpstar);
            }
            //Label1.Text += "<br />";
            beestars.Add(PublicValue.AstroStar.Des);
            beestars.Add(PublicValue.AstroStar.Jun);
            foreach (PublicValue.AstroStar tmpstar in beestars)
            {
                int tmpflag = 0;
                if (tmpstar != goodstars[0] && PublicDeal.GetInstance().HasAnyMainPhase(m_star[tmpstar], m_star[goodstars[0]]))
                {
                    beecount++;
                    tmpflag = 1;
                }
                if (tmpstar != goodstars[1] && PublicDeal.GetInstance().HasAnyMainPhase(m_star[tmpstar], m_star[goodstars[1]]))
                {
                    beecount++;
                    if (tmpflag == 1)
                    {
                        beecount++;
                    }
                }
            }

            //Label1.Text += "4.蜜蜂指数为:" + beecount + "<br />";
            jsstr += "showItem('mifeng', " + (beecount + 1 > 3 ? 4 : beecount + 1) + ");";
            li1.Style["display"] = "";
            ViewState["bee"]     = beecount;
            #endregion



            #region 负面
            Dictionary <string, int> showele = new Dictionary <string, int>();
            showele.Add("paopao", 0);
            showele.Add("chongzi", 0);
            showele.Add("cu", 0);
            showele.Add("liehen", 0);
            showele.Add("bingdong", 0);
            showele.Add("zhezhi", 0);
            showele.Add("kuye", 0);

            List <PublicValue.AstroStar> breakstars = PublicDeal.GetInstance().GetGongMasters(m_astro.Stars, 7, false);
            breakstars.Add(PublicValue.AstroStar.Ven);
            breakstars.Add(PublicValue.AstroStar.Jun);
            breakstars.Add(PublicValue.AstroStar.Des);
            breakstars = breakstars.Distinct().ToList();
            foreach (PublicValue.AstroStar tmp in badstars.Keys)
            {
                //if (tmp != goodstars[0])
                //    continue;
                int tmpflag = 0;
                for (int i = 0; i < breakstars.Count; i++)
                {
                    if (PublicDeal.GetInstance().HasAnyBadPhase(m_star[tmp], m_star[breakstars[i]]))
                    {
                        bool Exact = false;
                        if (PublicDeal.GetInstance().HasAnyBadPhase(m_star[tmp], m_star[breakstars[i]], 1))
                        {
                            Exact = true;
                        }
                        switch (tmp)
                        {
                        case PublicValue.AstroStar.Mar:
                        case PublicValue.AstroStar.Sun:
                            showele["zhezhi"] += badstars[tmp];
                            if (Exact)
                            {
                                showele["zhezhi"]++;
                            }
                            break;

                        case PublicValue.AstroStar.Jup:
                        case PublicValue.AstroStar.Ven:
                            showele["kuye"] += badstars[tmp];
                            if (Exact)
                            {
                                showele["kuye"]++;
                            }
                            break;

                        case PublicValue.AstroStar.Sat:
                            showele["liehen"] += badstars[tmp];
                            if (Exact)
                            {
                                showele["liehen"]++;
                            }
                            break;

                        case PublicValue.AstroStar.Ura:
                            showele["bingdong"] += badstars[tmp];
                            if (Exact)
                            {
                                showele["bingdong"]++;
                            }
                            break;

                        case PublicValue.AstroStar.Nep:
                            showele["paopao"] += badstars[tmp];
                            if (Exact)
                            {
                                showele["paopao"]++;
                            }
                            break;

                        case PublicValue.AstroStar.Plu:
                        case PublicValue.AstroStar.Moo:
                            showele["cu"] += badstars[tmp];
                            if (Exact)
                            {
                                showele["cu"]++;
                            }
                            break;

                        case PublicValue.AstroStar.Mer:
                            showele["chongzi"] += badstars[tmp];
                            if (Exact)
                            {
                                showele["chongzi"]++;
                            }
                            break;
                        }
                        tmpflag++;
                        if (tmpflag > 1)
                        {
                            switch (tmp)
                            {
                            case PublicValue.AstroStar.Mar:
                            case PublicValue.AstroStar.Sun:
                                showele["zhezhi"]++;
                                break;

                            case PublicValue.AstroStar.Jup:
                            case PublicValue.AstroStar.Ven:
                                showele["kuye"]++;
                                break;

                            case PublicValue.AstroStar.Sat:
                                showele["liehen"]++;
                                break;

                            case PublicValue.AstroStar.Ura:
                                showele["bingdong"]++;
                                break;

                            case PublicValue.AstroStar.Nep:
                                showele["paopao"]++;
                                break;

                            case PublicValue.AstroStar.Plu:
                            case PublicValue.AstroStar.Moo:
                                showele["cu"]++;
                                break;

                            case PublicValue.AstroStar.Mer:
                                showele["chongzi"]++;
                                break;
                            }
                        }
                    }
                }
            }
            ////Label1.Text += "4.裂痕指数为:" + breakcount + "<br />";
            jsstr += "showItem('liehen', " + (showele["liehen"] > 3 ? 4 : showele["liehen"]) + ");";
            if (showele["liehen"] > 0)
            {
                li7.Style["display"] = "";
            }
            jsstr += "showItem('paopao', " + (showele["paopao"] > 3 ? 4 : showele["paopao"]) + ");";
            if (showele["paopao"] > 0)
            {
                li2.Style["display"] = "";
            }
            jsstr += "showItem('chongzi', " + (showele["chongzi"] > 2 ? 3 : showele["chongzi"]) + ");";
            if (showele["chongzi"] > 0)
            {
                li4.Style["display"] = "";
            }
            jsstr += "showItem('cu', " + (showele["cu"] > 2 ? 3 : showele["cu"]) + ");";
            if (showele["cu"] > 0)
            {
                li8.Style["display"] = "";
            }
            jsstr += "showItem('bingdong', " + (showele["bingdong"] > 2 ? 3 : showele["bingdong"]) + ");";
            if (showele["bingdong"] > 0)
            {
                li6.Style["display"] = "";
            }
            jsstr += "showItem('zhezhi', " + (showele["zhezhi"] > 4 ? 4 : showele["zhezhi"]) + ");";
            if (showele["zhezhi"] > 0)
            {
                li3.Style["display"] = "";
            }
            jsstr += "showItem('kuzhi', " + (showele["kuye"] > 3 ? 3 : showele["kuye"]) + ");";
            if (showele["kuye"] > 0)
            {
                li9.Style["display"] = "";
            }
            int totalbad = showele["paopao"] + showele["chongzi"] + showele["cu"] + showele["liehen"] + showele["bingdong"] + showele["zhezhi"] + showele["kuye"];
            span1.Style["width"] = ((4096 - totalbad * 128) / 32).ToString() + "px";
            ltr1.Text            = ((3200 - totalbad * 100) / 32).ToString();
            if (ltr1.Text == "0")
            {
                span1.Style["width"] = (1 * 128 / 100).ToString() + "px";
                ltr1.Text            = "1";
            }
            if (hongxing && int.Parse(ltr1.Text) >= 70)
            {
                ltr1.Text            = (int.Parse(ltr1.Text) - 15).ToString();
                span1.Style["width"] = (int.Parse(ltr1.Text) * 128 / 100).ToString() + "px";
            }
            if (int.Parse(ltr1.Text) > 100)
            {
                span1.Style["width"] = "128px";
                ltr1.Text            = "100";
            }
            ViewState["fumian"] = showele;
            ////Label1.Text += "5.泡泡:" + showele["paopao"] + "; 虫子:" + showele["chongzi"] + "; 醋:" + showele["cu"] + "; 裂痕:" + showele["liehen"] + "; 冰冻:" + showele["bingdong"] + "; 折枝:" + showele["zhezhi"] + "; 枯叶:" + showele["kuye"] + "<br />";
            #endregion

            #region 花盆
            int huapen = 1;
            if (totalbad >= 20)
            {
                huapen = 3;
            }
            else if ((totalbad >= 13 && totalbad < 20) || (hongxing && totalbad > 6))
            {
                huapen = 2;
            }
            //Label1.Text += "5.花盆为:" + huapen + "<br />";
            jsstr += "showItem('huapen', " + huapen + ");";
            #endregion

            #region 花心指数
            int flowercount = 0;
            foreach (PublicValue.AstroStar tmpstar in goodstars)
            {
                if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Jun], m_star[tmpstar]))
                {
                    flowercount++;
                }
                if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Chi], m_star[tmpstar]))
                {
                    flowercount++;
                }
                foreach (PublicValue.AstroStar tmpstarr in eight)
                {
                    if (tmpstar != tmpstarr && PublicDeal.GetInstance().HasAnyMainPhase(m_star[tmpstarr], m_star[tmpstar]))
                    {
                        flowercount++;
                    }
                }
            }
            if (m_star[PublicValue.AstroStar.Moo].Constellation == PublicValue.Constellation.Gem ||
                m_star[PublicValue.AstroStar.Moo].Constellation == PublicValue.Constellation.Sag ||
                m_star[PublicValue.AstroStar.Moo].Constellation == PublicValue.Constellation.Pis)
            {
                flowercount++;
            }
            if (m_star[PublicValue.AstroStar.Ven].Constellation == PublicValue.Constellation.Gem ||
                m_star[PublicValue.AstroStar.Ven].Constellation == PublicValue.Constellation.Sag ||
                m_star[PublicValue.AstroStar.Ven].Constellation == PublicValue.Constellation.Pis)
            {
                flowercount++;
            }
            if (m_star[PublicValue.AstroStar.Des].Constellation == PublicValue.Constellation.Gem ||
                m_star[PublicValue.AstroStar.Des].Constellation == PublicValue.Constellation.Sag ||
                m_star[PublicValue.AstroStar.Des].Constellation == PublicValue.Constellation.Pis)
            {
                flowercount++;
            }
            if (m_star[PublicValue.AstroStar.Moo].Gong == 12)
            {
                flowercount++;
            }
            if (m_star[PublicValue.AstroStar.Ven].Gong == 12)
            {
                flowercount++;
            }
            if (PublicDeal.GetInstance().GetConstellationElement(m_star[PublicValue.AstroStar.Sun].Constellation) == PublicValue.Element.wind && PublicDeal.GetInstance().GetConstellationElement(m_star[PublicValue.AstroStar.Moo].Constellation) == PublicValue.Element.earth)
            {
                flowercount++;
            }
            if (PublicDeal.GetInstance().GetConstellationElement(m_star[PublicValue.AstroStar.Sun].Constellation) == PublicValue.Element.fire && PublicDeal.GetInstance().GetConstellationElement(m_star[PublicValue.AstroStar.Moo].Constellation) == PublicValue.Element.wind)
            {
                flowercount++;
            }
            if (m_astro.Gender == AppEnum.Gender.male)
            {
                flowercount++;
            }
            span3.Style["width"] = (flowercount * 128 / 10).ToString() + "px";
            ltr3.Text            = (flowercount * 100 / 10).ToString();
            if (ltr3.Text == "0")
            {
                span3.Style["width"] = (1 * 128 / 100).ToString() + "px";
                ltr3.Text            = "1";
            }
            if (int.Parse(ltr3.Text) > 100)
            {
                span3.Style["width"] = "128px";
                ltr3.Text            = "100";
            }
            //Label1.Text += "5.花心指数为:" + flowercount + "<br />";
            #endregion

            #region 魅力指数
            int meilicount = beecount;
            if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Ura], m_star[PublicValue.AstroStar.For]))
            {
                meilicount++;
            }
            if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Ura], m_star[PublicValue.AstroStar.Ven]))
            {
                meilicount++;
            }
            if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.For], m_star[PublicValue.AstroStar.Ven]))
            {
                meilicount++;
            }
            if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Sun], m_star[PublicValue.AstroStar.Jup]))
            {
                meilicount++;
            }
            span2.Style["width"] = (meilicount * 128 / 12).ToString() + "px";
            ltr2.Text            = (meilicount * 100 / 12).ToString();
            if (ltr2.Text == "0")
            {
                span2.Style["width"] = (1 * 128 / 100).ToString() + "px";
                ltr2.Text            = "1";
            }
            if (int.Parse(ltr2.Text) > 100)
            {
                span2.Style["width"] = "128px";
                ltr2.Text            = "100";
            }

            #endregion

            #region 对方有钱
            int richcount = PublicDeal.GetInstance().GetGongPower(m_astro.Stars, 8);
            if (richcount > 15)
            {
                richcount = 15;
            }
            foreach (PublicValue.AstroStar tmpstar in seven)
            {
                if (m_star[tmpstar].Gong == 8 || m_star[tmpstar].Gong == 7)
                {
                    richcount = richcount + 5;
                }
            }
            foreach (PublicValue.AstroStar tmpstar in eight)
            {
                if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Jun], m_star[tmpstar]) && PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.For], m_star[tmpstar]))
                {
                    richcount = richcount + 5;
                }
                if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.For], m_star[tmpstar]) && PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Jun], m_star[PublicValue.AstroStar.For]))
                {
                    richcount = richcount + 5;
                }
                if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Jun], m_star[tmpstar]) && PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Jun], m_star[PublicValue.AstroStar.For]))
                {
                    richcount = richcount + 5;
                }
            }
            foreach (PublicValue.AstroStar tmpstar in two)
            {
                if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Jun], m_star[tmpstar]) && PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.For], m_star[tmpstar]))
                {
                    richcount = richcount + 5;
                }
                if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.For], m_star[tmpstar]) && PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Jun], m_star[PublicValue.AstroStar.For]))
                {
                    richcount = richcount + 5;
                }
                if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Jun], m_star[tmpstar]) && PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Jun], m_star[PublicValue.AstroStar.For]))
                {
                    richcount = richcount + 5;
                }
            }
            if (m_star[PublicValue.AstroStar.Jun].Gong == 11)
            {
                richcount = richcount + 5;
            }
            if (m_star[PublicValue.AstroStar.Ura].Gong == 8)
            {
                richcount = richcount + 5;
            }

            span4.Style["width"] = (richcount * 128 / 30).ToString() + "px";
            ltr4.Text            = (richcount * 100 / 30).ToString();
            if (ltr4.Text == "0")
            {
                span4.Style["width"] = (1 * 128 / 100).ToString() + "px";
                ltr4.Text            = "1";
            }
            if (int.Parse(ltr4.Text) > 100)
            {
                span4.Style["width"] = "128px";
                ltr4.Text            = "100";
            }
            //Label1.Text += "6.对方有钱指数为:" + richcount + "<br />";
            //测试显示互溶关系
            List <List <PublicValue.AstroStar> > hurong = PublicDeal.GetInstance().GetHuRong(m_astro.Stars, true);
            foreach (List <PublicValue.AstroStar> tmplist in hurong)
            {
                foreach (PublicValue.AstroStar tmpstar in tmplist)
                {
                    //Label1.Text += PublicValue.GetAstroStar(tmpstar) + "->";
                }
                //Label1.Text += "<br />";
            }
            #endregion
            jsstr += @"$("".f-box"").children(""div:not(0)"").children(""div"").each(function () {
                                        if (!$(this).is(':has(a)')&&$(this).attr(""id"")!='nohover') {
                                            $(this).bind(""mouseenter"", function () {
                                                $(this).css(""cursor"", ""pointer"")
                                                var bgimg = $(this).css(""background-image"");
                                                bgimg = bgimg.replace("".png"", ""_on.png"");
                                                $(this).css(""background-image"", bgimg);
                                            }).bind(""mouseleave"", function () { 
                                                $(this).attr(""style"", "" "");
                                                $(this).css(""display"", ""block"");
                                            })
                                        }
                                        else {
                                            //蜜蜂等区域热点
                                            $(this).children(""a"").bind(""mouseenter"", function () {
                                                var bgimg = $(this).parent().css(""background-image"");
                                                bgimg = bgimg.replace("".png"", ""_on.png"");
                                                $(this).parent().css(""background-image"", bgimg);
                                            }).bind(""mouseleave"", function () {
                                                $(this).parent().attr(""style"", "" "");
                                                $(this).parent().css(""display"", ""block"");
                                            })

                                        }

                                    })";
            ScriptManager.RegisterStartupScript(Page, this.GetType(), "show", jsstr, true);
            tip.Style["display"]       = "none";
            ViewState["jsstr"]         = jsstr;
            MultiView1.ActiveViewIndex = 1;

            //Page.ClientScript.RegisterStartupScript(this.GetType(), "showflash",
            //        @"swfobject.embedSWF('LoveRose.swf', 'flashmov', '816', '459', '9.0.0',null,{ele:'"+ele+"'});",true);

            #region 记录用户数据
            LoveRoseMod m_record = new LoveRoseMod();
            m_record.Area      = int.Parse(HiddenField2.Value);
            m_record.BirthTime = m_astro.birth;
            m_record.Source    = (int)AppEnum.AppsSourceType.qq;
            m_record.TS        = DateTime.Now;
            LoveRoseBll.GetInstance().Add(m_record);
            #endregion

            #region 显示信息
            ltrInfo.Text = m_astro.birth.ToString("yyyy年MM月dd日 HH:mm") + @"
                    <br />
                    性别:" + AppEnum.GetGender(m_astro.Gender) + @"<br />
                    所属时区: " + (m_astro.zone > 0 ? "西" + m_astro.zone.ToString() : "东" + m_astro.zone.ToString()) + @"区<br />
                    夏令时:" + (((int)m_astro.IsDayLight) == 1 ? "是" : "否") + @"
                    <br />
                    出生地: " + m_astro.position.name.Remove(m_astro.position.name.LastIndexOf("-")) + @"
                    <br />
                    (经度" + m_astro.position.Lng + @"&nbsp;纬度" + m_astro.position.Lat + @")
                    <br />";
            #endregion

            HyperLink1.NavigateUrl = "http://share.v.t.qq.com/index.php?c=share&a=index&url=" + Server.UrlEncode("http://astro.fashion.qq.com/app/aiqinghua.htm") +
                                     "&pic=" + Server.UrlEncode("../WebResources/Images/LoveRose/img/share" + ViewState["hua"].ToString() + ".jpg") + "&appkey=801402959&title=" + Server.UrlEncode("#腾讯星座爱情花# " + AppCmn.CommonTools.CutStr(content[int.Parse(ViewState["hua"].ToString()) - 1, 0], 50) + " 嘿嘿~这是我的爱情花!我的爱情婚姻原来是这样的。挺有意思,你也来玩玩吧!") + "&line1=&line2=&line3=";
        }
示例#10
0
        protected void Unnamed1_Click(object sender, EventArgs e)
        {
            AstroMod m_astro = new AstroMod();
            m_astro.type = PublicValue.AstroType.benming;
            #region 设置实体各种参数
            m_astro.birth = DateTime.Parse(HiddenField4.Value);
            SYS_DistrictMod dis = SYS_DistrictBll.GetInstance().GetModel(int.Parse(HiddenField2.Value));
            if (string.IsNullOrEmpty(dis.Latitude) || string.IsNullOrEmpty(dis.longitude))
            {
                SYS_DistrictMod tmp = SYS_DistrictBll.GetInstance().GetModel(dis.UpSysNo);
                dis.Latitude = tmp.Latitude;
                dis.longitude = tmp.longitude;
            }
            m_astro.position = new LatLng(dis);
            if (HiddenField1.Value == "1")
            {
                m_astro.IsDayLight = AppEnum.BOOL.True;
            }
            else if (HiddenField1.Value == "0")
            {
                m_astro.IsDayLight = AppEnum.BOOL.False;
            }
            else
            {
                m_astro.IsDayLight = (AppEnum.BOOL)Convert.ToInt16(PublicDeal.GetInstance().IsDayLight(m_astro.birth, 0));
            }
            if (HiddenField6.Value == "g1")
            {
                m_astro.Gender = AppEnum.Gender.male;
            }
            else
            {
                m_astro.Gender = AppEnum.Gender.female;
            }

            m_astro.zone = -8;

            for (int i = 1; i < 21; i++)
            {
                m_astro.startsShow.Add(i, "");
            }
            m_astro.aspectsShow.Clear();
            for (int i = 1; i < 6; i++)
            {
                m_astro.aspectsShow.Add(i, 5);
            }
            #endregion

            AstroBiz.GetInstance().GetParamters(ref m_astro);
            Dictionary<PublicValue.AstroStar, Star> m_star = new Dictionary<PublicValue.AstroStar, Star>();
            foreach (Star tmpstar in m_astro.Stars)
            {
                m_star.Add(tmpstar.StarName, tmpstar);
            }
            string jsstr = "";
            //吉星
            List<PublicValue.AstroStar> goodstars = new List<PublicValue.AstroStar>();
            goodstars.Add(PublicValue.AstroStar.Jup);
            goodstars.Add(PublicValue.AstroStar.Ven);
            //凶星
            Dictionary<PublicValue.AstroStar, int> badstars = new Dictionary<PublicValue.AstroStar, int>();
            List<PublicValue.AstroStar> tmpbad = new List<PublicValue.AstroStar>();
            tmpbad.Add(PublicValue.AstroStar.Mar);
            tmpbad.Add(PublicValue.AstroStar.Sat);
            tmpbad.Add(PublicValue.AstroStar.Ura);
            tmpbad.Add(PublicValue.AstroStar.Nep);
            tmpbad.Add(PublicValue.AstroStar.Plu);
            List<PublicValue.AstroStar> twelve = PublicDeal.GetInstance().GetGongMasters(m_astro.Stars, 12, false);
            List<PublicValue.AstroStar> eight = PublicDeal.GetInstance().GetGongMasters(m_astro.Stars, 8, false);
            List<PublicValue.AstroStar> seven = PublicDeal.GetInstance().GetGongMasters(m_astro.Stars, 7, false);
            List<PublicValue.AstroStar> two = PublicDeal.GetInstance().GetGongMasters(m_astro.Stars, 2, false);
            foreach (PublicValue.AstroStar tmp in tmpbad)
            {
                badstars.Add(tmp, 1);
            }
            foreach (PublicValue.AstroStar tmp in eight)
            {
                if (!tmpbad.Contains(tmp))
                {
                    if (!badstars.ContainsKey(tmp))
                    badstars.Add(tmp, 1);
                }
                else
                {
                    badstars[tmp]++;
                }
            }
            foreach (PublicValue.AstroStar tmp in twelve)
            {
                if (!tmpbad.Contains(tmp))
                {
                    if (!badstars.ContainsKey(tmp))
                    badstars.Add(tmp, 1);
                }
                else
                {
                    badstars[tmp]++;
                }
            }
            List<PublicValue.AstroStar> mingzhu = PublicDeal.GetInstance().GetGongMasters(m_astro.Stars, 1, false);
            foreach (PublicValue.AstroStar tmp in mingzhu)
            {
                if (!tmpbad.Contains(tmp))
                {
                    if (!badstars.ContainsKey(tmp))
                    badstars.Add(tmp, 1);
                }
                else
                {
                    badstars[tmp]++;
                }
            }

            #region 花
            //Label1.Text = "1.金星星座为:" + PublicValue.GetConstellation(m_star[PublicValue.AstroStar.Ven].Constellation) + "<br/>";
            jsstr += "showItem('hua', " + (int)m_star[PublicValue.AstroStar.Ven].Constellation + ");";
            ViewState["hua"] = (int)m_star[PublicValue.AstroStar.Ven].Constellation;
            #endregion

            #region 金星元素
            int venusEle = 0;
            venusEle = (int)PublicDeal.GetInstance().GetConstellationElement(m_star[PublicValue.AstroStar.Ven].Constellation);
            //Label1.Text += "2.金星星座元素为:" + PublicValue.GetElement(PublicDeal.GetInstance().GetConstellationElement(m_star[PublicValue.AstroStar.Ven].Constellation)) + "<br />";
            #endregion

            #region 红杏
            bool hongxing = false;
            if (PublicDeal.GetInstance().HasPhase(m_star[PublicValue.AstroStar.Ven], m_star[PublicValue.AstroStar.Jun], PublicValue.Phase.he, AppConst.DecimalNull)
                || PublicDeal.GetInstance().HasPhase(m_star[PublicValue.AstroStar.Ven], m_star[PublicValue.AstroStar.Jun], PublicValue.Phase.chong, AppConst.DecimalNull)
                || PublicDeal.GetInstance().HasPhase(m_star[PublicValue.AstroStar.Ven], m_star[PublicValue.AstroStar.Jun], PublicValue.Phase.xing, AppConst.DecimalNull))
            {
                hongxing = true;
            }
            ////Label1.Text += "金星:" + ((int)m_star[PublicValue.AstroStar.Ven].Constellation) * 30 + " " + m_star[PublicValue.AstroStar.Ven].Degree + " " + m_star[PublicValue.AstroStar.Ven].Cent / 60 * 100;
            ////Label1.Text += "婚神:" + ((int)m_star[PublicValue.AstroStar.Jun].Constellation) * 30 + " " + m_star[PublicValue.AstroStar.Jun].Degree + " " + m_star[PublicValue.AstroStar.Jun].Cent / 60 * 100;
            //Label1.Text += "3.是否有红杏:" + (hongxing==true ? "有" : "没有") + "<br />";
            jsstr += "showItem('hongxing', " + (hongxing == true ? "1" : "0") + ");";
            if (hongxing)
            {
                li5.Style["display"] = "";
            }
            #endregion

            #region 蜜蜂
            int beecount = 0;
            List<PublicValue.AstroStar> beestars = PublicDeal.GetInstance().GetGongMasters(m_astro.Stars, 7, false);
            //Label1.Text += "7宫主:";
            foreach (PublicValue.AstroStar tmpstar in beestars)
            {
                //Label1.Text += PublicValue.GetAstroStar(tmpstar);
            }
            //Label1.Text += "<br />";
            //Label1.Text += "凶星:";
            foreach (PublicValue.AstroStar tmpstar in badstars.Keys)
            {
                //Label1.Text += PublicValue.GetAstroStar(tmpstar);
            }
            //Label1.Text += "<br />";
            beestars.Add(PublicValue.AstroStar.Des);
            beestars.Add(PublicValue.AstroStar.Jun);
            foreach (PublicValue.AstroStar tmpstar in beestars)
            {
                int tmpflag = 0;
                if (tmpstar!=goodstars[0]&&PublicDeal.GetInstance().HasAnyMainPhase(m_star[tmpstar], m_star[goodstars[0]]))
                {
                    beecount++;
                    tmpflag = 1;
                }
                if (tmpstar != goodstars[1] && PublicDeal.GetInstance().HasAnyMainPhase(m_star[tmpstar], m_star[goodstars[1]]))
                {
                    beecount++;
                    if (tmpflag == 1)
                    {
                        beecount++;
                    }
                }
            }

            //Label1.Text += "4.蜜蜂指数为:" + beecount + "<br />";
            jsstr += "showItem('mifeng', " + (beecount + 1 > 3 ? 4 : beecount + 1) + ");";
            li1.Style["display"] = "";
            ViewState["bee"] = beecount;
            #endregion

            #region 负面
            Dictionary<string, int> showele = new Dictionary<string, int>();
            showele.Add("paopao", 0);
            showele.Add("chongzi", 0);
            showele.Add("cu", 0);
            showele.Add("liehen", 0);
            showele.Add("bingdong", 0);
            showele.Add("zhezhi", 0);
            showele.Add("kuye", 0);

            List<PublicValue.AstroStar> breakstars = PublicDeal.GetInstance().GetGongMasters(m_astro.Stars, 7, false);
            breakstars.Add(PublicValue.AstroStar.Ven);
            breakstars.Add(PublicValue.AstroStar.Jun);
            breakstars.Add(PublicValue.AstroStar.Des);
            breakstars = breakstars.Distinct().ToList();
            foreach (PublicValue.AstroStar tmp in badstars.Keys)
            {
                //if (tmp != goodstars[0])
                //    continue;
                int tmpflag = 0;
                for (int i = 0; i < breakstars.Count; i++)
                {
                    if (PublicDeal.GetInstance().HasAnyBadPhase(m_star[tmp], m_star[breakstars[i]]))
                    {
                        bool Exact = false;
                        if (PublicDeal.GetInstance().HasAnyBadPhase(m_star[tmp], m_star[breakstars[i]], 1))
                        {
                            Exact = true;
                        }
                        switch (tmp)
                        {
                            case PublicValue.AstroStar.Mar:
                            case PublicValue.AstroStar.Sun:
                                showele["zhezhi"]+=badstars[tmp];
                                if (Exact)
                                    showele["zhezhi"]++;
                                break;
                            case PublicValue.AstroStar.Jup:
                            case PublicValue.AstroStar.Ven:
                                showele["kuye"] += badstars[tmp];
                                    if (Exact)
                                        showele["kuye"]++;
                                break;
                            case PublicValue.AstroStar.Sat:
                                showele["liehen"] += badstars[tmp];
                                if (Exact)
                                    showele["liehen"]++;
                                break;
                            case PublicValue.AstroStar.Ura:
                                showele["bingdong"] += badstars[tmp];
                                if (Exact)
                                    showele["bingdong"]++;
                                break;
                            case PublicValue.AstroStar.Nep:
                                showele["paopao"] += badstars[tmp];
                                if (Exact)
                                    showele["paopao"]++;
                                break;
                            case PublicValue.AstroStar.Plu:
                            case PublicValue.AstroStar.Moo:
                                showele["cu"] += badstars[tmp];
                                if (Exact)
                                    showele["cu"]++;
                                break;
                            case PublicValue.AstroStar.Mer:
                                showele["chongzi"] += badstars[tmp];
                                if (Exact)
                                    showele["chongzi"]++;
                                break;
                        }
                        tmpflag++;
                        if(tmpflag > 1)
                        {
                            switch (tmp)
                            {
                                case PublicValue.AstroStar.Mar:
                                case PublicValue.AstroStar.Sun:
                                    showele["zhezhi"]++;
                                    break;
                                case PublicValue.AstroStar.Jup:
                                case PublicValue.AstroStar.Ven:
                                    showele["kuye"]++;
                                    break;
                                case PublicValue.AstroStar.Sat:
                                    showele["liehen"]++;
                                    break;
                                case PublicValue.AstroStar.Ura:
                                    showele["bingdong"]++;
                                    break;
                                case PublicValue.AstroStar.Nep:
                                    showele["paopao"]++;
                                    break;
                                case PublicValue.AstroStar.Plu:
                                case PublicValue.AstroStar.Moo:
                                    showele["cu"]++;
                                    break;
                                case PublicValue.AstroStar.Mer:
                                    showele["chongzi"]++;
                                    break;
                            }
                        }

                    }
                }
            }
            ////Label1.Text += "4.裂痕指数为:" + breakcount + "<br />";
            jsstr += "showItem('liehen', " + (showele["liehen"] > 3 ? 4 : showele["liehen"]) + ");";
            if (showele["liehen"] > 0)
            {
                li7.Style["display"] = "";
            }
            jsstr += "showItem('paopao', " + (showele["paopao"] > 3 ? 4 : showele["paopao"]) + ");";
            if (showele["paopao"] > 0)
            {
                li2.Style["display"] = "";
            }
            jsstr += "showItem('chongzi', " + (showele["chongzi"] > 2 ? 3 : showele["chongzi"]) + ");";
            if (showele["chongzi"] > 0)
            {
                li4.Style["display"] = "";
            }
            jsstr += "showItem('cu', " + (showele["cu"] > 2 ? 3 : showele["cu"]) + ");";
            if (showele["cu"] > 0)
            {
                li8.Style["display"] = "";
            }
            jsstr += "showItem('bingdong', " + (showele["bingdong"] > 2 ? 3 : showele["bingdong"]) + ");";
            if (showele["bingdong"] > 0)
            {
                li6.Style["display"] = "";
            }
            jsstr += "showItem('zhezhi', " + (showele["zhezhi"] > 4 ? 4 : showele["zhezhi"]) + ");";
            if (showele["zhezhi"] > 0)
            {
                li3.Style["display"] = "";
            }
            jsstr += "showItem('kuzhi', " + (showele["kuye"] > 3 ? 3 : showele["kuye"]) + ");";
            if (showele["kuye"] > 0)
            {
                li9.Style["display"] = "";
            }
            int totalbad = showele["paopao"] + showele["chongzi"] + showele["cu"] + showele["liehen"] + showele["bingdong"] + showele["zhezhi"] + showele["kuye"];
            span1.Style["width"] = ((4096 -totalbad * 128) / 32).ToString() + "px";
            ltr1.Text = ((3200-totalbad * 100) / 32).ToString();
            if (ltr1.Text == "0")
            {
                span1.Style["width"] = (1 * 128 / 100).ToString() + "px";
                ltr1.Text = "1";
            }
            if (hongxing && int.Parse(ltr1.Text) >= 70)
            {
                ltr1.Text = (int.Parse(ltr1.Text) - 15).ToString();
                span1.Style["width"] = (int.Parse(ltr1.Text) * 128 / 100).ToString() + "px";
            }
            if (int.Parse(ltr1.Text) > 100)
            {
                span1.Style["width"] = "128px";
                ltr1.Text = "100";
            }
            ViewState["fumian"] = showele;
            ////Label1.Text += "5.泡泡:" + showele["paopao"] + "; 虫子:" + showele["chongzi"] + "; 醋:" + showele["cu"] + "; 裂痕:" + showele["liehen"] + "; 冰冻:" + showele["bingdong"] + "; 折枝:" + showele["zhezhi"] + "; 枯叶:" + showele["kuye"] + "<br />";
            #endregion

            #region 花盆
            int huapen = 1;
            if (totalbad >= 20)
            {
                huapen = 3;
            }
            else if ((totalbad >= 13 && totalbad < 20) || (hongxing && totalbad > 6))
            {
                huapen = 2;
            }
            //Label1.Text += "5.花盆为:" + huapen + "<br />";
            jsstr += "showItem('huapen', " + huapen + ");";
            #endregion

            #region 花心指数
            int flowercount = 0;
            foreach (PublicValue.AstroStar tmpstar in goodstars)
            {
                if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Jun], m_star[tmpstar]))
                {
                    flowercount++;
                }
                if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Chi], m_star[tmpstar]))
                {
                    flowercount++;
                }
                foreach (PublicValue.AstroStar tmpstarr in eight)
                {
                    if (tmpstar != tmpstarr && PublicDeal.GetInstance().HasAnyMainPhase(m_star[tmpstarr], m_star[tmpstar]))
                    {
                        flowercount++;
                    }
                }
            }
            if(m_star[PublicValue.AstroStar.Moo].Constellation==PublicValue.Constellation.Gem ||
                m_star[PublicValue.AstroStar.Moo].Constellation==PublicValue.Constellation.Sag ||
                m_star[PublicValue.AstroStar.Moo].Constellation==PublicValue.Constellation.Pis )
            {
                flowercount++;
            }
            if (m_star[PublicValue.AstroStar.Ven].Constellation == PublicValue.Constellation.Gem ||
               m_star[PublicValue.AstroStar.Ven].Constellation == PublicValue.Constellation.Sag ||
               m_star[PublicValue.AstroStar.Ven].Constellation == PublicValue.Constellation.Pis)
            {
                flowercount++;
            }
            if (m_star[PublicValue.AstroStar.Des].Constellation == PublicValue.Constellation.Gem ||
                m_star[PublicValue.AstroStar.Des].Constellation == PublicValue.Constellation.Sag ||
                m_star[PublicValue.AstroStar.Des].Constellation == PublicValue.Constellation.Pis)
            {
                flowercount++;
            }
            if (m_star[PublicValue.AstroStar.Moo].Gong == 12 )
            {
                flowercount++;
            }
            if (m_star[PublicValue.AstroStar.Ven].Gong == 12)
            {
                flowercount++;
            }
            if (PublicDeal.GetInstance().GetConstellationElement(m_star[PublicValue.AstroStar.Sun].Constellation) == PublicValue.Element.wind && PublicDeal.GetInstance().GetConstellationElement(m_star[PublicValue.AstroStar.Moo].Constellation) == PublicValue.Element.earth)
            {
                flowercount++;
            }
            if (PublicDeal.GetInstance().GetConstellationElement(m_star[PublicValue.AstroStar.Sun].Constellation) == PublicValue.Element.fire && PublicDeal.GetInstance().GetConstellationElement(m_star[PublicValue.AstroStar.Moo].Constellation) == PublicValue.Element.wind)
            {
                flowercount++;
            }
            if (m_astro.Gender == AppEnum.Gender.male)
            {
                flowercount++;
            }
            span3.Style["width"] = (flowercount * 128 / 10).ToString() + "px";
            ltr3.Text = (flowercount * 100 / 10).ToString();
            if (ltr3.Text == "0")
            {
                span3.Style["width"] = (1 * 128 / 100).ToString() + "px";
                ltr3.Text = "1";
            }
            if (int.Parse(ltr3.Text) > 100)
            {
                span3.Style["width"] = "128px";
                ltr3.Text = "100";
            }
            //Label1.Text += "5.花心指数为:" + flowercount + "<br />";
            #endregion

            #region 魅力指数
            int meilicount = beecount;
            if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Ura], m_star[PublicValue.AstroStar.For]))
            {
                meilicount++;
            }
            if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Ura], m_star[PublicValue.AstroStar.Ven]))
            {
                meilicount++;
            }
            if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.For], m_star[PublicValue.AstroStar.Ven]))
            {
                meilicount++;
            }
            if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Sun], m_star[PublicValue.AstroStar.Jup]))
            {
                meilicount++;
            }
            span2.Style["width"] = (meilicount * 128 / 12).ToString() + "px";
            ltr2.Text = (meilicount * 100 / 12).ToString();
            if (ltr2.Text == "0")
            {
                span2.Style["width"] = (1 * 128 / 100).ToString() + "px";
                ltr2.Text = "1";
            }
            if (int.Parse(ltr2.Text) > 100)
            {
                span2.Style["width"] = "128px";
                ltr2.Text = "100";
            }

            #endregion

            #region 对方有钱
            int richcount = PublicDeal.GetInstance().GetGongPower(m_astro.Stars, 8);
            if (richcount > 15)
            {
                richcount = 15;
            }
            foreach (PublicValue.AstroStar tmpstar in seven)
            {
                if (m_star[tmpstar].Gong == 8||m_star[tmpstar].Gong == 7)
                {
                    richcount = richcount + 5;
                }
            }
            foreach (PublicValue.AstroStar tmpstar in eight)
            {
                if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Jun], m_star[tmpstar]) && PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.For], m_star[tmpstar]))
                {
                    richcount=richcount+5;
                }
                if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.For], m_star[tmpstar]) && PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Jun], m_star[PublicValue.AstroStar.For]))
                {
                    richcount = richcount + 5;
                }
                if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Jun], m_star[tmpstar]) && PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Jun], m_star[PublicValue.AstroStar.For]))
                {
                    richcount = richcount + 5;
                }
            }
            foreach (PublicValue.AstroStar tmpstar in two)
            {
                if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Jun], m_star[tmpstar]) && PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.For], m_star[tmpstar]))
                {
                    richcount = richcount + 5;
                }
                if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.For], m_star[tmpstar]) && PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Jun], m_star[PublicValue.AstroStar.For]))
                {
                    richcount = richcount + 5;
                }
                if (PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Jun], m_star[tmpstar]) && PublicDeal.GetInstance().HasAnyMainPhase(m_star[PublicValue.AstroStar.Jun], m_star[PublicValue.AstroStar.For]))
                {
                    richcount = richcount + 5;
                }
            }
            if (m_star[PublicValue.AstroStar.Jun].Gong==11)
            {
                richcount = richcount + 5;
            }
            if (m_star[PublicValue.AstroStar.Ura].Gong==8)
            {
                richcount = richcount + 5;
            }

            span4.Style["width"] = (richcount * 128 / 30).ToString() + "px";
            ltr4.Text = (richcount * 100 / 30).ToString();
            if (ltr4.Text == "0")
            {
                span4.Style["width"] = (1 * 128 / 100).ToString() + "px";
                ltr4.Text = "1";
            }
            if (int.Parse(ltr4.Text) > 100)
            {
                span4.Style["width"] = "128px";
                ltr4.Text = "100";
            }
            //Label1.Text += "6.对方有钱指数为:" + richcount + "<br />";
            //测试显示互溶关系
            List<List<PublicValue.AstroStar>> hurong = PublicDeal.GetInstance().GetHuRong(m_astro.Stars, true);
            foreach (List<PublicValue.AstroStar> tmplist in hurong)
            {
                foreach (PublicValue.AstroStar tmpstar in tmplist)
                {
                    //Label1.Text += PublicValue.GetAstroStar(tmpstar) + "->";
                }
                //Label1.Text += "<br />";
            }
            #endregion
            jsstr += @"$("".f-box"").children(""div:not(0)"").children(""div"").each(function () {
                                        if (!$(this).is(':has(a)')&&$(this).attr(""id"")!='nohover') {
                                            $(this).bind(""mouseenter"", function () {
                                                $(this).css(""cursor"", ""pointer"")
                                                var bgimg = $(this).css(""background-image"");
                                                bgimg = bgimg.replace("".png"", ""_on.png"");
                                                $(this).css(""background-image"", bgimg);
                                            }).bind(""mouseleave"", function () {
                                                $(this).attr(""style"", "" "");
                                                $(this).css(""display"", ""block"");
                                            })
                                        }
                                        else {
                                            //蜜蜂等区域热点
                                            $(this).children(""a"").bind(""mouseenter"", function () {
                                                var bgimg = $(this).parent().css(""background-image"");
                                                bgimg = bgimg.replace("".png"", ""_on.png"");
                                                $(this).parent().css(""background-image"", bgimg);
                                            }).bind(""mouseleave"", function () {
                                                $(this).parent().attr(""style"", "" "");
                                                $(this).parent().css(""display"", ""block"");
                                            })

                                        }

                                    })";
            ScriptManager.RegisterStartupScript(Page, this.GetType(), "show", jsstr, true);
            tip.Style["display"] = "none";
            ViewState["jsstr"] = jsstr;
            MultiView1.ActiveViewIndex = 1;

            //Page.ClientScript.RegisterStartupScript(this.GetType(), "showflash",
            //        @"swfobject.embedSWF('LoveRose.swf', 'flashmov', '816', '459', '9.0.0',null,{ele:'"+ele+"'});",true);

            #region 记录用户数据
            LoveRoseMod m_record = new LoveRoseMod();
            m_record.Area = int.Parse(HiddenField2.Value);
            m_record.BirthTime = m_astro.birth;
            m_record.Source = (int)AppEnum.AppsSourceType.qq;
            m_record.TS = DateTime.Now;
            LoveRoseBll.GetInstance().Add(m_record);
            #endregion

            #region 显示信息
            ltrInfo.Text = m_astro.birth.ToString("yyyy年MM月dd日 HH:mm") + @"
                    <br />
                    性别:"+AppEnum.GetGender(m_astro.Gender)+@"<br />
                    所属时区: " + (m_astro.zone > 0 ? "西" + m_astro.zone.ToString() : "东" + m_astro.zone.ToString()) + @"区<br />
                    夏令时:" + (((int)m_astro.IsDayLight) == 1 ? "是" : "否") + @"
                    <br />
                    出生地: " + m_astro.position.name.Remove(m_astro.position.name.LastIndexOf("-")) + @"
                    <br />
                    (经度" + m_astro.position.Lng + @"&nbsp;纬度" + m_astro.position.Lat + @")
                    <br />";
            #endregion

            HyperLink1.NavigateUrl = "http://share.v.t.qq.com/index.php?c=share&a=index&url=" + Server.UrlEncode("http://astro.fashion.qq.com/app/aiqinghua.htm") +
                    "&pic=" + Server.UrlEncode("../WebResources/Images/LoveRose/img/share" + ViewState["hua"].ToString() + ".jpg") + "&appkey=801402959&title=" + Server.UrlEncode("#腾讯星座爱情花# " + AppCmn.CommonTools.CutStr(content[int.Parse(ViewState["hua"].ToString()) - 1, 0], 50) + " 嘿嘿~这是我的爱情花!我的爱情婚姻原来是这样的。挺有意思,你也来玩玩吧!") + "&line1=&line2=&line3=";
        }
示例#11
0
        /// <summary>
        /// 更新一条数据
        /// </summary>

        public void Update(LoveRoseMod model)
        {
            dal.Update(model);
        }
示例#12
0
        /// <summary>
        /// 增加一条数据
        /// </summary>

        public int Add(LoveRoseMod model)
        {
            return(dal.Add(model));
        }