示例#1
0
        public void monthRank()
        {
            try
            {
                DataSet Ds = new DataSet();
                Ds = Dm.Ranking1Month();

                int Rowcount = Ds.Tables[0].Rows.Count;
                if (Rowcount == 1)
                {
                    monthrank1image = Ds.Tables[0].Rows[0].ItemArray[1].ToString();
                    rank1Id.Text    = Ds.Tables[0].Rows[0].ItemArray[1].ToString();
                    rank1Name.Text  = Ds.Tables[0].Rows[0].ItemArray[2].ToString();
                    rank1count.Text = Ds.Tables[0].Rows[0].ItemArray[0].ToString();

                    monthrank2image = "";
                    rank2Id.Text    = "";
                    rank2Name.Text  = "";
                    rank2count.Text = "";

                    monthrank3image = "";
                    rank3Id.Text    = "";
                    rank3Name.Text  = "";
                    rank3count.Text = "";
                }
                else if (Rowcount == 2)
                {
                    monthrank1image = Ds.Tables[0].Rows[0].ItemArray[1].ToString();
                    rank1Id.Text    = Ds.Tables[0].Rows[0].ItemArray[1].ToString();
                    rank1Name.Text  = Ds.Tables[0].Rows[0].ItemArray[2].ToString();
                    rank1count.Text = Ds.Tables[0].Rows[0].ItemArray[0].ToString();

                    monthrank2image = Ds.Tables[0].Rows[1].ItemArray[1].ToString();
                    rank2Id.Text    = Ds.Tables[0].Rows[1].ItemArray[1].ToString();
                    rank2Name.Text  = Ds.Tables[0].Rows[1].ItemArray[2].ToString();
                    rank2count.Text = Ds.Tables[0].Rows[1].ItemArray[0].ToString();

                    monthrank3image = "";
                    rank3Id.Text    = "";
                    rank3Name.Text  = "";
                    rank3count.Text = "";
                }
                else if (Rowcount == 3)
                {
                    monthrank1image = Ds.Tables[0].Rows[0].ItemArray[1].ToString();
                    rank1Id.Text    = Ds.Tables[0].Rows[0].ItemArray[1].ToString();
                    rank1Name.Text  = Ds.Tables[0].Rows[0].ItemArray[2].ToString();
                    rank1count.Text = Ds.Tables[0].Rows[0].ItemArray[0].ToString();

                    monthrank2image = Ds.Tables[0].Rows[1].ItemArray[1].ToString();
                    rank2Id.Text    = Ds.Tables[0].Rows[1].ItemArray[1].ToString();
                    rank2Name.Text  = Ds.Tables[0].Rows[1].ItemArray[2].ToString();
                    rank2count.Text = Ds.Tables[0].Rows[1].ItemArray[0].ToString();

                    monthrank3image = Ds.Tables[0].Rows[2].ItemArray[1].ToString();
                    rank3Id.Text    = Ds.Tables[0].Rows[2].ItemArray[1].ToString();
                    rank3Name.Text  = Ds.Tables[0].Rows[2].ItemArray[2].ToString();
                    rank3count.Text = Ds.Tables[0].Rows[2].ItemArray[0].ToString();
                }
                else
                {
                    monthrank1image = "";
                    rank1Id.Text    = "";
                    rank1Name.Text  = "";
                    rank1count.Text = "";

                    monthrank2image = "";
                    rank2Id.Text    = "";
                    rank2Name.Text  = "";
                    rank2count.Text = "";

                    monthrank3image = "";
                    rank3Id.Text    = "";
                    rank3Name.Text  = "";
                    rank3count.Text = "";
                }
            }
            catch (Exception e1)
            {
            }
        }