/// <summary>
        /// 用于赋予datatable后初始化页面,其中本命盘显示本命盘,合盘则显示比较盘
        /// </summary>
        public void InitialChart()
        {
            if (_input == null || _input.CharType == null)
            {
                return;
            }

            _m_bazi = new BaZiMod();
            #region 设置实体各种参数
            string[] tmplatlng = _input.FirstPoi.ToString().Split(new char[] { '|' });
            m_bazi.BirthTime = new DateEntity(_realtime ? PublicDeal.GetInstance().RealTime(DateTime.Parse(_input.FirstBirth.ToString()),
                                                                                            new LatLng(tmplatlng[1], tmplatlng[0], _input.FirstPoiName)) : DateTime.Parse(_input.FirstBirth.ToString()));
            m_bazi.AreaName  = _input.FirstPoiName.ToString();
            m_bazi.Longitude = tmplatlng[0];
            m_bazi.Gender    = (AppEnum.Gender)_input.FirstGender;
            SetBenMing();

            if (_input.CharType.ToString() == ((int)AppEnum.ChartType.relation).ToString())
            {
                tmplatlng        = _input.SecondPoi.ToString().Split(new char[] { '|' });
                m_bazi.BirthTime = new DateEntity(_realtime ? PublicDeal.GetInstance().RealTime(DateTime.Parse(_input.SecondBirth.ToString()),
                                                                                                new LatLng(tmplatlng[1], tmplatlng[0], _input.SecondPoiName)) : DateTime.Parse(_input.SecondBirth.ToString()));
                m_bazi.AreaName  = _input.SecondPoiName.ToString();
                m_bazi.Longitude = tmplatlng[0];
                m_bazi.Gender    = (AppEnum.Gender)_input.SecondGender;
                SetHePan();
            }
            #endregion
        }
Beispiel #2
0
        public ReturnValue <ZiWeiMod> TimeToZiWei(Stream openPageData)
        {
            ZiWeiMod     input      = new ZiWeiMod();
            int          nReadCount = 0;
            MemoryStream ms         = new MemoryStream();

            byte[] buffer = new byte[1024];
            while ((nReadCount = openPageData.Read(buffer, 0, 1024)) > 0)
            {
                ms.Write(buffer, 0, nReadCount);
            }
            byte[] byteJson = ms.ToArray();
            string textJson = System.Text.Encoding.Default.GetString(byteJson);

            input = (ZiWeiMod)XMS.Core.Json.JsonSerializer.Deserialize(textJson, typeof(ZiWeiMod));
            int[] _paras = { 1, 1, 0, 1 };
            if (input == null)
            {
                input             = new ZiWeiMod();
                input.BirthTime   = new PPLive.DateEntity(DateTime.Now);
                input.Gender      = AppEnum.Gender.male;
                input.Type        = 1;
                input.TransitTime = new DateEntity(new DateTime(2020, 1, 1));
            }
            else
            {
                _paras[0] = input.YueMa;
                _paras[1] = input.MingShenZhu;
                _paras[2] = input.ShiShang;
                _paras[3] = input.HuanYun;
                if (input.IsDayLight)
                {
                    input.BirthTime = new DateEntity(input.BirthTime.Date.AddHours(-1));
                }
                if (input.RealTime)
                {
                    input.BirthTime = new DateEntity(PublicDeal.GetInstance().RealTime(input.BirthTime.Date, new LatLng("30.00", input.Longitude, input.AreaName)));
                }
                else
                {
                    input.BirthTime = new PPLive.DateEntity(input.BirthTime.Date);
                }
            }
            if (input.Type == 0)
            {
                input = ZiWeiBiz.GetInstance().TimeToZiWei(input.BirthTime, input.Gender, _paras);
            }
            else
            {
                input = ZiWeiBiz.GetInstance().TransitToZiWei(input.BirthTime, input.TransitTime, input.Gender, _paras);
            }
            return(ReturnValue <ZiWeiMod> .Get200OK(input));
        }
Beispiel #3
0
        public ReturnValue <QA_QuestionShow <ZiWeiMod> > GetQuestionForZiWei(int sysno)
        {
            QA_QuestionMod             tmp = QA_QuestionBll.GetInstance().GetModel(sysno);
            QA_QuestionShow <ZiWeiMod> ret = new QA_QuestionShow <ZiWeiMod>();

            tmp.MemberwiseCopy(ret);

            USR_CustomerShow tmpu = new USR_CustomerShow();

            USR_CustomerBll.GetInstance().GetModel(ret.CustomerSysNo).MemberwiseCopy(tmpu);
            ret.Customer = tmpu;
            #region 设置命盘
            int[]         _paras  = { 1, 1, 0, 1 };
            FATE_ChartMod m_chart = QA_QuestionBll.GetInstance().GetChartByQuest(ret.SysNo);
            if (m_chart != null)
            {
                ZiWeiMod m_ziwei = new ZiWeiMod();
                #region 设置实体各种参数
                //默认做太阳时修正
                string[] tmplatlng = m_chart.FirstPoi.ToString().Split(new char[] { '|' });
                m_ziwei.BirthTime = new DateEntity(PublicDeal.GetInstance().RealTime(DateTime.Parse(m_chart.FirstBirth.ToString()),
                                                                                     new LatLng(tmplatlng[1], tmplatlng[0], m_chart.FirstPoiName)));
                m_ziwei.Gender      = (AppEnum.Gender) int.Parse(m_chart.FirstGender.ToString());
                m_ziwei.RunYue      = PublicValue.ZiWeiRunYue.dangxia;
                m_ziwei.TransitTime = new DateEntity(DateTime.Now);
                #endregion
                m_ziwei = ZiWeiBiz.GetInstance().TimeToZiWei(m_ziwei.BirthTime, m_ziwei.Gender, _paras);
                ret.Chart.Add(m_ziwei);

                if (m_chart.CharType.ToString() == ((int)AppEnum.ChartType.relation).ToString())
                {
                    ZiWeiMod m_ziwei1 = new ZiWeiMod();
                    #region 设置实体各种参数
                    tmplatlng          = m_chart.SecondPoi.ToString().Split(new char[] { '|' });
                    m_ziwei1.BirthTime = new DateEntity(PublicDeal.GetInstance().RealTime(DateTime.Parse(m_chart.SecondBirth.ToString()),
                                                                                          new LatLng(tmplatlng[1], tmplatlng[0], m_chart.SecondPoiName)));
                    m_ziwei1.Gender      = (AppEnum.Gender) int.Parse(m_chart.SecondGender.ToString());
                    m_ziwei1.RunYue      = PublicValue.ZiWeiRunYue.dangxia;
                    m_ziwei1.TransitTime = new DateEntity(DateTime.Now);
                    #endregion
                    m_ziwei1 = ZiWeiBiz.GetInstance().TimeToZiWei(m_ziwei.BirthTime, m_ziwei.Gender, _paras);
                    ret.Chart.Add(m_ziwei1);
                }
            }
            #endregion
            return(ReturnValue <QA_QuestionShow <ZiWeiMod> > .Get200OK(ret));
        }
