Exemplo n.º 1
0
        //流限盘排盘
        protected void SetLiuXian()
        {
            ZiWeiMod m_ziwei = new ZiWeiMod();

            #region 设置实体各种参数
            Control m_PlaceHolder = PreviousPage.Master.FindControl("ContentPlaceHolder1");
            if (((CheckBox)m_PlaceHolder.FindControl("chkRealTime")).Checked)
            {
                m_ziwei.BirthTime = new DateEntity(RealTime(((WebForMain.ControlLibrary.DatePicker)m_PlaceHolder.FindControl("DatePicker1")).SelectedTime,
                                                            new LatLng(SYS_DistrictBll.GetInstance().GetModel(((WebForMain.ControlLibrary.DistrictPicker)m_PlaceHolder.FindControl("District1")).Area3SysNo))));
            }
            else
            {
                m_ziwei.BirthTime = new DateEntity(((WebForMain.ControlLibrary.DatePicker)m_PlaceHolder.FindControl("DatePicker1")).SelectedTime);
            }
            m_ziwei.Gender = (AppEnum.Gender) int.Parse(((RadioButtonList)m_PlaceHolder.FindControl("drpGender")).SelectedValue);
            m_ziwei.RunYue = (PublicValue.ZiWeiRunYue) int.Parse(((DropDownList)m_PlaceHolder.FindControl("drpLeaf")).SelectedValue);
            int[] paras = { int.Parse(((DropDownList)m_PlaceHolder.FindControl("drpTianma")).SelectedValue),
                            int.Parse(((DropDownList)m_PlaceHolder.FindControl("drpShenzhu")).SelectedValue),
                            int.Parse(((DropDownList)m_PlaceHolder.FindControl("drpShiShang")).SelectedValue),
                            int.Parse(((DropDownList)m_PlaceHolder.FindControl("drpTransit")).SelectedValue) };
            m_ziwei.TransitTime = new DateEntity(((WebForMain.ControlLibrary.DatePicker)m_PlaceHolder.FindControl("TransitDate")).SelectedTime);
            string args = m_ziwei.BirthTime.Date.ToString() + "|" + (int)m_ziwei.Gender + "|" + paras[0] + paras[1] + paras[2] + paras[3] + m_ziwei.TransitTime.Date.ToString();
            ViewState["args"] = args;
            #endregion
            ZiWei1.m_ziwei = m_ziwei;
            ZiWei1.Paras   = paras;
            ZiWei1.Trans   = true;
        }
Exemplo n.º 2
0
        protected void Unnamed1_Click(object sender, EventArgs e)
        {
            SYS_DistrictMod m_area = new SYS_DistrictMod();

            if (type == "EDIT")
            {
                if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
                {
                    SysNo = int.Parse(Request.QueryString["id"]);
                }
                m_area = SYS_DistrictBll.GetInstance().GetModel(SysNo);
            }
            try
            {
                m_area.Name        = txtName.Text.Trim();
                m_area.EnglishName = txtEnglishName.Text.Trim();
                m_area.DR          = int.Parse(drpStatus.SelectedValue);
                SYS_DistrictBll.GetInstance().Update(m_area);
                LogManagement.getInstance().WriteTrace(m_area.SysNo, "District.Update", "IP:" + Request.UserHostAddress + "|AdminID:" + GetSession().AdminEntity.Username);

                ltrNotice.Text = "该记录已保存成功!";
                this.ClientScript.RegisterStartupScript(this.GetType(), "", "document.getElementById('noticediv').style.display='';", true);
            }
            catch
            {
                ltrError.Text = "输入资料格式有误,请检查!";
                this.ClientScript.RegisterStartupScript(this.GetType(), "", "document.getElementById('errordiv').style.display='';closeforseconds();", true);
                return;
            }
        }
Exemplo n.º 3
0
        protected void BindContent()
        {
            DateTime beginTime = AppCmn.AppConst.DateTimeNull;
            DateTime endTime   = AppCmn.AppConst.DateTimeNull;

            try
            {
                if (txtTimeBegin.Text != "")
                {
                    beginTime = DateTime.Parse(txtTimeBegin.Text.Trim());
                }
                if (txtTimeEnd.Text != "")
                {
                    endTime = DateTime.Parse(txtTimeEnd.Text.Trim());
                }
            }
            catch { }
            string nation = "";

            if (drpNation.SelectedValue != "0")
            {
                DataTable tmp_dt = SYS_DistrictBll.GetInstance().GetFirstLevel(0);
                for (int i = 0; i < tmp_dt.Rows.Count; i++)
                {
                    if (tmp_dt.Rows[i]["SysNo"].ToString() == drpNation.SelectedValue)
                    {
                        nation = tmp_dt.Rows[i]["EnglishName"].ToString();
                    }
                }
            }
            DataTable m_dt = SPD_FamousBll.GetInstance().GetList(AppConst.PageSize, pageindex, txtName.Text.Trim(), int.Parse(drpInput.SelectedValue), beginTime, endTime, nation, ref total);

            m_dt.Columns.Add("Display");
            for (int i = 0; i < m_dt.Rows.Count; i++)
            {
                if (m_dt.Rows[i]["FamousSysNo"] != null && m_dt.Rows[i]["FamousSysNo"].ToString() != "")
                {
                    m_dt.Rows[i]["Display"] = "display:none;";
                }
                else
                {
                    m_dt.Rows[i]["Display"] = "";
                }
            }
            rptFamous.DataSource = m_dt;
            rptFamous.DataBind();

            Pager1.url = "Spider.aspx?name=" + txtName.Text.Trim() + "&begin=" + txtTimeBegin.Text.Trim() + "&end=" + txtTimeEnd.Text.Trim() + "&input=" + drpInput.SelectedValue + "&nation=" + drpNation.SelectedValue + "&pn=";
            if (total % AppConst.PageSize == 0)
            {
                this.Pager1.total = total / AppConst.PageSize;
            }
            else
            {
                this.Pager1.total = total / AppConst.PageSize + 1;
            }
            this.Pager1.index    = pageindex;
            this.Pager1.numlenth = 3;
        }
Exemplo n.º 4
0
        protected void PrepareForm()
        {
            if (type == "EDIT")
            {
                if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
                {
                    try
                    {
                        SysNo = int.Parse(Request.QueryString["id"]);
                        SYS_DistrictMod m_area = SYS_DistrictBll.GetInstance().GetModel(SysNo);
                        ltrParent.Text          = "";
                        txtName.Text            = m_area.Name;
                        txtEnglishName.Text     = m_area.EnglishName;
                        drpStatus.SelectedIndex = drpStatus.Items.IndexOf(drpStatus.Items.FindByValue(m_area.DR.ToString()));

                        DataTable m_child = SYS_DistrictBll.GetInstance().GetSubLevel(SysNo);
                        rptFamous.DataSource = m_child;
                        rptFamous.DataBind();

                        if (m_area.Level == 3)
                        {
                            DataTable m_parent = SYS_DistrictBll.GetInstance().GetTreeDetail(SysNo);
                            if (m_parent.Rows.Count > 0)
                            {
                                ltrParent.Text = m_parent.Rows[0]["Name1"].ToString() + "—" + m_parent.Rows[0]["Name2"].ToString() + "—" + m_parent.Rows[0]["Name3"].ToString();
                            }
                        }
                        else if (m_area.Level == 2)
                        {
                            DataTable m_parent = SYS_DistrictBll.GetInstance().GetTreeDetail(SysNo);
                            if (m_parent.Rows.Count > 0)
                            {
                                ltrParent.Text = m_parent.Rows[0]["Name1"].ToString() + "—" + m_parent.Rows[0]["Name2"].ToString();
                            }
                        }
                        else if (m_area.Level == 1)
                        {
                            ltrParent.Text = "此地区为一级地区";
                        }
                        fieldset1.Style["display"] = "";
                        fieldset2.Style["display"] = "";
                    }
                    catch
                    {
                        Response.Redirect("../Error.aspx?msg=");
                        return;
                    }
                }
            }
            else if (type == "TOP")
            {
                DataTable m_child = SYS_DistrictBll.GetInstance().GetFirstLevel(0);
                rptFamous.DataSource = m_child;
                rptFamous.DataBind();
                fieldset1.Style["display"] = "none";
                fieldset2.Style["display"] = "none";
            }
        }
