示例#1
0
        public void GetImage()
        {
            try
            {
                DataSet Ds = new DataSet();

                if (monthrank1image.ToString() == null || monthrank1image.ToString() == "")
                {
                    rank1img.Src = "../UI/Image/altImg.jpg";
                }
                else
                {
                    Ds = Dm.GetImage(monthrank1image);
                    string img1mon     = Ds.Tables[0].Rows[0].ItemArray[0].ToString();
                    string img1monpath = "../UI/Image/" + img1mon;
                    rank1img.Src = img1monpath;
                }

                if (monthrank2image.ToString() == null || monthrank2image.ToString() == "")
                {
                    rank2img.Src = "../UI/Image/altImg.jpg";
                }
                else
                {
                    Ds = Dm.GetImage(monthrank2image);
                    string img2mon     = Ds.Tables[0].Rows[0].ItemArray[0].ToString();
                    string img2monpath = "../UI/Image/" + img2mon;
                    rank2img.Src = img2monpath;
                }

                if (monthrank3image.ToString() == null || monthrank3image.ToString() == "")
                {
                    rank3img.Src = "../UI/Image/altImg.jpg";
                }
                else
                {
                    Ds = Dm.GetImage(monthrank3image);
                    string img3mon     = Ds.Tables[0].Rows[0].ItemArray[0].ToString();
                    string img3monpath = "../UI/Image/" + img3mon;
                    rank3img.Src = img3monpath;
                }

                if (yearrank1image.ToString() == null || yearrank1image.ToString() == "")
                {
                    yearrank1img.Src = "../UI/Image/altImg.jpg";
                }
                else
                {
                    Ds = Dm.GetImage(yearrank1image);
                    string img1year     = Ds.Tables[0].Rows[0].ItemArray[0].ToString();
                    string img1yearpath = "../UI/Image/" + img1year;
                    yearrank1img.Src = img1yearpath;
                }


                if (yearrank2image.ToString() == null || yearrank2image.ToString() == "")
                {
                    yearrank2img.Src = "../UI/Image/altImg.jpg";
                }
                else
                {
                    Ds = Dm.GetImage(yearrank2image);
                    string img2year     = Ds.Tables[0].Rows[0].ItemArray[0].ToString();
                    string img2yearpath = "../UI/Image/" + img2year;
                    yearrank2img.Src = img2yearpath;
                }

                if (yearrank3image.ToString() == null || yearrank3image.ToString() == "")
                {
                    yearrank3img.Src = "../UI/Image/altImg.jpg";
                }
                else
                {
                    Ds = Dm.GetImage(yearrank3image);
                    string img3year     = Ds.Tables[0].Rows[0].ItemArray[0].ToString();
                    string img3yearpath = "../UI/Image/" + img3year;
                    yearrank3img.Src = img3yearpath;
                }
            }
            catch (Exception e1)
            {
            }
        }