Beispiel #4
0
        public ReturnValue <BaZiMod> TimeToBaZi(Stream openPageData)
        {
            BaZiMod      input      = new BaZiMod();
            int          nReadCount = 0;
            MemoryStream ms         = new MemoryStream();

            byte[] buffer = new byte[1024];
            while ((nReadCount = openPageData.Read(buffer, 0, 1024)) > 0)
            {
                ms.Write(buffer, 0, nReadCount);
            }
            byte[] byteJson = ms.ToArray();
            string textJson = System.Text.Encoding.Default.GetString(byteJson);

            input = (BaZiMod)XMS.Core.Json.JsonSerializer.Deserialize(textJson, typeof(BaZiMod));



            if (input == null)
            {
                input           = new BaZiMod();
                input.BirthTime = new PPLive.DateEntity(DateTime.Now);
                input.Gender    = AppEnum.Gender.male;
                input.RealTime  = false;
            }
            else
            {
                if (input.IsDayLight)
                {
                    input.BirthTime = new DateEntity(input.BirthTime.Date.AddHours(-1));
                }
                if (input.RealTime)
                {
                    input.BirthTime = new DateEntity(PublicDeal.GetInstance().RealTime(input.BirthTime.Date, new LatLng("30.00", input.Longitude, input.AreaName)));
                }
                else
                {
                    input.BirthTime = new PPLive.DateEntity(input.BirthTime.Date);
                }
            }

            BaZiBiz.GetInstance().TimeToBaZi(ref input);
            return(ReturnValue <BaZiMod> .Get200OK(input));
        }
        public string BaziToHTML(BaZiMod mod)
        {
            string ret = "";

            ret += mod.BirthTime.Date.ToString("yyyy-MM-dd HH:mm") + "  (" + AppEnum.GetGender(mod.Gender) + ")<br />";
            ret += PublicValue.GetTianGan(mod.YearTG) + PublicValue.GetDiZhi(mod.YearDZ) + " " +
                   PublicValue.GetTianGan(mod.MonthTG) + PublicValue.GetDiZhi(mod.MonthDZ) + " " +
                   PublicValue.GetTianGan(mod.DayTG) + PublicValue.GetDiZhi(mod.DayDZ) + " " +
                   PublicValue.GetTianGan(mod.HourTG) + PublicValue.GetDiZhi(mod.HourDZ) + " " +
                   PublicValue.GetTianGan(BaZiBiz.GetInstance().MinuteTG(mod.HourTG, mod.BirthTime.Date.Minute + (mod.BirthTime.Date.Hour + 1) % 2 * 60)) +
                   PublicValue.GetDiZhi(BaZiBiz.GetInstance().MinuteDZ(mod.BirthTime.Date.Minute + (mod.BirthTime.Date.Hour + 1) % 2 * 60)) + " " +
                   "(" + PublicValue.GetDiZhi(mod.XunKong0) + PublicValue.GetDiZhi(mod.XunKong1) + "空)<br /><br />";
            ret += "大运:";
            for (int i = 0; i < dayun; i++)
            {
                ret += PublicValue.GetTianGan(mod.Dayun[i].YearTG) + PublicValue.GetDiZhi(mod.Dayun[i].YearDZ) + " " +
                       PublicValue.GetShiShen(PublicDeal.GetInstance().GZWuXing(new WuXingRelation(mod.Dayun[i].YearTG, mod.YearTG)).ShiShen) + "|";
            }
            ret += "<br />";
            ret += "始于:";
            for (int i = 0; i < dayun; i++)
            {
                ret += mod.Dayun[i].Begin.ToString() + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|";
            }
            ret += "<br />";
            ret += "流年:";
            for (int i = 0; i < 10; i++)
            {
                if (i != 0)
                {
                    ret += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                }
                for (int j = 0; j < dayun; j++)
                {
                    ret += PublicValue.GetTianGan(BaZiBiz.GetInstance().YearTG(mod.Dayun[j].Begin + i)) + PublicValue.GetDiZhi(BaZiBiz.GetInstance().YearDZ(mod.Dayun[j].Begin + i)) + " " +
                           PublicValue.GetShiShen(PublicDeal.GetInstance().GZWuXing(new WuXingRelation(BaZiBiz.GetInstance().YearTG(mod.Dayun[j].Begin + i), mod.DayTG)).ShiShen) + "|";
                }
                ret += "<br />";
            }
            return(ret);
        }