Exemplo n.º 5
0
 protected void drpDistrict3_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (drpDistrict3.SelectedValue != "0")
     {
         SYS_DistrictMod m_area = SYS_DistrictBll.GetInstance().GetModel(int.Parse(drpDistrict3.SelectedValue));
         lblPosition.Text    = "北纬" + m_area.Latitude + ",东经" + m_area.longitude;
         lblPosition.Visible = true;
     }
 }
Exemplo n.º 6
0
        //组合盘排盘
        protected void SetHePan()
        {
            m_astro.type = PublicValue.AstroType.hepan;

            #region 设置实体各种参数
            Control m_PlaceHolder = PreviousPage.Master.FindControl("ContentPlaceHolder1");
            m_astro.compose = (PublicValue.AstroZuhe) int.Parse(((DropDownList)m_PlaceHolder.FindControl("drpCompareType")).SelectedValue);

            m_astro.birth    = ((WebForMain.ControlLibrary.DatePicker)m_PlaceHolder.FindControl("DatePicker1")).SelectedTime;
            m_astro.position = new LatLng(SYS_DistrictBll.GetInstance().GetModel(((WebForMain.ControlLibrary.DistrictPicker)m_PlaceHolder.FindControl("District1")).Area3SysNo));
            if (((CheckBox)m_PlaceHolder.FindControl("chkDaylight1")).Checked)
            {
                m_astro.IsDayLight = AppEnum.BOOL.True;
            }
            else
            {
                m_astro.IsDayLight = AppEnum.BOOL.False;
            }
            m_astro.zone      = int.Parse(((DropDownList)m_PlaceHolder.FindControl("drpTimeZone1")).SelectedValue);
            m_astro.birth1    = ((WebForMain.ControlLibrary.DatePicker)m_PlaceHolder.FindControl("DatePicker2")).SelectedTime;
            m_astro.position1 = new LatLng(SYS_DistrictBll.GetInstance().GetModel(((WebForMain.ControlLibrary.DistrictPicker)m_PlaceHolder.FindControl("District2")).Area3SysNo));
            if (((CheckBox)m_PlaceHolder.FindControl("chkDaylight2")).Checked)
            {
                m_astro.IsDayLight1 = AppEnum.BOOL.True;
            }
            else
            {
                m_astro.IsDayLight1 = AppEnum.BOOL.False;
            }
            m_astro.zone1 = int.Parse(((DropDownList)m_PlaceHolder.FindControl("drpTimeZone2")).SelectedValue);

            //m_astro.houseSystem = int.Parse(drpSOH.SelectedValue);
            m_astro.startsShow.Clear();
            for (int i = 1; i < 21; i++)
            {
                if (((CheckBox)m_PlaceHolder.FindControl("star" + i)).Checked)
                {
                    m_astro.startsShow.Add(i, ((CheckBox)m_PlaceHolder.FindControl("star" + i)).Text);
                }
            }
            m_astro.startsShow.Add(21, "上升");
            m_astro.startsShow.Add(24, "天底");
            m_astro.startsShow.Add(27, "下降");
            m_astro.startsShow.Add(30, "中天");
            m_astro.aspectsShow.Clear();
            m_astro.aspectsShow.Add(1, decimal.Parse(((DropDownList)m_PlaceHolder.FindControl("drpAspect0")).SelectedValue));
            m_astro.aspectsShow.Add(2, decimal.Parse(((DropDownList)m_PlaceHolder.FindControl("drpAspect180")).SelectedValue));
            m_astro.aspectsShow.Add(4, decimal.Parse(((DropDownList)m_PlaceHolder.FindControl("drpAspect120")).SelectedValue));
            m_astro.aspectsShow.Add(3, decimal.Parse(((DropDownList)m_PlaceHolder.FindControl("drpAspect90")).SelectedValue));
            m_astro.aspectsShow.Add(5, decimal.Parse(((DropDownList)m_PlaceHolder.FindControl("drpAspect60")).SelectedValue));

            #endregion
            //生成ID并访问图片页
            SetPic();
        }
Exemplo n.º 7
0
 protected void drpDistrict3_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (drpDistrict3.SelectedValue != "0")
     {
         m_area                = SYS_DistrictBll.GetInstance().GetModel(int.Parse(drpDistrict3.SelectedValue));
         ltrLatLng.Text        = "北纬" + m_area.Latitude + " 东经" + m_area.longitude;
         ltrLatLng.Visible     = true;
         ViewState["district"] = m_area;
     }
     //ScriptManager.RegisterStartupScript(drpDistrict3, this.GetType(), "refreshdrop", "$(function () { $('.select_item').scrollablecombo(); });", true);
 }
Exemplo n.º 8
0
 protected void drpDistrict2_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (drpDistrict2.SelectedValue != "0")
     {
         drpDistrict3.DataSource     = SYS_DistrictBll.GetInstance().GetSubLevel(int.Parse(drpDistrict2.SelectedValue));
         drpDistrict3.DataTextField  = "Name";
         drpDistrict3.DataValueField = "SysNo";
         drpDistrict3.DataBind();
         drpDistrict3.Items.Insert(0, new ListItem("请选择", "0"));
     }
 }
Exemplo n.º 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //ImageButton1.ImageUrl = "";
     if (!IsPostBack)
     {
         Repeater1.DataSource = SYS_DistrictBll.GetInstance().GetFirstLevel(1);
         Repeater1.DataBind();
         HiddenField3.Value = "1";
         HiddenField4.Value = "1995-1-1 12:0:0";
         Button2_Click(sender, e);
         MultiView1.ActiveViewIndex = 0;
         ScriptManager.RegisterStartupScript(Page, this.GetType(), "", "initialselect();", true);
     }
 }
Exemplo n.º 10
0
        public ReturnValue <AstroMod> TimeToAstro()
        {
            AstroMod input = null;

            if (input == null)
            {
                input             = new AstroMod();
                input.birth       = DateTime.Now;
                input.position    = new LatLng(SYS_DistrictBll.GetInstance().GetModel(37));
                input.IsDayLight  = AppEnum.BOOL.False;
                input.zone        = -8;
                input.birth1      = DateTime.Now.AddDays(-300);
                input.position1   = new LatLng(SYS_DistrictBll.GetInstance().GetModel(37));
                input.IsDayLight1 = AppEnum.BOOL.False;
                input.zone1       = -8;
                input.type        = PublicValue.AstroType.hepan;
                input.compose     = PublicValue.AstroZuhe.bijiao;
                input.startsShow.Clear();
                for (int i = 1; i <= 30; i++)
                {
                    input.startsShow.Add(i, PublicValue.GetAstroStar((PublicValue.AstroStar)i));
                }
                input.aspectsShow.Clear();
                input.aspectsShow.Add(1, 0);
                input.aspectsShow.Add(2, 180);
                input.aspectsShow.Add(4, 120);
                input.aspectsShow.Add(3, 90);
                input.aspectsShow.Add(5, 60);
            }

            //input.graphicID = AstroBiz.GetInstance().SetGraphicID(input);
            AstroBiz.GetInstance().GetParamters(ref input);
            if ((input.type == PublicValue.AstroType.hepan && input.compose == PublicValue.AstroZuhe.bijiao) || (input.type == PublicValue.AstroType.tuiyun && input.transit == PublicValue.AstroTuiyun.xingyun))
            {
                AstroMod tmpinput = new AstroMod();
                tmpinput.aspectsShow = input.aspectsShow;
                tmpinput.startsShow  = input.startsShow;
                tmpinput.birth       = input.birth;
                tmpinput.position    = input.position;
                tmpinput.IsDayLight  = input.IsDayLight;
                tmpinput.zone        = input.zone;
                AstroBiz.GetInstance().GetParamters(ref tmpinput);
                input.Stars1 = tmpinput.Stars;
            }
            else
            {
                input.Stars1 = null;
            }
            return(ReturnValue <AstroMod> .Get200OK(input));
        }
