Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            WebForMain.Master.Main m_master = (WebForMain.Master.Main)Master;
            m_master.SetTab(1);
            if (!IsPostBack)
            {
                Login(Request.Url.ToString());


                SortedList <int, string> timezone = new SortedList <int, string>();
                timezone.Add(0, "零时区");
                for (int i = 1; i < 13; i++)
                {
                    timezone.Add(0 - i, "东" + i + "区");
                }
                for (int i = 1; i < 13; i++)
                {
                    timezone.Add(i, "西" + i + "区");
                }

                drpTimeZone1.DataSource     = timezone;
                drpTimeZone1.DataTextField  = "value";
                drpTimeZone1.DataValueField = "key";
                drpTimeZone1.DataBind();
                drpTimeZone1.SelectedIndex = 4;

                drpTimeZone2.DataSource     = timezone;
                drpTimeZone2.DataTextField  = "value";
                drpTimeZone2.DataValueField = "key";
                drpTimeZone2.DataBind();
                drpTimeZone2.SelectedIndex = 4;

                DataTable m_dt = QA_CategoryBll.GetInstance().GetCates(2);
                //m_dt.Columns.Add("SysNo");
                //m_dt.Columns.Add("Name");
                //for (int i = 0; i < parent.Rows.Count; i++)
                //{
                //    DataTable tmp = QA_CategoryBll.GetInstance().GetCates(int.Parse(parent.Rows[i]["SysNo"].ToString()));
                //    for(int j=0;j<tmp.Rows.Count;j++)
                //    {
                //        DataRow m_dr = m_dt.NewRow();
                //        m_dr["SysNo"] = tmp.Rows[j]["SysNo"];
                //        m_dr["Name"] = parent.Rows[i]["Name"].ToString()+"-"+tmp.Rows[j]["Name"].ToString();
                //        m_dt.Rows.Add(m_dr);
                //    }
                //}
                drpCate.DataSource     = m_dt;
                drpCate.DataValueField = "SysNo";
                drpCate.DataTextField  = "Name";
                drpCate.DataBind();
                drpCate.Items.Insert(0, new ListItem("请选择", "0"));

                drpType.DataSource     = AppEnum.GetChartType();
                drpType.DataTextField  = "value";
                drpType.DataValueField = "key";
                drpType.DataBind();
                drpType.SelectedIndex = 0;

                //ltrPoint.Text = GetSession().CustomerEntity.Point.ToString();
            }
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            WebForMain.Master.Main m_master = (WebForMain.Master.Main)Master;
            m_master.SetTab(1);
            if (!IsPostBack)
            {
                Login(Request.Url.ToString());


                SortedList <int, string> timezone = new SortedList <int, string>();
                timezone.Add(0, "零时区");
                for (int i = 1; i < 13; i++)
                {
                    timezone.Add(0 - i, "东" + i + "区");
                }
                for (int i = 1; i < 13; i++)
                {
                    timezone.Add(i, "西" + i + "区");
                }

                drpTimeZone1.DataSource     = timezone;
                drpTimeZone1.DataTextField  = "value";
                drpTimeZone1.DataValueField = "key";
                drpTimeZone1.DataBind();
                drpTimeZone1.SelectedIndex = 4;

                drpTimeZone2.DataSource     = timezone;
                drpTimeZone2.DataTextField  = "value";
                drpTimeZone2.DataValueField = "key";
                drpTimeZone2.DataBind();
                drpTimeZone2.SelectedIndex = 4;

                DataTable m_dt = QA_CategoryBll.GetInstance().GetCates(1);
                //m_dt.Columns.Add("SysNo");
                //m_dt.Columns.Add("Name");
                //for (int i = 0; i < parent.Rows.Count; i++)
                //{
                //    DataTable tmp = QA_CategoryBll.GetInstance().GetCates(int.Parse(parent.Rows[i]["SysNo"].ToString()));
                //    for(int j=0;j<tmp.Rows.Count;j++)
                //    {
                //        DataRow m_dr = m_dt.NewRow();
                //        m_dr["SysNo"] = tmp.Rows[j]["SysNo"];
                //        m_dr["Name"] = parent.Rows[i]["Name"].ToString()+"-"+tmp.Rows[j]["Name"].ToString();
                //        m_dt.Rows.Add(m_dr);
                //    }
                //}
                drpCate.DataSource     = m_dt;
                drpCate.DataValueField = "SysNo";
                drpCate.DataTextField  = "Name";
                drpCate.DataBind();
                drpCate.Items.Insert(0, new ListItem("请选择", "0"));

                drpType.DataSource     = AppEnum.GetChartType();
                drpType.DataTextField  = "value";
                drpType.DataValueField = "key";
                drpType.DataBind();
                drpType.SelectedIndex = 1;

                ltrPoint.Text = GetSession().CustomerEntity.Point.ToString();

                #region 占星骰子问题
                if ((Request.QueryString["type"] != null && Request.QueryString["type"] == "dice") ||
                    (Page.RouteData.Values["type"] != null && Page.RouteData.Values["type"].ToString() == "dice"))
                {
                    try
                    {
                        int star          = int.Parse(Request.QueryString["star"]) + 1;
                        int house         = int.Parse(Request.QueryString["house"]) + 1;
                        int constellation = int.Parse(Request.QueryString["const"]) + 1;
                        txtTitle.Text         = Request.QueryString["ask"] + " #" + PublicValue.GetAstroStar(star) + " " + house + "宫 " + PublicValue.GetConstellation(constellation) + "#";
                        drpType.SelectedIndex = drpType.Items.IndexOf(drpType.Items.FindByValue("0"));
                        drpCate.SelectedIndex = drpCate.Items.IndexOf(drpCate.Items.FindByValue("7"));
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "touzi", "qaTypeChanged(document.getElementById('" + drpType.ClientID + "'));", true);
                    }
                    catch { }
                }

                #endregion

                #region 排盘跳转解析
                else if (Request.QueryString["type"] != null)
                {
                    try
                    {
                        string[] chart1 = Request.QueryString["chart1"].Split(new char[] { '_' });
                        DatePicker1.SelectedTime = DateTime.Parse(chart1[0] + " " + chart1[1] + ":00");
                        District1.Area3SysNo     = int.Parse(chart1[3]);
                        if (Convert.ToBoolean(int.Parse(chart1[2])))
                        {
                            chkDaylight1.Checked = true;
                        }
                        drpGender1.SelectedIndex = drpGender1.Items.IndexOf(drpGender1.Items.FindByValue(chart1[4]));
                        drpType.SelectedIndex    = drpType.Items.IndexOf(drpType.Items.FindByValue("1"));

                        if (Request.QueryString["type"] == ((int)PublicValue.AstroType.hepan).ToString())
                        {
                            string[] chart2 = Request.QueryString["chart2"].Split(new char[] { '_' });
                            DatePicker2.SelectedTime = DateTime.Parse(chart2[0] + " " + chart2[1] + ":00");
                            District2.Area3SysNo     = int.Parse(chart2[3]);
                            if (Convert.ToBoolean(int.Parse(chart2[2])))
                            {
                                chkDaylight2.Checked = true;
                            }
                            drpGender2.SelectedIndex = drpGender2.Items.IndexOf(drpGender2.Items.FindByValue(chart2[4]));
                            drpType.SelectedIndex    = drpType.Items.IndexOf(drpType.Items.FindByValue("2"));
                        }
                    }
                    catch { }
                }
                #endregion
            }
        }