Beispiel #6
0
        protected void SetLtr()
        {
            BaZiMod m_bazi = new BaZiMod();

            #region 设置实体各种参数
            Control m_PlaceHolder = PreviousPage.Master.FindControl("ContentPlaceHolder1");
            if (((CheckBox)m_PlaceHolder.FindControl("chkRealTime")).Checked)
            {
                m_bazi.BirthTime = new DateEntity(PublicDeal.GetInstance().RealTime(((WebForMain.ControlLibrary.DatePicker)m_PlaceHolder.FindControl("DatePicker1")).SelectedTime,
                                                                                    new LatLng(SYS_DistrictBll.GetInstance().GetModel(((WebForMain.ControlLibrary.DistrictPicker)m_PlaceHolder.FindControl("District1")).Area3SysNo))));
                //m_bazi.AreaSysNo = ((WebForMain.ControlLibrary.DistrictPicker)m_PlaceHolder.FindControl("District1")).Area3SysNo;
                m_bazi.AreaName = ((WebForMain.ControlLibrary.DistrictPicker)m_PlaceHolder.FindControl("District1")).Area1Name + "-" +
                                  ((WebForMain.ControlLibrary.DistrictPicker)m_PlaceHolder.FindControl("District1")).Area2Name + "-" +
                                  ((WebForMain.ControlLibrary.DistrictPicker)m_PlaceHolder.FindControl("District1")).Area3Name;
                m_bazi.Longitude = ((WebForMain.ControlLibrary.DistrictPicker)m_PlaceHolder.FindControl("District1")).lng;
            }
            else
            {
                m_bazi.BirthTime = new DateEntity(((WebForMain.ControlLibrary.DatePicker)m_PlaceHolder.FindControl("DatePicker1")).SelectedTime);
            }
            m_bazi.Gender   = (AppEnum.Gender) int.Parse(((RadioButtonList)m_PlaceHolder.FindControl("drpGender")).SelectedValue);
            m_bazi.RealTime = ((CheckBox)m_PlaceHolder.FindControl("chkRealTime")).Checked;

            #endregion

            if (((RadioButtonList)m_PlaceHolder.FindControl("rblType")).SelectedValue != "")
            {
                switch (((RadioButtonList)m_PlaceHolder.FindControl("rblType")).SelectedValue)
                {
                case "1":
                    BaZi1.m_bazi = m_bazi;
                    BaZi1.total  = true;
                    break;

                case "2":
                    BaZi1.m_bazi = m_bazi;
                    BaZi1.total  = false;
                    break;
                }
            }
        }
Beispiel #7
0
        public ReturnValue <QA_QuestionShow <BaZiMod> > GetQuestionForBaZi(int sysno)
        {
            QA_QuestionMod            tmp = QA_QuestionBll.GetInstance().GetModel(sysno);
            QA_QuestionShow <BaZiMod> ret = new QA_QuestionShow <BaZiMod>();

            tmp.MemberwiseCopy(ret);

            USR_CustomerShow tmpu = new USR_CustomerShow();

            USR_CustomerBll.GetInstance().GetModel(ret.CustomerSysNo).MemberwiseCopy(tmpu);
            ret.Customer = tmpu;
            #region 设置命盘
            FATE_ChartMod m_chart = QA_QuestionBll.GetInstance().GetChartByQuest(ret.SysNo);
            if (m_chart != null)
            {
                BaZiMod  m_bazi    = new BaZiMod();
                string[] tmplatlng = m_chart.FirstPoi.ToString().Split(new char[] { '|' });
                m_bazi.BirthTime = new DateEntity(PublicDeal.GetInstance().RealTime(DateTime.Parse(m_chart.FirstBirth.ToString()),
                                                                                    new LatLng(tmplatlng[1], tmplatlng[0], m_chart.FirstPoiName)));
                m_bazi.AreaName  = m_chart.FirstPoiName.ToString();
                m_bazi.Longitude = tmplatlng[0];
                m_bazi.Gender    = (AppEnum.Gender)m_chart.FirstGender;
                BaZiBiz.GetInstance().TimeToBaZi(ref m_bazi);
                ret.Chart.Add(m_bazi);
                if (m_chart.CharType.ToString() == ((int)AppEnum.ChartType.relation).ToString())
                {
                    BaZiMod m_bazi1 = new BaZiMod();
                    tmplatlng         = m_chart.SecondPoi.ToString().Split(new char[] { '|' });
                    m_bazi1.BirthTime = new DateEntity(PublicDeal.GetInstance().RealTime(DateTime.Parse(m_chart.SecondBirth.ToString()),
                                                                                         new LatLng(tmplatlng[1], tmplatlng[0], m_chart.SecondPoiName)));
                    m_bazi1.AreaName  = m_chart.SecondPoiName.ToString();
                    m_bazi1.Longitude = tmplatlng[0];
                    m_bazi1.Gender    = (AppEnum.Gender)m_chart.SecondGender;
                    BaZiBiz.GetInstance().TimeToBaZi(ref m_bazi1);
                    ret.Chart.Add(m_bazi1);
                }
            }
            #endregion
            return(ReturnValue <QA_QuestionShow <BaZiMod> > .Get200OK(ret));
        }
 private void SetDayun(ref BaZiMod bazi, PublicValue.TianGan G, PublicValue.DiZhi Z)
 {
     for (int i = 0; i < bazi.Dayun.Length; i++)
     {
         bazi.Dayun[i] = new BaZiDaYun();
         if ((bazi.YinYang == PublicValue.ShuXing.yang && bazi.Gender == AppCmn.AppEnum.Gender.male) ||
             (bazi.YinYang == PublicValue.ShuXing.yin && bazi.Gender == AppCmn.AppEnum.Gender.female))//顺
         {
             bazi.Dayun[i].YearTG = (PublicValue.TianGan)(((int)G + 1 + i) % 10);
             bazi.Dayun[i].YearDZ = (PublicValue.DiZhi)(((int)Z + 1 + i) % 12);
         }
         else//逆
         {
             bazi.Dayun[i].YearTG = (PublicValue.TianGan)(((int)G - 1 - i + 20) % 10);
             bazi.Dayun[i].YearDZ = (PublicValue.DiZhi)(((int)Z - 1 - i + 24) % 12);
         }
         bazi.Dayun[i].Begin   = bazi.JiaoYun.Year + 10 * i;
         bazi.Dayun[i].End     = bazi.Dayun[i].Begin + 9;
         bazi.Dayun[i].NaYin   = (PublicValue.Nayin)((int)bazi.Dayun[i].YearTG * 10 + bazi.Dayun[i].YearDZ);
         bazi.Dayun[i].ShiShen = PublicDeal.GetInstance().GZWuXing(new WuXingRelation(bazi.Dayun[i].YearTG, bazi.DayTG)).ShiShen;
     }
 }
        /// <summary>
        /// 用于赋予datatable后初始化页面,其中本命盘显示本命盘,合盘则显示比较盘
        /// </summary>
        public void InitialChart()
        {
            if (_input == null || _input.CharType == null)
            {
                return;
            }

            _m_ziwei = new ZiWeiMod();
            #region 设置实体各种参数
            //默认做太阳时修正
            string[] tmplatlng = _input.FirstPoi.ToString().Split(new char[] { '|' });
            m_ziwei.BirthTime = new DateEntity(_realtime?PublicDeal.GetInstance().RealTime(DateTime.Parse(_input.FirstBirth.ToString()),
                                                                                           new LatLng(tmplatlng[1], tmplatlng[0], _input.FirstPoiName)) : DateTime.Parse(_input.FirstBirth.ToString()));
            m_ziwei.Gender      = (AppEnum.Gender) int.Parse(_input.FirstGender.ToString());
            m_ziwei.RunYue      = PublicValue.ZiWeiRunYue.dangxia;
            m_ziwei.TransitTime = new DateEntity(DateTime.Now);
            #endregion
            SetBenMing();

            if (_input.CharType.ToString() == ((int)AppEnum.ChartType.relation).ToString())
            {
                _m_ziwei = new ZiWeiMod();
                #region 设置实体各种参数
                tmplatlng         = _input.SecondPoi.ToString().Split(new char[] { '|' });
                m_ziwei.BirthTime = new DateEntity(_realtime ? PublicDeal.GetInstance().RealTime(DateTime.Parse(_input.SecondBirth.ToString()),
                                                                                                 new LatLng(tmplatlng[1], tmplatlng[0], _input.SecondPoiName)) : DateTime.Parse(_input.SecondBirth.ToString()));
                m_ziwei.Gender      = (AppEnum.Gender) int.Parse(_input.SecondGender.ToString());
                m_ziwei.RunYue      = PublicValue.ZiWeiRunYue.dangxia;
                m_ziwei.TransitTime = new DateEntity(DateTime.Now);
                #endregion
                SetHePan();
            }
            else
            {
                tab1.Style["display"] = "none";
            }
        }