Exemplo n.º 11
0
        public ReturnValue <SYS_DistrictMod> GetDistrictByPoi(string longitude, string latitude)
        {
            if (string.IsNullOrEmpty(longitude) || string.IsNullOrEmpty(latitude))
            {
                throw new BusinessException("经纬度不可为空");
            }

            SYS_DistrictMod m_dist = SYS_DistrictBll.GetInstance().GetNearestByPoi(longitude, latitude);

            if (m_dist == null)
            {
                throw new BusinessException("无法搜到结果!");
            }
            return(ReturnValue <SYS_DistrictMod> .Get200OK(m_dist));
        }
Exemplo n.º 12
0
        // Methods
        protected void Button1_Click(object sender, EventArgs e)
        {
            AstroMod mod = new AstroMod
            {
                type       = PublicValue.AstroType.benming,
                birth      = new DateTime(int.Parse(this.hfYear.Value), int.Parse(this.hfMonth.Value), int.Parse(this.hfDay.Value), int.Parse(this.hfHour.Value), 0, 0),
                position   = new LatLng(SYS_DistrictBll.GetInstance().GetModel(0x856)),
                IsDayLight = AppEnum.BOOL.False,
                zone       = -8
            };

            for (int i = 1; i < 0x15; i++)
            {
                mod.startsShow.Add(i, "");
            }
            mod.aspectsShow.Clear();
            for (int j = 1; j < 6; j++)
            {
                mod.aspectsShow.Add(j, 5M);
            }
            AstroBiz.GetInstance().GetParamters(ref mod);
            VenusLoveMod model = new VenusLoveMod
            {
                BirthTime = mod.birth,
                Source    = 1,
                TS        = DateTime.Now,
                UserSysNo = QQWeiBoUserBll.GetInstance().GetRecordByName(this.wb_name).SysNo
            };

            VenusLoveBll.GetInstance().Add(model);
            int constellation = 0;

            foreach (Star star in mod.Stars)
            {
                if (star.StarName == PublicValue.AstroStar.Ven)
                {
                    constellation = (int)star.Constellation;
                    break;
                }
            }
            if (constellation != 0)
            {
                this.ltrTitle.Text   = this.titles[constellation - 1];
                this.ltrContext.Text = this.contexts[constellation - 1];
            }
            this.MultiView1.ActiveViewIndex = 1;
            this.ViewState["ele"]           = constellation;
        }
Exemplo n.º 13
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            DataTable m_dt = SYS_DistrictBll.GetInstance().GetSubLevel(int.Parse(HiddenField3.Value));

            Repeater2.DataSource = m_dt;
            Repeater2.DataBind();
            if (m_dt.Rows.Count > 0)
            {
                district2.InnerText = m_dt.Rows[0]["name"].ToString();
                HiddenField2.Value  = m_dt.Rows[0]["sysno"].ToString();
            }
            if (IsPostBack)
            {
                ScriptManager.RegisterStartupScript(UpdatePanel2, UpdatePanel2.GetType(), "refresh", "refreshdistrict();", true);
            }
            //UpdatePanel2.Update();
        }
Exemplo n.º 14
0
 protected void drpDistrict2_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (drpDistrict2.SelectedValue != "0")
     {
         drpDistrict3.DataSource     = SYS_DistrictBll.GetInstance().GetSubLevel(int.Parse(drpDistrict2.SelectedValue));
         drpDistrict3.DataTextField  = "Name";
         drpDistrict3.DataValueField = "SysNo";
         drpDistrict3.DataBind();
         if (drpDistrict3.Items.Count > 0)
         {
             drpDistrict3.SelectedIndex = 0;
             drpDistrict3_SelectedIndexChanged(sender, e);
         }
         //drpDistrict3.Items.Insert(0, new ListItem("请选择", "0"));
     }
     //ScriptManager.RegisterStartupScript(drpDistrict2, this.GetType(), "refreshdrop", "$(function () { $('.select_item').scrollablecombo(); });", true);
 }
Exemplo n.º 15
0
 /// <summary>
 /// 排合盘
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void LinkButton1_Click(object sender, EventArgs e)
 {
     m_astro           = (AstroMod)ViewState["NowChart"];
     m_astro.type      = PublicValue.AstroType.hepan;
     m_astro.compose   = (PublicValue.AstroZuhe) int.Parse(drpCompareType.SelectedValue);
     m_astro.birth1    = DatePicker2.SelectedTime;
     m_astro.position1 = new LatLng(SYS_DistrictBll.GetInstance().GetModel(District2.Area3SysNo));
     if (chkDaylight2.Checked)
     {
         m_astro.IsDayLight1 = AppEnum.BOOL.True;
     }
     else
     {
         m_astro.IsDayLight1 = AppEnum.BOOL.False;
     }
     m_astro.zone1 = int.Parse(drpTimeZone2.SelectedValue);
     SetPara();
     InitialFate();
     ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "hepan", "document.getElementById('" + pnlHePan.ClientID + "').click();", true);
 }
Exemplo n.º 16
0
        protected void Unnamed1_CheckedChanged(object sender, EventArgs e)
        {
            onlychina = ((CheckBox)sender).Checked;
            string selected = drpDistrict1.SelectedValue;

            if (onlychina)
            {
                drpDistrict1.DataSource = SYS_DistrictBll.GetInstance().GetFirstLevel(1);
            }
            else
            {
                drpDistrict1.DataSource = SYS_DistrictBll.GetInstance().GetFirstLevel(0);
            }

            drpDistrict1.DataTextField  = "Name";
            drpDistrict1.DataValueField = "SysNo";
            drpDistrict1.DataBind();

            drpDistrict1.SelectedIndex = drpDistrict1.Items.IndexOf(drpDistrict1.Items.FindByValue(selected));
        }
Exemplo n.º 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (onlychina)
                {
                    drpDistrict1.DataSource = SYS_DistrictBll.GetInstance().GetFirstLevel(1);
                }
                else
                {
                    drpDistrict1.DataSource = SYS_DistrictBll.GetInstance().GetFirstLevel(0);
                }

                drpDistrict1.DataTextField  = "Name";
                drpDistrict1.DataValueField = "SysNo";
                drpDistrict1.DataBind();
                //drpDistrict1.Items.Insert(0, new ListItem("请选择", "0"));

                DataTable m_dt = SYS_DistrictBll.GetInstance().GetTreeDetail(_area1sysno + _area2sysno + _area3sysno);

                if (m_dt.Rows.Count > 0)
                {
                    drpDistrict1.SelectedIndex = drpDistrict1.Items.IndexOf(drpDistrict1.Items.FindByValue(m_dt.Rows[0]["SysNo1"].ToString()));
                    drpDistrict1_SelectedIndexChanged(sender, e);
                    drpDistrict2.SelectedIndex = drpDistrict2.Items.IndexOf(drpDistrict2.Items.FindByValue(m_dt.Rows[0]["SysNo2"].ToString()));
                    drpDistrict2_SelectedIndexChanged(sender, e);
                    drpDistrict3.SelectedIndex = drpDistrict3.Items.IndexOf(drpDistrict3.Items.FindByValue(m_dt.Rows[0]["SysNo3"].ToString()));
                    drpDistrict3_SelectedIndexChanged(sender, e);
                }
                else
                {
                    drpDistrict1.SelectedIndex = drpDistrict1.Items.IndexOf(drpDistrict1.Items.FindByValue("1"));
                    drpDistrict1_SelectedIndexChanged(sender, e);
                    drpDistrict2.SelectedIndex = drpDistrict2.Items.IndexOf(drpDistrict2.Items.FindByValue("45052"));
                    drpDistrict2_SelectedIndexChanged(sender, e);
                    drpDistrict3.SelectedIndex = drpDistrict3.Items.IndexOf(drpDistrict3.Items.FindByValue("37"));
                    drpDistrict3_SelectedIndexChanged(sender, e);
                }
            }
        }
Exemplo n.º 18
0
 public LatLng(SYS_DistrictMod area)
 {
     try
     {
         _area     = area;
         latitude  = decimal.Parse(area.Latitude);
         longitude = decimal.Parse(area.longitude);
         if (latitude < 0)
         {
             Lat = (0 - latitude).ToString("0.00").Replace(".", "S");
         }
         else
         {
             Lat = latitude.ToString("0.00").Replace(".", "N");
         }
         if (longitude < 0)
         {
             Lng = (0 - longitude).ToString("0.00").Replace(".", "W");
         }
         else
         {
             Lng = longitude.ToString("0.00").Replace(".", "E");
         }
         DataTable     m_dt = SYS_DistrictBll.GetInstance().GetTreeDetail(area.SysNo);
         StringBuilder m_sb = new StringBuilder();
         m_sb.Append(m_dt.Rows[0]["Name1"].ToString());
         if (!string.IsNullOrEmpty(m_dt.Rows[0]["Name2"].ToString()))
         {
             m_sb.Append("-").Append(m_dt.Rows[0]["Name2"].ToString());
         }
         if (!string.IsNullOrEmpty(m_dt.Rows[0]["Name3"].ToString()))
         {
             m_sb.Append("-").Append(m_dt.Rows[0]["Name3"].ToString());
         }
         name = m_sb.ToString();
     }
     catch { }
 }
Exemplo n.º 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region 初始化
            Login(Request.RawUrl); CheckPrivilege(Request.RawUrl);
            WebForAdmin.Master.AdminMaster m_master = (WebForAdmin.Master.AdminMaster) this.Master;
            m_master.PageName = "蜘蛛抓取结果";
            m_master.SetCate(WebForAdmin.Master.AdminMaster.CateType.Famous3);
            #endregion
            if (!IsPostBack)
            {
                drpNation.DataSource     = SYS_DistrictBll.GetInstance().GetFirstLevel(0);
                drpNation.DataTextField  = "Name";
                drpNation.DataValueField = "SysNo";
                drpNation.DataBind();
                drpNation.Items.Insert(0, new ListItem("请选择", "0"));

                if (Request.QueryString["pn"] != null && Request.QueryString["pn"] != "")
                {
                    try
                    {
                        pageindex = int.Parse(Request.QueryString["pn"]);
                    }
                    catch { }
                }
                if (Request.QueryString["name"] != null && Request.QueryString["name"] != "")
                {
                    txtName.Text = Request.QueryString["name"];
                }
                if (Request.QueryString["begin"] != null && Request.QueryString["begin"] != "")
                {
                    txtTimeBegin.Text = Request.QueryString["begin"];
                }
                if (Request.QueryString["end"] != null && Request.QueryString["end"] != "")
                {
                    txtTimeEnd.Text = Request.QueryString["end"];
                }
                if (Request.QueryString["input"] != null && Request.QueryString["input"] != "")
                {
                    for (int i = 0; i < drpInput.Items.Count; i++)
                    {
                        if (drpInput.Items[i].Value == Request.QueryString["input"])
                        {
                            drpInput.SelectedIndex = i;
                            break;
                        }
                    }
                }
                if (Request.QueryString["nation"] != null && Request.QueryString["nation"] != "")
                {
                    for (int i = 0; i < drpNation.Items.Count; i++)
                    {
                        if (drpNation.Items[i].Value == Request.QueryString["nation"])
                        {
                            drpNation.SelectedIndex = i;
                            break;
                        }
                    }
                }
                BindContent();
            }
        }
Exemplo n.º 20
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
        }
Exemplo n.º 21
0
        /// <summary>
        /// 批量导入
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Unnamed2_Click(object sender, EventArgs e)
        {
            using (SQLData m_data = new SQLData())
            {
                for (int i = 16831; i < 40965; i++)
                {
                    DataRow m_dr = m_data.CmdtoDataRow("select * from [SPD_Famous] where sysno =" + i);
                    if (m_dr["Name"].ToString() == "" || m_dr["Biography"].ToString() == "" || m_dr["Biography"].ToString() == "SameNameError")
                    {
                        continue;
                    }
                    SYS_FamousMod m_famous = new SYS_FamousMod();
                    if (m_dr["FamousSysNo"].ToString() != "")
                    {
                        m_famous       = SYS_FamousBll.GetInstance().GetModel(int.Parse(m_dr["FamousSysNo"].ToString()));
                        m_famous.Photo = m_dr["photo"].ToString();
                        SYS_FamousBll.GetInstance().Update(m_famous);
                        //Console.WriteLine(m_dr["sysno"] + " update ");
                        continue;
                    }


                    DataTable m_area = SYS_DistrictBll.GetInstance().GetTreeDetail(m_dr["HomeTown"].ToString().Split(new char[] { '(', ',' })[0].Trim());
                    if (!CommonTools.IsDataTableNoRow(m_area))
                    {
                        m_famous.HomeTown = int.Parse(m_area.Rows[0]["SysNo3"].ToString());
                    }

                    string[] tmp    = m_dr["BirthTmp"].ToString().Split(new char[] { '-', ' ', ':' });
                    int      month  = 0;
                    int      day    = 0;
                    int      hour   = 0;
                    int      minute = 0;

                    if (tmp.Length > 6)
                    {
                        if (m_dr["BirthTmp"].ToString().StartsWith("-"))
                        {
                            m_famous.BirthYear = int.Parse("-" + tmp[1]);
                            month = int.Parse(tmp[2].Replace("January", "1").Replace("February", "2").Replace("March", "3")
                                              .Replace("April", "4").Replace("May", "5").Replace("June", "6").Replace("July", "7")
                                              .Replace("August", "8").Replace("September", "9").Replace("October", "10")
                                              .Replace("November", "11").Replace("December", "12"));
                            day = int.Parse(tmp[3]);
                            if (tmp[4] == "12" && tmp[5] == "00" && tmp[6] == "PM")
                            {
                                hour = int.Parse(tmp[4]);
                                m_famous.TimeUnknown = 1;
                            }
                            else
                            {
                                if (tmp[6] == "PM" && tmp[4] != "12")
                                {
                                    hour = (int.Parse(tmp[4]) + 12);
                                }
                                else
                                {
                                    hour = int.Parse(tmp[4]);
                                }
                                m_famous.TimeUnknown = 0;
                            }
                            minute = int.Parse(tmp[5]);
                        }
                    }
                    else
                    {
                        m_famous.BirthYear = int.Parse(tmp[0]);
                        month = int.Parse(tmp[1].Replace("January", "1").Replace("February", "2").Replace("March", "3")
                                          .Replace("April", "4").Replace("May", "5").Replace("June", "6").Replace("July", "7")
                                          .Replace("August", "8").Replace("September", "9").Replace("October", "10")
                                          .Replace("November", "11").Replace("December", "12"));
                        day = int.Parse(tmp[2]);
                        if (tmp[3] == "12" && tmp[4] == "00" && tmp[5] == "PM")
                        {
                            hour = int.Parse(tmp[3]);
                            m_famous.TimeUnknown = 1;
                        }
                        else
                        {
                            if (tmp[5] == "PM" && tmp[3] != "12")
                            {
                                hour = int.Parse(tmp[3]) + 12;
                            }
                            else
                            {
                                hour = int.Parse(tmp[3]);
                            }
                            m_famous.TimeUnknown = 0;
                        }
                        minute = int.Parse(tmp[4]);
                    }

                    m_famous.BirthTime     = new DateTime(8000, month, day, hour, minute, 0);
                    m_famous.CateSysNo     = 1;
                    m_famous.CustomerSysNo = 1;
                    m_famous.Description   = m_dr["Biography"].ToString();
                    m_famous.DR            = 0;
                    m_famous.FullName      = m_dr["FamousName"].ToString();
                    m_famous.Gender        = int.Parse(m_dr["Gender"].ToString());
                    if (m_dr["Height"].ToString() != "")
                    {
                        m_famous.Height = int.Parse(m_dr["Height"].ToString().Replace("m", ""));
                    }
                    m_famous.IsTop  = 0;
                    m_famous.Name   = m_dr["Name"].ToString();
                    m_famous.Source = "AstroTheme";
                    m_famous.TS     = DateTime.Now;
                    m_famous.Photo  = m_dr["photo"].ToString();
                    m_famous.SysNo  = SYS_FamousBll.GetInstance().Add(m_famous);
                    SPD_FamousMod m_spider = SPD_FamousBll.GetInstance().GetModel(i);
                    m_spider.FamousSysNo = m_famous.SysNo;
                    SPD_FamousBll.GetInstance().Update(m_spider);
                    //Console.WriteLine(m_dr["sysno"] + " add ");
                }
            }
        }