Beispiel #10
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            DateTime now = DatePicker1.SelectedTime;
            Dictionary <string, SortedDictionary <int, int> > result = new Dictionary <string, SortedDictionary <int, int> >();
            int count = 0;

            for (DateTime tmpnow = now; tmpnow < now.AddYears(1); tmpnow = tmpnow.AddHours(1))
            {
                #region 计算
                AstroMod m_astro = new AstroMod();
                m_astro.type = PublicValue.AstroType.benming;
                #region 设置实体各种参数
                m_astro.birth    = tmpnow;
                m_astro.position = new LatLng(SYS_DistrictBll.GetInstance().GetModel(1));
                //if (chkDaylight1.Checked)
                //{
                //    m_astro.IsDayLight = AppEnum.BOOL.True;
                //}
                //else
                //{
                //    m_astro.IsDayLight = AppEnum.BOOL.False;
                //}
                m_astro.IsDayLight = AppEnum.BOOL.False;
                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 红杏
                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;
                }
                if (!result.ContainsKey("红杏"))
                {
                    SortedDictionary <int, int> tmpdic = new SortedDictionary <int, int>();
                    tmpdic.Add(0, 0);
                    tmpdic.Add(1, 0);
                    result.Add("红杏", tmpdic);
                }
                if (!hongxing)
                {
                    result["红杏"][0]++;
                }
                else
                {
                    result["红杏"][1]++;
                }
                #endregion

                #region 蜜蜂
                int beecount = 0;
                List <PublicValue.AstroStar> beestars = PublicDeal.GetInstance().GetGongMasters(m_astro.Stars, 7, false);

                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++;
                        }
                    }
                }

                if (!result.ContainsKey("蜜蜂"))
                {
                    SortedDictionary <int, int> tmpdic = new SortedDictionary <int, int>();
                    result.Add("蜜蜂", tmpdic);
                }
                if (!result["蜜蜂"].ContainsKey(beecount))
                {
                    result["蜜蜂"].Add(beecount, 0);
                }
                result["蜜蜂"][beecount]++;
                #endregion

                #region 花盆

                #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;
                                }
                            }
                        }
                    }
                }
                if (!result.ContainsKey("泡泡"))
                {
                    SortedDictionary <int, int> tmpdic = new SortedDictionary <int, int>();
                    result.Add("泡泡", tmpdic);
                }
                if (!result["泡泡"].ContainsKey(showele["paopao"]))
                {
                    result["泡泡"].Add(showele["paopao"], 0);
                }
                result["泡泡"][showele["paopao"]]++;

                if (!result.ContainsKey("虫子"))
                {
                    SortedDictionary <int, int> tmpdic = new SortedDictionary <int, int>();
                    result.Add("虫子", tmpdic);
                }
                if (!result["虫子"].ContainsKey(showele["chongzi"]))
                {
                    result["虫子"].Add(showele["chongzi"], 0);
                }
                result["虫子"][showele["chongzi"]]++;

                if (!result.ContainsKey("醋"))
                {
                    SortedDictionary <int, int> tmpdic = new SortedDictionary <int, int>();
                    result.Add("醋", tmpdic);
                }
                if (!result["醋"].ContainsKey(showele["cu"]))
                {
                    result["醋"].Add(showele["cu"], 0);
                }
                result["醋"][showele["cu"]]++;

                if (!result.ContainsKey("裂痕"))
                {
                    SortedDictionary <int, int> tmpdic = new SortedDictionary <int, int>();
                    result.Add("裂痕", tmpdic);
                }
                if (!result["裂痕"].ContainsKey(showele["liehen"]))
                {
                    result["裂痕"].Add(showele["liehen"], 0);
                }
                result["裂痕"][showele["liehen"]]++;

                if (!result.ContainsKey("冰冻"))
                {
                    SortedDictionary <int, int> tmpdic = new SortedDictionary <int, int>();
                    result.Add("冰冻", tmpdic);
                }
                if (!result["冰冻"].ContainsKey(showele["bingdong"]))
                {
                    result["冰冻"].Add(showele["bingdong"], 0);
                }
                result["冰冻"][showele["bingdong"]]++;

                if (!result.ContainsKey("折枝"))
                {
                    SortedDictionary <int, int> tmpdic = new SortedDictionary <int, int>();
                    result.Add("折枝", tmpdic);
                }
                if (!result["折枝"].ContainsKey(showele["zhezhi"]))
                {
                    result["折枝"].Add(showele["zhezhi"], 0);
                }
                result["折枝"][showele["zhezhi"]]++;

                if (!result.ContainsKey("枯叶"))
                {
                    SortedDictionary <int, int> tmpdic = new SortedDictionary <int, int>();
                    result.Add("枯叶", tmpdic);
                }
                if (!result["枯叶"].ContainsKey(showele["kuye"]))
                {
                    result["枯叶"].Add(showele["kuye"], 0);
                }
                result["枯叶"][showele["kuye"]]++;

                if (!result.ContainsKey("总负面"))
                {
                    SortedDictionary <int, int> tmpdic = new SortedDictionary <int, int>();
                    result.Add("总负面", tmpdic);
                }
                int tmpbadd = showele["paopao"] + showele["chongzi"] + showele["cu"] + showele["liehen"] + showele["bingdong"] + showele["zhezhi"] + showele["kuye"];
                if (!result["总负面"].ContainsKey(tmpbadd))
                {
                    result["总负面"].Add(tmpbadd, 0);
                }
                result["总负面"][tmpbadd]++;


                #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++;
                }
                if (!result.ContainsKey("花心"))
                {
                    SortedDictionary <int, int> tmpdic = new SortedDictionary <int, int>();
                    result.Add("花心", tmpdic);
                }
                if (!result["花心"].ContainsKey(flowercount))
                {
                    result["花心"].Add(flowercount, 0);
                }
                result["花心"][flowercount]++;
                #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++;
                }

                if (!result.ContainsKey("魅力"))
                {
                    SortedDictionary <int, int> tmpdic = new SortedDictionary <int, int>();
                    result.Add("魅力", tmpdic);
                }
                if (!result["魅力"].ContainsKey(meilicount))
                {
                    result["魅力"].Add(meilicount, 0);
                }
                result["魅力"][meilicount]++;
                #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;
                }
                if (richcount >= 60)
                {
                    Label1.Text += m_astro.birth.ToString("yyyy-MM-dd HH:mm:ss") + "<br />";
                    //return;
                }

                List <List <PublicValue.AstroStar> > hurong = PublicDeal.GetInstance().GetHuRong(m_astro.Stars, true);;
                if (!result.ContainsKey("对方有钱"))
                {
                    SortedDictionary <int, int> tmpdic = new SortedDictionary <int, int>();
                    result.Add("对方有钱", tmpdic);
                }
                if (!result["对方有钱"].ContainsKey(richcount))
                {
                    result["对方有钱"].Add(richcount, 0);
                }
                result["对方有钱"][richcount]++;
                #endregion
                #endregion
                count++;
            }
            #region 打印
            Label1.Text += now.ToString("yyyy-MM-dd") + "至" + DatePicker1.SelectedTime.ToString("yyyy-MM-dd") + "<br />";
            foreach (KeyValuePair <string, SortedDictionary <int, int> > s in result)
            {
                Label1.Text += s.Key + ":<br />";
                foreach (KeyValuePair <int, int> ss in s.Value)
                {
                    Label1.Text += ss.Key + ":" + ss.Value + "个<br />";
                }
            }
            #endregion
        }
        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=";
        }