Exemplo n.º 22
0
        protected void AddCollection(object sender, EventArgs e)
        {
            int addsysno = 0;
            BLG_CollectionMod m_collection = new BLG_CollectionMod();

            try
            {
                switch (type)
                {
                case (int)AppCmn.AppEnum.CollectionType.quest:
                    if (Request.QueryString["sysno"] == null)
                    {
                        Response.Redirect("../Error.aspx?msg=");
                    }
                    try
                    {
                        addsysno = int.Parse(Request.QueryString["sysno"]);
                    }
                    catch
                    {
                        Response.Redirect("../Error.aspx?msg=");
                    }
                    m_collection.CustomerSysNo = GetSession().CustomerEntity.SysNo;
                    m_collection.DR            = (int)AppEnum.State.normal;
                    m_collection.Name          = "";
                    m_collection.TS            = DateTime.Now;
                    m_collection.Type          = (int)AppEnum.CollectionType.quest;
                    m_collection.RefSysNo      = addsysno;
                    BLG_CollectionBll.GetInstance().Add(m_collection);
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "addquestok", "alert('问题收藏成功');", true);
                    break;

                case (int)AppCmn.AppEnum.CollectionType.article:
                    if (Request.QueryString["sysno"] == null)
                    {
                        Response.Redirect("../Error.aspx?msg=");
                    }
                    try
                    {
                        addsysno = int.Parse(Request.QueryString["sysno"]);
                    }
                    catch
                    {
                        Response.Redirect("../Error.aspx?msg=");
                    }
                    m_collection.CustomerSysNo = GetSession().CustomerEntity.SysNo;
                    m_collection.DR            = (int)AppEnum.State.normal;
                    m_collection.Name          = "";
                    m_collection.TS            = DateTime.Now;
                    m_collection.Type          = (int)AppEnum.CollectionType.article;
                    m_collection.RefSysNo      = addsysno;
                    BLG_CollectionBll.GetInstance().Add(m_collection);
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "addquestok", "alert('文章收藏成功');", true);
                    break;

                case (int)AppCmn.AppEnum.CollectionType.famous:
                    if (Request.QueryString["sysno"] == null)
                    {
                        Response.Redirect("../Error.aspx?msg=");
                    }
                    try
                    {
                        addsysno = int.Parse(Request.QueryString["sysno"]);
                    }
                    catch
                    {
                        Response.Redirect("../Error.aspx?msg=");
                    }
                    m_collection.CustomerSysNo = GetSession().CustomerEntity.SysNo;
                    m_collection.DR            = (int)AppEnum.State.normal;
                    m_collection.Name          = "";
                    m_collection.TS            = DateTime.Now;
                    m_collection.Type          = (int)AppEnum.CollectionType.famous;
                    m_collection.RefSysNo      = addsysno;
                    BLG_CollectionBll.GetInstance().Add(m_collection);
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "addquestok", "alert('名人收藏成功');", true);
                    break;

                case (int)AppCmn.AppEnum.CollectionType.chart:
                    FATE_ChartMod m_fate = new FATE_ChartMod();
                    try
                    {
                        string[] tmps = Request.QueryString["p"].Split(new char[] { '_' });
                        switch (Request.QueryString["minitype"].ToUpper())
                        {
                        case "ASTRO":
                            m_fate.CharType   = (int)AppEnum.ChartType.personal;
                            m_fate.FirstBirth = new DateTime(int.Parse(tmps[0]), int.Parse(tmps[1]), int.Parse(tmps[2]), int.Parse(tmps[3]), int.Parse(tmps[4]), 0);
                            m_fate.FirstPoi   = tmps[7] + "|" + tmps[6];
                            m_fate.Transit    = DateTime.Now;
                            m_fate.TransitPoi = m_fate.FirstPoi;
                            m_fate.TheoryType = 0;
                            DataTable m_dist = SYS_DistrictBll.GetInstance().GetInfoByPoi(tmps[6], tmps[7]);
                            if (m_dist.Rows.Count > 0)
                            {
                                m_fate.FirstPoiName = m_dist.Rows[0]["Name1"] + "-" + m_dist.Rows[0]["Name2"] + "-" + m_dist.Rows[0]["Name3"];
                            }
                            else
                            {
                                m_fate.FirstPoiName = "未知";
                            }
                            m_fate.FirstTimeZone = int.Parse(tmps[8]);
                            m_fate.FirstGender   = int.Parse(drpGender.SelectedValue);
                            if (tmps[5] == "1")
                            {
                                m_fate.FirstDayLight = (int)AppEnum.BOOL.True;
                            }
                            else
                            {
                                m_fate.FirstDayLight = (int)AppEnum.BOOL.False;
                            }
                            break;

                        case "ZIWEI":
                            m_fate.CharType      = (int)AppEnum.ChartType.personal;
                            m_fate.FirstBirth    = new DateTime(int.Parse(tmps[0]), int.Parse(tmps[1]), int.Parse(tmps[2]), int.Parse(tmps[3]), int.Parse(tmps[4]), 0);
                            m_fate.FirstPoi      = "120.129798|30.259497";
                            m_fate.Transit       = DateTime.Now;
                            m_fate.TransitPoi    = m_fate.FirstPoi;
                            m_fate.TheoryType    = 0;
                            m_fate.FirstPoiName  = "浙江省-杭州市-西湖区";
                            m_fate.FirstTimeZone = -8;
                            m_fate.FirstGender   = int.Parse(tmps[5]);
                            m_fate.FirstDayLight = (int)AppEnum.BOOL.False;
                            break;

                        case "BAZI":
                            m_fate.CharType      = (int)AppEnum.ChartType.personal;
                            m_fate.FirstBirth    = new DateTime(int.Parse(tmps[0]), int.Parse(tmps[1]), int.Parse(tmps[2]), int.Parse(tmps[3]), int.Parse(tmps[4]), 0);
                            m_fate.FirstPoi      = "120.129798|30.259497";
                            m_fate.Transit       = DateTime.Now;
                            m_fate.TransitPoi    = m_fate.FirstPoi;
                            m_fate.TheoryType    = 0;
                            m_fate.FirstPoiName  = "浙江省-杭州市-西湖区";
                            m_fate.FirstTimeZone = -8;
                            m_fate.FirstGender   = int.Parse(tmps[5]);
                            m_fate.FirstDayLight = (int)AppEnum.BOOL.False;
                            break;

                        default:
                            Response.Redirect("../Error.aspx?msg=");
                            break;
                        }
                    }
                    catch (Exception ex)
                    {
                        LogManagement.getInstance().WriteException(ex, "Collection-AddFate", Request.UserHostAddress, "收藏命盘失败");
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "addwrong", "alert('系统错误,请联系管理员');", true);
                    }
                    m_collection.CustomerSysNo = GetSession().CustomerEntity.SysNo;
                    m_collection.DR            = (int)AppEnum.State.normal;
                    m_collection.Name          = Server.HtmlEncode(txtName.Text.Trim());
                    m_collection.TS            = DateTime.Now;
                    m_collection.Type          = (int)AppEnum.CollectionType.chart;
                    m_collection.Detail        = Server.HtmlEncode(txtDetail.Text.Trim());
                    m_collection.RefSysNo      = FATE_ChartBll.GetInstance().Add(m_fate);

                    BLG_CollectionBll.GetInstance().Add(m_collection);
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "addfateok", "alert('命盘收藏成功');", true);
                    ModalPopupExtender1.Hide();
                    break;

                case (int)AppCmn.AppEnum.CollectionType.url:
                    m_collection.CustomerSysNo = GetSession().CustomerEntity.SysNo;
                    m_collection.DR            = (int)AppEnum.State.normal;
                    m_collection.Name          = Server.HtmlEncode(txtName.Text.Trim());
                    m_collection.TS            = DateTime.Now;
                    m_collection.Type          = (int)AppEnum.CollectionType.url;
                    m_collection.RefUrl        = Server.HtmlEncode(txtUrl.Text.Trim());
                    m_collection.Detail        = Server.HtmlEncode(txtDetail.Text.Trim());
                    BLG_CollectionBll.GetInstance().Add(m_collection);
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "addquestok", "alert('站外资源收藏成功');", true);
                    break;

                default:
                    Response.Redirect("../Error.aspx?msg=");    //type无效
                    break;
                }
            }
            catch (Exception ex)
            {
                LogManagement.getInstance().WriteException(ex, "Collection-Add", Request.UserHostAddress, "添加收藏失败");
                Page.ClientScript.RegisterStartupScript(this.GetType(), "addwrong", "alert('系统错误,请联系管理员');", true);
            }
            Response.Redirect("MyCollection.aspx?type=" + type);
        }