Beispiel #12
0
        public QA_QuestionShowMini <ZiWeiMod> MapQA_QuestionShowMiniForZiWei(DataRow input)
        {
            QA_QuestionShowMini <ZiWeiMod> ret = new QA_QuestionShowMini <ZiWeiMod>();

            if (input["Award"].ToString() != "")
            {
                ret.Award = int.Parse(input["Award"].ToString());
            }
            if (input["CateSysNo"].ToString() != "")
            {
                ret.CateSysNo = int.Parse(input["CateSysNo"].ToString());
            }
            #region 设置命盘
            int[]         _paras  = { 1, 1, 0, 1 };
            FATE_ChartMod m_chart = QA_QuestionBll.GetInstance().GetChartByQuest(int.Parse(input["SysNo"].ToString()));
            if (m_chart != null)
            {
                ZiWeiMod m_ziwei = new ZiWeiMod();
                #region 设置实体各种参数
                //默认做太阳时修正
                string[] tmplatlng = m_chart.FirstPoi.ToString().Split(new char[] { '|' });
                m_ziwei.BirthTime = new DateEntity(PublicDeal.GetInstance().RealTime(DateTime.Parse(m_chart.FirstBirth.ToString()),
                                                                                     new LatLng(tmplatlng[1], tmplatlng[0], m_chart.FirstPoiName)));
                m_ziwei.Gender      = (AppEnum.Gender) int.Parse(m_chart.FirstGender.ToString());
                m_ziwei.RunYue      = PublicValue.ZiWeiRunYue.dangxia;
                m_ziwei.TransitTime = new DateEntity(DateTime.Now);
                #endregion
                m_ziwei = ZiWeiBiz.GetInstance().TimeToZiWei(m_ziwei.BirthTime, m_ziwei.Gender, _paras);
                ret.Chart.Add(m_ziwei);

                if (m_chart.CharType.ToString() == ((int)AppEnum.ChartType.relation).ToString())
                {
                    ZiWeiMod m_ziwei1 = new ZiWeiMod();
                    #region 设置实体各种参数
                    tmplatlng          = m_chart.SecondPoi.ToString().Split(new char[] { '|' });
                    m_ziwei1.BirthTime = new DateEntity(PublicDeal.GetInstance().RealTime(DateTime.Parse(m_chart.SecondBirth.ToString()),
                                                                                          new LatLng(tmplatlng[1], tmplatlng[0], m_chart.SecondPoiName)));
                    m_ziwei1.Gender      = (AppEnum.Gender) int.Parse(m_chart.SecondGender.ToString());
                    m_ziwei1.RunYue      = PublicValue.ZiWeiRunYue.dangxia;
                    m_ziwei1.TransitTime = new DateEntity(DateTime.Now);
                    #endregion
                    m_ziwei1 = ZiWeiBiz.GetInstance().TimeToZiWei(m_ziwei.BirthTime, m_ziwei.Gender, _paras);
                    ret.Chart.Add(m_ziwei1);
                }
            }
            #endregion
            ret.Context = input["Context"].ToString();
            if (input["NickName"] == null)
            {
                USR_CustomerMod m_customer = USR_CustomerBll.GetInstance().GetModel(int.Parse(input["CustomerSysNo"].ToString()));

                ret.CustomerNickName = m_customer.NickName;
                ret.CustomerPhoto    = m_customer.Photo;
            }
            else
            {
                ret.CustomerNickName = input["NickName"].ToString();
                ret.CustomerPhoto    = input["Photo"].ToString();
            }
            if (input["CustomerSysNo"].ToString() != "")
            {
                ret.CustomerSysNo = int.Parse(input["CustomerSysNo"].ToString());
            }
            ret.DR = int.Parse(input["DR"].ToString());
            if (input["EndTime"].ToString() != "")
            {
                ret.EndTime = DateTime.Parse(input["EndTime"].ToString());
            }
            if (input["IsSecret"].ToString() != "")
            {
                ret.IsSecret = int.Parse(input["IsSecret"].ToString());
            }
            if (input["LastReplyTime"].ToString() != "")
            {
                ret.LastReplyTime = DateTime.Parse(input["LastReplyTime"].ToString());
            }
            if (input["LastReplyUser"].ToString() != "")
            {
                ret.LastReplyUser = int.Parse(input["LastReplyUser"].ToString());
            }
            if (input["ReadCount"].ToString() != "")
            {
                ret.ReadCount = int.Parse(input["ReadCount"].ToString());
            }
            if (input["ReplyCount"].ToString() != "")
            {
                ret.ReplyCount = int.Parse(input["ReplyCount"].ToString());
            }
            if (input["SysNo"].ToString() != "")
            {
                ret.SysNo = int.Parse(input["SysNo"].ToString());
            }
            ret.Title = input["Title"].ToString();
            if (input["TS"].ToString() != "")
            {
                ret.TS = DateTime.Parse(input["TS"].ToString());
            }

            return(ret);
        }