Exemplo n.º 23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["id"] != null)
            {
                try
                {
                    m_user = USR_CustomerBll.GetInstance().GetModel(int.Parse(Request.QueryString["id"]));
                    if (m_user.SysNo == AppConst.IntNull)
                    {
                        ShowError("");
                    }
                }
                catch
                {
                    ShowError("");
                }
            }
            else if (Page.RouteData.Values["id"] != null)
            {
                try
                {
                    m_user = USR_CustomerBll.GetInstance().GetModel(int.Parse(Page.RouteData.Values["id"].ToString()));
                    if (m_user.SysNo == AppConst.IntNull)
                    {
                        ShowError("");
                    }
                }
                catch
                {
                    ShowError("");
                }
            }
            else
            {
                Login(Request.Url.ToString());
                m_user  = USR_CustomerBll.GetInstance().GetModel(GetSession().CustomerEntity.SysNo);
                m_grade = USR_GradeBll.GetInstance().GetModel(m_user.GradeSysNo);
            }
            try
            {
                if (!IsPostBack)
                {
                    if (m_user.HomeTown != AppConst.IntNull)
                    {
                        SYS_DistrictMod m_dictrict = SYS_DistrictBll.GetInstance().GetModel(SYS_DistrictBll.GetInstance().GetModel(m_user.HomeTown).UpSysNo);
                        ltrFrom.Text = m_dictrict.Name;
                    }
                    else
                    {
                        ltrFrom.Text = "未知";
                    }
                    if (m_user.Birth != AppConst.DateTimeNull)
                    {
                        ltrBirth.Text = "生日:" + m_user.Birth.ToString("yyyy年MM月dd日");
                    }
                    else
                    {
                        ltrBirth.Text = "生日:未知";
                    }
                    BindArticles();
                    BindBestAnswer();
                    BindIcons();

                    LinkButton1_Click(LinkButton1, e);
                }
                if (GetSession().CustomerEntity != null && GetSession().CustomerEntity.SysNo != AppConst.IntNull && m_user.SysNo == GetSession().CustomerEntity.SysNo)
                {
                    ltrMe                 = "我";
                    sendmsg.Visible       = false;
                    intro.HRef            = AppConfig.HomeUrl() + "Qin/UserInfo.aspx?id=" + m_user.SysNo + "&tab=1";
                    ImageButton1.ImageUrl = AppConfig.HomeUrl() + "ControlLibrary/ShowPhoto.aspx?type=o&id=" + m_user.Photo;
                }
                else
                {
                    ltrMe                 = "Ta";
                    intro.Visible         = false;
                    sendmsg.HRef          = AppConfig.HomeUrl() + "Qin/MsgDetail.aspx?UserSysNo=" + m_user.SysNo;
                    ImageButton1.ImageUrl = AppConfig.HomeUrl() + "ControlLibrary/ShowPhoto.aspx?type=o&id=" + m_user.Photo;
                    ImageButton1.Enabled  = false;
                }
                RightPannel1.m_user  = m_user;
                RightPannel1.m_grade = m_grade;
            }
            catch
            {
                ShowError("");
            }

            if (Request.QueryString["pn"] != null)
            {
                try
                {
                    pageindex = int.Parse(Request.QueryString["pn"]);
                }
                catch
                { }
            }
            if (Request.QueryString["tab"] != null)
            {
                try
                {
                    tab = int.Parse(Request.QueryString["tab"]);
                }
                catch
                { }
            }
        }
Exemplo n.º 24
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;
                }
            }
        }
Exemplo n.º 25
0
        protected void PrepareForm()
        {
            #region  项绑定
            drpCate.DataSource     = SYS_Famous_CategoryBll.GetInstance().GetList();
            drpCate.DataTextField  = "Name";
            drpCate.DataValueField = "SysNo";
            drpCate.DataBind();

            drpDistrict1.DataSource     = SYS_DistrictBll.GetInstance().GetFirstLevel(0);
            drpDistrict1.DataTextField  = "Name";
            drpDistrict1.DataValueField = "SysNo";
            drpDistrict1.DataBind();
            drpDistrict1.Items.Insert(0, new ListItem("请选择", "0"));

            chkTime.DataSource     = AppEnum.GetTimeUnknown();
            chkTime.DataTextField  = "Value";
            chkTime.DataValueField = "Key";
            chkTime.DataBind();
            #endregion

            if (type == "ADD")
            {
            }
            else if (type == "EDIT")
            {
                if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
                {
                    try
                    {
                        SysNo = int.Parse(Request.QueryString["id"]);
                        SYS_FamousMod m_famous = SYS_FamousBll.GetInstance().GetModel(SysNo);
                        txtSysNo.Text    = m_famous.SysNo.ToString();
                        txtName.Text     = m_famous.Name;
                        txtFullName.Text = m_famous.FullName;
                        txtDesc.Text     = m_famous.Description;
                        txtYear.Text     = m_famous.BirthYear.ToString();
                        txtMonth.Text    = m_famous.BirthTime.Month.ToString();
                        txtDay.Text      = m_famous.BirthTime.Day.ToString();
                        txtHour.Text     = m_famous.BirthTime.Hour.ToString();
                        txtMinute.Text   = m_famous.BirthTime.Minute.ToString();
                        if (m_famous.Height != AppConst.IntNull)
                        {
                            txtHeight.Text = m_famous.Height.ToString();
                        }

                        chkTime.SelectedIndex   = chkTime.Items.IndexOf(chkTime.Items.FindByValue(m_famous.TimeUnknown.ToString()));
                        drpCate.SelectedIndex   = drpCate.Items.IndexOf(drpCate.Items.FindByValue(m_famous.CateSysNo.ToString()));
                        drpGender.SelectedIndex = drpGender.Items.IndexOf(drpGender.Items.FindByValue(m_famous.Gender.ToString()));

                        DataTable m_area = SYS_DistrictBll.GetInstance().GetTreeDetail(m_famous.HomeTown);
                        if (!CommonTools.IsDataTableNoRow(m_area))
                        {
                            drpDistrict1.SelectedIndex = drpDistrict1.Items.IndexOf(drpDistrict1.Items.FindByValue(m_area.Rows[0]["SysNo1"].ToString()));
                            drpDistrict1_SelectedIndexChanged(new object(), new EventArgs());
                            drpDistrict2.SelectedIndex = drpDistrict2.Items.IndexOf(drpDistrict2.Items.FindByValue(m_area.Rows[0]["SysNo2"].ToString()));
                            drpDistrict2_SelectedIndexChanged(new object(), new EventArgs());
                            drpDistrict3.SelectedIndex = drpDistrict3.Items.IndexOf(drpDistrict3.Items.FindByValue(m_area.Rows[0]["SysNo3"].ToString()));
                            drpDistrict3_SelectedIndexChanged(new object(), new EventArgs());
                        }

                        DataTable m_keydt = REL_Famous_KeyWordBll.GetInstance().GetFamousList(SysNo);
                        if (!AppCmn.CommonTools.IsDataTableNoRow(m_keydt))
                        {
                            for (int i = 0; i < m_keydt.Rows.Count; i++)
                            {
                                txtKey.Text += m_keydt.Rows[i]["KeyWords"].ToString() + " ";
                            }
                            txtKey.Text = txtKey.Text.Trim();
                        }
                    }
                    catch
                    {
                        Response.Redirect("../Error.aspx?msg=");
                        return;
                    }
                }
            }
            else if (type == "INPUT")
            {
                if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
                {
                    try
                    {
                        int           spider   = int.Parse(Request.QueryString["id"]);
                        SPD_FamousMod m_spider = SPD_FamousBll.GetInstance().GetModel(spider);
                        txtSysNo.Text    = "自动生成";
                        txtFullName.Text = m_spider.FamousName;
                        string[] tmp = m_spider.BirthTmp.Split(new char[] { '-', ' ', ':' });

                        if (tmp.Length > 6)
                        {
                            if (m_spider.BirthTmp.StartsWith("-"))
                            {
                                txtYear.Text  = "-" + tmp[1];
                                txtMonth.Text = tmp[2].Replace("January", "1").Replace("February", "2").Replace("March", "3")
                                                .Replace("April", "4").Replace("May", "5").Replace("June", "6").Replace("July", "7")
                                                .Replace("August", "8").Replace("September", "9").Replace("October", "10")
                                                .Replace("November", "11").Replace("December", "12");
                                txtDay.Text = tmp[3];
                                if (tmp[4] == "12" && tmp[5] == "00" && tmp[6] == "PM")
                                {
                                    txtHour.Text          = tmp[4];
                                    chkTime.SelectedIndex = 0;
                                }
                                else
                                {
                                    if (tmp[6] == "PM")
                                    {
                                        txtHour.Text = (int.Parse(tmp[4]) + 12).ToString();
                                    }
                                    else
                                    {
                                        txtHour.Text = tmp[4];
                                    }
                                    chkTime.SelectedIndex = 1;
                                }
                                txtMinute.Text = tmp[5];
                            }
                        }
                        else
                        {
                            txtYear.Text  = tmp[0];
                            txtMonth.Text = tmp[1].Replace("January", "1").Replace("February", "2").Replace("March", "3")
                                            .Replace("April", "4").Replace("May", "5").Replace("June", "6").Replace("July", "7")
                                            .Replace("August", "8").Replace("September", "9").Replace("October", "10")
                                            .Replace("November", "11").Replace("December", "12");
                            txtDay.Text = tmp[2];
                            if (tmp[3] == "12" && tmp[4] == "00" && tmp[5] == "PM")
                            {
                                txtHour.Text          = tmp[3];
                                chkTime.SelectedIndex = 0;
                            }
                            else
                            {
                                if (tmp[5] == "PM")
                                {
                                    txtHour.Text = (int.Parse(tmp[3]) + 12).ToString();
                                }
                                else
                                {
                                    txtHour.Text = tmp[3];
                                }
                                chkTime.SelectedIndex = 1;
                            }
                            txtMinute.Text = tmp[4];
                        }

                        txtHeight.Text          = m_spider.Height.Replace("m", "");
                        drpGender.SelectedIndex = drpGender.Items.IndexOf(drpGender.Items.FindByValue(m_spider.Gender.ToString()));

                        DataTable m_area = SYS_DistrictBll.GetInstance().GetTreeDetail(m_spider.HomeTown.Split(new char[] { '(', ',' })[0].Trim());
                        if (!CommonTools.IsDataTableNoRow(m_area))
                        {
                            drpDistrict1.SelectedIndex = drpDistrict1.Items.IndexOf(drpDistrict1.Items.FindByValue(m_area.Rows[0]["SysNo1"].ToString()));
                            drpDistrict1_SelectedIndexChanged(new object(), new EventArgs());
                            drpDistrict2.SelectedIndex = drpDistrict2.Items.IndexOf(drpDistrict2.Items.FindByValue(m_area.Rows[0]["SysNo2"].ToString()));
                            drpDistrict2_SelectedIndexChanged(new object(), new EventArgs());
                            drpDistrict3.SelectedIndex = drpDistrict3.Items.IndexOf(drpDistrict3.Items.FindByValue(m_area.Rows[0]["SysNo3"].ToString()));
                            drpDistrict3_SelectedIndexChanged(new object(), new EventArgs());
                        }
                    }
                    catch { }
                }
            }
        }
Exemplo n.º 26
0
        public string GetHomeTown(int input)
        {
            DataTable m_dt = SYS_DistrictBll.GetInstance().GetTreeDetail(input);

            if (m_dt.Rows.Count > 0)
            {
                StringBuilder m_sb = new StringBuilder();
                m_sb.Append(m_dt.Rows[0]["Name1"].ToString()).Append("-").Append(m_dt.Rows[0]["Name2"].ToString()).Append("-").Append(m_dt.Rows[0]["Name3"].ToString()).Append("<br />");
                if (m_dt.Rows[0]["longitude3"] != null && m_dt.Rows[0]["longitude3"].ToString() != "")
                {
                    if (decimal.Parse(m_dt.Rows[0]["longitude3"].ToString()) >= 0M)
                    {
                        m_sb.Append(m_dt.Rows[0]["longitude3"].ToString().Replace(".", "E"));
                    }
                    else
                    {
                        m_sb.Append(m_dt.Rows[0]["longitude3"].ToString().Replace(".", "W").Replace("-", ""));
                    }
                    m_sb.Append(" ");
                    if (decimal.Parse(m_dt.Rows[0]["Latitude3"].ToString()) >= 0M)
                    {
                        m_sb.Append(m_dt.Rows[0]["Latitude3"].ToString().Replace(".", "N"));
                    }
                    else
                    {
                        m_sb.Append(m_dt.Rows[0]["Latitude3"].ToString().Replace(".", "S").Replace("-", ""));
                    }
                }
                else if (m_dt.Rows[0]["longitude2"] != null && m_dt.Rows[0]["longitude2"].ToString() != "")
                {
                    if (decimal.Parse(m_dt.Rows[0]["longitude2"].ToString()) >= 0M)
                    {
                        m_sb.Append(m_dt.Rows[0]["longitude2"].ToString().Replace(".", "E"));
                    }
                    else
                    {
                        m_sb.Append(m_dt.Rows[0]["longitude2"].ToString().Replace(".", "W").Replace("-", ""));
                    }
                    m_sb.Append(" ");
                    if (decimal.Parse(m_dt.Rows[0]["Latitude2"].ToString()) >= 0M)
                    {
                        m_sb.Append(m_dt.Rows[0]["Latitude2"].ToString().Replace(".", "N"));
                    }
                    else
                    {
                        m_sb.Append(m_dt.Rows[0]["Latitude2"].ToString().Replace(".", "S").Replace("-", ""));
                    }
                }
                else if (m_dt.Rows[0]["longitude1"] != null && m_dt.Rows[0]["longitude1"].ToString() != "")
                {
                    if (decimal.Parse(m_dt.Rows[0]["longitude1"].ToString()) >= 0M)
                    {
                        m_sb.Append(m_dt.Rows[0]["longitude1"].ToString().Replace(".", "E"));
                    }
                    else
                    {
                        m_sb.Append(m_dt.Rows[0]["longitude1"].ToString().Replace(".", "W").Replace("-", ""));
                    }
                    m_sb.Append(" ");
                    if (decimal.Parse(m_dt.Rows[0]["Latitude1"].ToString()) >= 0M)
                    {
                        m_sb.Append(m_dt.Rows[0]["Latitude1"].ToString().Replace(".", "N"));
                    }
                    else
                    {
                        m_sb.Append(m_dt.Rows[0]["Latitude1"].ToString().Replace(".", "S").Replace("-", ""));
                    }
                }
                return(m_sb.ToString());
            }
            return("未知");
        }