Beispiel #13
0
        public QA_QuestionShowMini <BaZiMod> MapQA_QuestionShowMiniForBaZi(DataRow input)
        {
            QA_QuestionShowMini <BaZiMod> ret = new QA_QuestionShowMini <BaZiMod>();

            if (input["Award"].ToString() != "")
            {
                ret.Award = int.Parse(input["Award"].ToString());
            }
            if (input["CateSysNo"].ToString() != "")
            {
                ret.CateSysNo = int.Parse(input["CateSysNo"].ToString());
            }
            #region 设置命盘
            FATE_ChartMod m_chart = QA_QuestionBll.GetInstance().GetChartByQuest(int.Parse(input["SysNo"].ToString()));
            if (m_chart != null)
            {
                BaZiMod  m_bazi    = new BaZiMod();
                string[] tmplatlng = m_chart.FirstPoi.ToString().Split(new char[] { '|' });
                m_bazi.BirthTime = new DateEntity(PublicDeal.GetInstance().RealTime(DateTime.Parse(m_chart.FirstBirth.ToString()),
                                                                                    new LatLng(tmplatlng[1], tmplatlng[0], m_chart.FirstPoiName)));
                m_bazi.AreaName  = m_chart.FirstPoiName.ToString();
                m_bazi.Longitude = tmplatlng[0];
                m_bazi.Gender    = (AppEnum.Gender)m_chart.FirstGender;
                BaZiBiz.GetInstance().TimeToBaZi(ref m_bazi);
                ret.Chart.Add(m_bazi);
                if (m_chart.CharType.ToString() == ((int)AppEnum.ChartType.relation).ToString())
                {
                    BaZiMod m_bazi1 = new BaZiMod();
                    tmplatlng         = m_chart.SecondPoi.ToString().Split(new char[] { '|' });
                    m_bazi1.BirthTime = new DateEntity(PublicDeal.GetInstance().RealTime(DateTime.Parse(m_chart.SecondBirth.ToString()),
                                                                                         new LatLng(tmplatlng[1], tmplatlng[0], m_chart.SecondPoiName)));
                    m_bazi1.AreaName  = m_chart.SecondPoiName.ToString();
                    m_bazi1.Longitude = tmplatlng[0];
                    m_bazi1.Gender    = (AppEnum.Gender)m_chart.SecondGender;
                    BaZiBiz.GetInstance().TimeToBaZi(ref m_bazi1);
                    ret.Chart.Add(m_bazi1);
                }
            }
            #endregion
            ret.Context = input["Context"].ToString();
            if (input["NickName"] == null)
            {
                USR_CustomerMod m_customer = USR_CustomerBll.GetInstance().GetModel(int.Parse(input["CustomerSysNo"].ToString()));

                ret.CustomerNickName = m_customer.NickName;
                ret.CustomerPhoto    = m_customer.Photo;
            }
            else
            {
                ret.CustomerNickName = input["NickName"].ToString();
                ret.CustomerPhoto    = input["Photo"].ToString();
            }
            if (input["CustomerSysNo"].ToString() != "")
            {
                ret.CustomerSysNo = int.Parse(input["CustomerSysNo"].ToString());
            }
            ret.DR = int.Parse(input["DR"].ToString());
            if (input["EndTime"].ToString() != "")
            {
                ret.EndTime = DateTime.Parse(input["EndTime"].ToString());
            }
            if (input["IsSecret"].ToString() != "")
            {
                ret.IsSecret = int.Parse(input["IsSecret"].ToString());
            }
            if (input["LastReplyTime"].ToString() != "")
            {
                ret.LastReplyTime = DateTime.Parse(input["LastReplyTime"].ToString());
            }
            if (input["LastReplyUser"].ToString() != "")
            {
                ret.LastReplyUser = int.Parse(input["LastReplyUser"].ToString());
            }
            if (input["ReadCount"].ToString() != "")
            {
                ret.ReadCount = int.Parse(input["ReadCount"].ToString());
            }
            if (input["ReplyCount"].ToString() != "")
            {
                ret.ReplyCount = int.Parse(input["ReplyCount"].ToString());
            }
            if (input["SysNo"].ToString() != "")
            {
                ret.SysNo = int.Parse(input["SysNo"].ToString());
            }
            ret.Title = input["Title"].ToString();
            if (input["TS"].ToString() != "")
            {
                ret.TS = DateTime.Parse(input["TS"].ToString());
            }

            return(ret);
        }