Exemplo n.º 27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Dictionary <string, string> year = new Dictionary <string, string>();
                for (int i = DateTime.Now.Year - 120; i <= DateTime.Now.Year + 50; i++)
                {
                    year.Add(i.ToString(), i.ToString());
                }
                drpYear.DataSource     = year;
                drpYear.DataTextField  = "Key";
                drpYear.DataValueField = "Value";
                drpYear.DataBind();

                Dictionary <string, string> month = new Dictionary <string, string>();
                for (int i = 1; i <= 12; i++)
                {
                    month.Add(i.ToString(), i.ToString());
                }
                drpMonth.DataSource     = month;
                drpMonth.DataTextField  = "Key";
                drpMonth.DataValueField = "Value";
                drpMonth.DataBind();

                Dictionary <string, string> day = new Dictionary <string, string>();
                for (int i = 1; i <= 31; i++)
                {
                    day.Add(i.ToString(), i.ToString());
                }
                drpDay.DataSource     = day;
                drpDay.DataTextField  = "Key";
                drpDay.DataValueField = "Value";
                drpDay.DataBind();

                Dictionary <string, string> hour = new Dictionary <string, string>();
                for (int i = 0; i <= 23; i++)
                {
                    hour.Add(i.ToString(), i.ToString());
                }
                drpHour.DataSource     = hour;
                drpHour.DataTextField  = "Key";
                drpHour.DataValueField = "Value";
                drpHour.DataBind();

                Dictionary <string, string> minute = new Dictionary <string, string>();
                for (int i = 0; i <= 59; i++)
                {
                    minute.Add(i.ToString(), i.ToString());
                }
                drpMinute.DataSource     = minute;
                drpMinute.DataTextField  = "Key";
                drpMinute.DataValueField = "Value";
                drpMinute.DataBind();

                drpYear.SelectedIndex   = drpYear.Items.IndexOf(drpYear.Items.FindByValue(DateTime.Now.Year.ToString()));
                drpMonth.SelectedIndex  = drpMonth.Items.IndexOf(drpMonth.Items.FindByValue(DateTime.Now.Month.ToString()));
                drpDay.SelectedIndex    = drpDay.Items.IndexOf(drpDay.Items.FindByValue(DateTime.Now.Day.ToString()));
                drpHour.SelectedIndex   = drpHour.Items.IndexOf(drpHour.Items.FindByValue(DateTime.Now.Hour.ToString()));
                drpMinute.SelectedIndex = drpMinute.Items.IndexOf(drpMinute.Items.FindByValue(DateTime.Now.Minute.ToString()));

                drpDistrict1.DataSource     = SYS_DistrictBll.GetInstance().GetFirstLevel(0);
                drpDistrict1.DataTextField  = "Name";
                drpDistrict1.DataValueField = "SysNo";
                drpDistrict1.DataBind();
                drpDistrict1.Items.Insert(0, new ListItem("请选择", "0"));
            }
        }
Exemplo n.º 28
0
        protected void Unnamed10_Click(object sender, EventArgs e)
        {
            AstroMod m_astro = new AstroMod();

            #region 设置实体各种参数
            m_astro.birth = new DateTime(int.Parse(drpYear.SelectedValue), int.Parse(drpMonth.SelectedValue), int.Parse(drpDay.SelectedValue),
                                         int.Parse(drpHour.SelectedValue), int.Parse(drpMinute.SelectedValue), 0);
            m_astro.position = new LatLng(SYS_DistrictBll.GetInstance().GetModel(int.Parse(drpDistrict3.SelectedValue)));
            if (chkDaylight.Checked)
            {
                m_astro.IsDaylight = AppEnum.BOOL.True;
            }
            else
            {
                m_astro.IsDaylight = AppEnum.BOOL.False;
            }
            m_astro.houseSystem = int.Parse(drpSOH.SelectedValue);
            m_astro.startsShow.Clear();
            for (int i = 0; i < chkStar.Items.Count; i++)
            {
                if (chkStar.Items[i].Selected)
                {
                    m_astro.startsShow.Add(int.Parse(chkStar.Items[i].Value), chkStar.Items[i].Text);
                }
            }
            try
            {
                m_astro.aspectsShow.Clear();
                if (chkAspect1.Checked)
                {
                    m_astro.aspectsShow.Add(1, decimal.Parse(txtAspect1.Text));
                }
                else
                {
                    m_astro.aspectsShow.Add(1, -1);
                }
                if (chkAspect2.Checked)
                {
                    m_astro.aspectsShow.Add(2, decimal.Parse(txtAspect2.Text));
                }
                else
                {
                    m_astro.aspectsShow.Add(2, -1);
                }
                if (chkAspect3.Checked)
                {
                    m_astro.aspectsShow.Add(4, decimal.Parse(txtAspect3.Text));
                }
                else
                {
                    m_astro.aspectsShow.Add(4, -1);
                }
                if (chkAspect4.Checked)
                {
                    m_astro.aspectsShow.Add(3, decimal.Parse(txtAspect4.Text));
                }
                else
                {
                    m_astro.aspectsShow.Add(3, -1);
                }
                if (chkAspect5.Checked)
                {
                    m_astro.aspectsShow.Add(5, decimal.Parse(txtAspect5.Text));
                }
                else
                {
                    m_astro.aspectsShow.Add(5, -1);
                }
            }
            catch
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('输入容许度格式有误');", true);
            }
            #endregion
            //生成ID并访问图片页
            Image1.ImageUrl = "AstroChart.aspx?ID=" + AstroBiz.GetInstance().SetGraphicID(m_astro)
                              + "&fa=" + m_astro.composeFile1.Replace(AppDomain.CurrentDomain.BaseDirectory + AppConfig.AstroGraphicPath() + @"Tmp\", "")
                              + "&fb=" + m_astro.composeFile2.Replace(AppDomain.CurrentDomain.BaseDirectory + AppConfig.AstroGraphicPath() + @"Tmp\", "");
            Image1.Visible = true;
        }
Exemplo n.º 29
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=";
        }
Exemplo n.º 30
0
        public ReturnValue <AstroMod> TimeToAstro(Stream openPageData)
        {
            AstroMod     input      = null;
            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.UTF8.GetString(byteJson);

            if (!string.IsNullOrEmpty(textJson))
            {
                input = XMS.Core.Json.JsonSerializer.Deserialize <AstroMod>(textJson);
            }

            if (input == null)
            {
                input            = new AstroMod();
                input.birth      = DateTime.Now;
                input.position   = new LatLng(SYS_DistrictBll.GetInstance().GetModel(37));
                input.IsDayLight = AppEnum.BOOL.False;
                input.zone       = -8;

                input.birth1      = DateTime.Now.AddDays(-300);
                input.position1   = new LatLng(SYS_DistrictBll.GetInstance().GetModel(37));
                input.IsDayLight1 = AppEnum.BOOL.False;
                input.zone1       = -8;
                input.type        = PublicValue.AstroType.benming;
                input.compose     = PublicValue.AstroZuhe.bijiao;
            }
            input.startsShow.Clear();
            for (int i = 1; i <= 30; i++)
            {
                input.startsShow.Add(i, PublicValue.GetAstroStar((PublicValue.AstroStar)i));
            }
            input.aspectsShow.Clear();
            input.aspectsShow.Add(1, 0);
            input.aspectsShow.Add(2, 180);
            input.aspectsShow.Add(4, 120);
            input.aspectsShow.Add(3, 90);
            input.aspectsShow.Add(5, 60);


            //input.graphicID = AstroBiz.GetInstance().SetGraphicID(input);

            if ((input.type == PublicValue.AstroType.hepan && input.compose == PublicValue.AstroZuhe.bijiao) || (input.type == PublicValue.AstroType.tuiyun && input.transit == PublicValue.AstroTuiyun.xingyun))
            {
                AstroMod tmpinput = new AstroMod();
                tmpinput.aspectsShow = input.aspectsShow;
                tmpinput.startsShow  = input.startsShow;
                tmpinput.birth       = input.birth;
                tmpinput.position    = input.position;
                tmpinput.IsDayLight  = input.IsDayLight;
                tmpinput.zone        = input.zone;
                AstroBiz.GetInstance().GetParamters(ref tmpinput);
                input.Stars = tmpinput.Stars;

                tmpinput             = new AstroMod();
                tmpinput.aspectsShow = input.aspectsShow;
                tmpinput.startsShow  = input.startsShow;
                tmpinput.birth       = input.birth1;
                tmpinput.position    = input.position1;
                tmpinput.IsDayLight  = input.IsDayLight1;
                tmpinput.zone        = input.zone1;
                AstroBiz.GetInstance().GetParamters(ref tmpinput);
                input.Stars1 = tmpinput.Stars;
            }
            else
            {
                AstroBiz.GetInstance().GetParamters(ref input);
                input.Stars1 = null;
            }
            return(ReturnValue <AstroMod> .Get200OK(input));
        }