Beispiel #14
0
        public string BaziToHTML(BaZiMod bazi, bool all)
        {
            string ret   = "";
            int    dayun = 8;

            ret += b("姓名:") + bazi.Name + " " + b("排盘类型:");
            if (bazi.RealTime)
            {
                ret += "真太阳时";
            }
            else
            {
                ret += "普通排盘";
            }
            ret += "<br />";
            if (bazi.RealTime)
            {
                ret += b("出生地:") + bazi.AreaName + " " + b("经度:") + bazi.Longitude + "<br />";
            }
            ret += "上上签神秘学社区四柱八字排盘系统 <a href='" + AppCmn.AppConfig.HomeUrl() + "'>" + AppCmn.AppConfig.HomeUrl() + "</a><br /><br />";
            ret += b("公历:") + fa(bazi.BirthTime.Date.Year.ToString("0000")) + "年" + fa(bazi.BirthTime.Date.Month.ToString("00")) + "月" +
                   fa(bazi.BirthTime.Date.Day.ToString("00")) + "日" + fa(bazi.BirthTime.Date.Hour.ToString("00")) + "时" + fa(bazi.BirthTime.Date.Minute.ToString("00")) + "分" + "<br />";
            ret += b("阴历:") + PublicValue.GetTianGan(bazi.BirthTime.NongliTG) + PublicValue.GetDiZhi(bazi.BirthTime.NongliDZ) + "年[" + PublicValue.GetNayin(10000 + (int)bazi.BirthTime.NongliTG * 100 + (int)bazi.BirthTime.NongliDZ) + "]" +
                   PublicValue.GetNongliMonth(bazi.BirthTime.NongliMonth) + "月" + PublicValue.GetNongliDay(bazi.BirthTime.NongliDay) + PublicValue.GetDiZhi(bazi.BirthTime.NongliHour) + "时<br /><br />";
            ret += PublicValue.GetAllJieQi(bazi.JieQiName[0]) + ":" + fa(bazi.JieQi[0].Year.ToString("0000")) + "年" + fa(bazi.JieQi[0].Month.ToString("00")) + "月" + fa(bazi.JieQi[0].Day.ToString("00")) + "日"
                   + fa(bazi.JieQi[0].Hour.ToString("00")) + "时" + fa(bazi.JieQi[0].Minute.ToString("00")) + "分" + fa(bazi.JieQi[0].Second.ToString("00")) + "秒" + " (高精度天文算法)<br />";
            ret += PublicValue.GetAllJieQi(bazi.JieQiName[1]) + ":" + fa(bazi.JieQi[1].Year.ToString("0000")) + "年" + fa(bazi.JieQi[1].Month.ToString("00")) + "月" + fa(bazi.JieQi[1].Day.ToString("00")) + "日"
                   + fa(bazi.JieQi[1].Hour.ToString("00")) + "时" + fa(bazi.JieQi[1].Minute.ToString("00")) + "分" + fa(bazi.JieQi[1].Second.ToString("00")) + "秒" + "<br /><br />";
            ret += b("起运:") + "于出生后" + fa(bazi.QiYun.Days.ToString()) + "天" + fa(bazi.QiYun.Hours.ToString()) + "小时" + fa(bazi.QiYun.Minutes.ToString()) + "分钟起运<br />";
            ret += b("交运:") + "于公历" + fa(bazi.JiaoYun.Year.ToString()) + "年" + fa(bazi.JiaoYun.Month.ToString()) + "月" + fa(bazi.JiaoYun.Day.ToString()) + "日" + fa(bazi.JiaoYun.Hour.ToString()) + "时" + fa(bazi.JiaoYun.Hour.ToString()) + "分交运<br /><br />";
            ret += "    " + fc(PublicValue.GetShiShen(PublicDeal.GetInstance().GZWuXing(new WuXingRelation(bazi.YearTG, bazi.DayTG)).ShiShen)) + "  " +
                   fc(PublicValue.GetShiShen(PublicDeal.GetInstance().GZWuXing(new WuXingRelation(bazi.MonthTG, bazi.DayTG)).ShiShen)) + "  " + fc("日主") + "  " +
                   fc(PublicValue.GetShiShen(PublicDeal.GetInstance().GZWuXing(new WuXingRelation(bazi.HourTG, bazi.DayTG)).ShiShen)) + "<br />";
            if (bazi.Gender == AppCmn.AppEnum.Gender.male)
            {
                ret += b("乾造:") + " ";
            }
            else
            {
                ret += b("坤造:") + " ";
            }
            ret += fa(PublicValue.GetTianGan(bazi.YearTG)) + "   " + fa(PublicValue.GetTianGan(bazi.MonthTG)) + "   " +
                   fa(PublicValue.GetTianGan(bazi.DayTG)) + "   " + fa(PublicValue.GetTianGan(bazi.HourTG)) + "  (" +
                   fd(PublicValue.GetDiZhi(bazi.XunKong0)) + fd(PublicValue.GetDiZhi(bazi.XunKong1)) + "空)<br />";
            ret += b("   ") + " " + fa(PublicValue.GetDiZhi(bazi.YearDZ)) + "   " + fa(PublicValue.GetDiZhi(bazi.MonthDZ)) + "   " +
                   fa(PublicValue.GetDiZhi(bazi.DayDZ)) + "   " + fa(PublicValue.GetDiZhi(bazi.HourDZ)) + "<br /><br />";
            for (int j = 0; j < 3; j++)
            {
                ret += b("   ") + " ";
                for (int i = 0; i < 4; i++)
                {
                    if (!(j != 0 && (int)bazi.CangGan[i, j] == 0))
                    {
                        ret += PublicValue.GetTianGan(bazi.CangGan[i, j]) + fc(PublicValue.GetShiShen(PublicDeal.GetInstance().GZWuXing(new WuXingRelation(bazi.CangGan[i, j], bazi.DayTG)).ShiShen)) + " ";
                    }
                }
                ret += "<br />";
            }
            ret += b("旺衰:") + " ";
            for (int i = 0; i < 4; i++)
            {
                ret += PublicValue.GetZiWeiChangSheng(bazi.WangShuai[i]).Replace(" ", "");
                for (int j = 0; j < 4 - PublicValue.GetZiWeiChangSheng(bazi.WangShuai[i]).Replace(" ", "").Length; j++)
                {
                    ret += " ";
                }
            }
            ret += "<br />";
            ret += b("纳音:") + " ";
            for (int i = 0; i < 4; i++)
            {
                ret += fb(PublicValue.GetNayin(bazi.NaYin[i])) + " ";
            }
            ret += "<br /><br />";

            //大运
            ret += b("纳音:");
            for (int i = 0; i < dayun; i++)
            {
                ret += fb(PublicValue.GetNayin(bazi.Dayun[i].NaYin)) + " ";
            }
            ret += "<br />";
            ret += b("旺衰:");
            for (int i = 0; i < dayun; i++)
            {
                ret += PublicValue.GetZiWeiChangSheng(bazi.Dayun[i].WangShuai).Replace(" ", "");
                for (int j = 0; j < 4 - PublicValue.GetZiWeiChangSheng(bazi.Dayun[i].WangShuai).Replace(" ", "").Length; j++)
                {
                    ret += " ";
                }
            }
            ret += "<br />";
            ret += b("十神:");
            for (int i = 0; i < dayun; i++)
            {
                ret += fc(PublicValue.GetShiShen(bazi.Dayun[i].ShiShen)) + "  ";
            }
            ret += "<br />";
            ret += b("大运:");
            for (int i = 0; i < dayun; i++)
            {
                ret += fa(PublicValue.GetTianGan(bazi.Dayun[i].YearTG) + PublicValue.GetDiZhi(bazi.Dayun[i].YearDZ)) + "  ";
            }
            ret += "<br />";
            ret += b("    ");
            for (int i = 0; i < dayun; i++)
            {
                ret += bazi.Dayun[i].Begin - bazi.BirthTime.Date.Year + "岁  ";
            }
            ret += "<br />";
            //流年
            if (all)
            {
                ret += b("始于:");
                for (int i = 0; i < dayun; i++)
                {
                    ret += fc(bazi.Dayun[i].Begin.ToString("")) + "  ";
                }
                ret += "<br />";
                ret += b("流年:");
                for (int i = 0; i < 10; i++)
                {
                    if (i != 0)
                    {
                        ret += b("   ");
                    }
                    for (int j = 0; j < dayun; j++)
                    {
                        ret += PublicValue.GetTianGan(BaZiBiz.GetInstance().YearTG(bazi.Dayun[j].Begin + i)) +
                               PublicValue.GetDiZhi(BaZiBiz.GetInstance().YearDZ(bazi.Dayun[j].Begin + i)).Replace(PublicValue.GetDiZhi(bazi.XunKong0), fd(PublicValue.GetDiZhi(bazi.XunKong0))).Replace(PublicValue.GetDiZhi(bazi.XunKong1), fd(PublicValue.GetDiZhi(bazi.XunKong1))) + "  ";
                    }
                    ret += "<br />";
                }

                ret += b("止于:");
                for (int i = 0; i < dayun; i++)
                {
                    ret += fc(bazi.Dayun[i].End.ToString()) + "  ";
                }
                ret += "<br />";
            }
            return(ret);
        }