コード例 #1
0
ファイル: Index.cs プロジェクト: gaoyussdut/fragsmart
        /// <summary>
        /// 上一页
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void shangye_Button(object sender, EventArgs e)
        {
            if (Index.page == 1)
            {
                MessageBox.Show("已经到首页");
                return;
            }
            this.splashScreenManager.ShowWaitForm();
            this.splashScreenManager.SetWaitFormCaption("请稍后,正在加载中....");        // 标题
            this.splashScreenManager.SetWaitFormDescription("正在初始化.....");       // 信息
            Index.page--;
            this.panel1.Controls.Clear();
            height = 0;
            width  = 0;
            int       i  = 0;
            DataTable dt = ImpService.initStyle(this.textBox1.Text, Index.page);

            //if (dt.Rows.Count == 0)
            //{
            //    MessageBox.Show("已经是最后一页");
            //    ImpService.page--;
            //    dt = ImpService.initStyle(this.textBox1.Text, ImpService.page);
            //}
            panelLocition = new PanelLocition(this.panel1.Width, this.panel1.Height, dt.Rows.Count);
            foreach (DataRow dr in dt.Rows)
            {
                StyleCard sc = new StyleCard();
                sc.stylecardlabel.Text       = dr["styleEntity.styleNameCn"].ToString();
                sc.kuanshiid                 = dr["styleId"].ToString();
                sc.kuanshimingcheng          = dr["styleEntity.styleNameCn"].ToString();
                sc.mianliaoid                = dr["materialEntity.id"].ToString();
                sc.mianliaomingcheng         = dr["materialEntity.materialNameCn"].ToString();
                sc.sTYLE_CATEGORY_CD         = dr["styleEntity.styleCategoryCd"].ToString();
                sc.sTYLE_FIT_CD              = dr["styleEntity.styleFitCd"].ToString();
                sc.sTYLE_SIZE_GROUP_CD       = dr["styleEntity.styleSizeGroupCd"].ToString();
                sc.sTYLE_DRESS_CATEGORY      = dr["styleEntity.styleDressCategory"].ToString();
                sc.sTYLE_DESIGN_TYPE         = dr["styleEntity.styleDesignType"].ToString();
                sc.sTYLE_PUBLISH_CATEGORY_CD = dr["styleEntity.stylePublishCategoryCd"].ToString();
                sc.sYTLE_YEAR                = dr["styleEntity.sytleYear"].ToString();
                sc.sYTLE_SEASON              = dr["styleEntity.sytleSeason"].ToString();
                //sc.id = cd.id;
                //sc.banid = cd.banid;
                //sc.jiage = cd.jiage;
                sc.picture = @"pic\" + dr["picn"].ToString();
                this.generateUserControl(sc, i);
                this.panel1.Controls.Add(sc);//将控件加入panel
                try
                {
                    sc.stylecardpicbox.Image = Image.FromFile(sc.picture);
                }
                catch
                {
                }
                i++;
            }
            this.fenYeLan1.label1.Text = Index.page.ToString();
            this.splashScreenManager.CloseWaitForm();
        }
コード例 #2
0
ファイル: Index.cs プロジェクト: gaoyussdut/fragsmart
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            this.splashScreenManager.ShowWaitForm();
            this.splashScreenManager.SetWaitFormCaption("请稍后,正在加载中....");        // 标题
            this.splashScreenManager.SetWaitFormDescription("正在初始化.....");       // 信息

            Index.page = 1;

            /*
             * Style stylee = new Style();
             * //  模糊查询,返回匹配的款式名
             * List<Card> styleReturn
             *  = this.onFindKeyWord(
             *      textBox1.Text
             *      //, new Style().Styles    //  款式名
             *      , stylee.Card    //  款式名
             *
             *  );*/

            //  布局方法
            this.panel1.Controls.Clear();
            height = 0;
            width  = 0;
            int       i  = 0;
            DataTable dt = ImpService.initStyle(this.textBox1.Text, Index.page);

            panelLocition = new PanelLocition(this.panel1.Width, this.panel1.Height, dt.Rows.Count);
            foreach (DataRow dr in dt.Rows)
            {
                StyleCard sc = new StyleCard();
                sc.stylecardlabel.Text       = dr["styleEntity.styleNameCn"].ToString();
                sc.kuanshiid                 = dr["styleId"].ToString();
                sc.kuanshimingcheng          = dr["styleEntity.styleNameCn"].ToString();
                sc.mianliaoid                = dr["materialEntity.id"].ToString();
                sc.mianliaomingcheng         = dr["materialEntity.materialNameCn"].ToString();
                sc.sTYLE_CATEGORY_CD         = dr["styleEntity.styleCategoryCd"].ToString();
                sc.sTYLE_FIT_CD              = dr["styleEntity.styleFitCd"].ToString();
                sc.sTYLE_SIZE_GROUP_CD       = dr["styleEntity.styleSizeGroupCd"].ToString();
                sc.sTYLE_DRESS_CATEGORY      = dr["styleEntity.styleDressCategory"].ToString();
                sc.sTYLE_DESIGN_TYPE         = dr["styleEntity.styleDesignType"].ToString();
                sc.sTYLE_PUBLISH_CATEGORY_CD = dr["styleEntity.stylePublishCategoryCd"].ToString();
                sc.sYTLE_YEAR                = dr["styleEntity.sytleYear"].ToString();
                sc.sYTLE_SEASON              = dr["styleEntity.sytleSeason"].ToString();
                //sc.id = cd.id;
                //sc.banid = cd.banid;
                //sc.jiage = cd.jiage;
                sc.picture = @"pic\" + dr["picn"].ToString();
                this.generateUserControl(sc, i);
                this.panel1.Controls.Add(sc);//将控件加入panel
                try
                {
                    //string url = string.Format(@cd.picture, 5, 123456);
                    //string url = string.Format(@"https://sshirtmtmbucket.oss-cn-zhangjiakou.aliyuncs.com/sshirtmtm/ZSF-1-320.jpg?size={0}&content={1}", 5, 123456);

                    /*
                     * System.Net.WebRequest webreq = System.Net.WebRequest.Create(sc.picture);
                     * System.Net.WebResponse webres = webreq.GetResponse();
                     *
                     * using (System.IO.Stream stream = webres.GetResponseStream())
                     * {
                     *  sc.stylecardpicbox.Image = Image.FromStream(stream);
                     * }
                     */
                    sc.stylecardpicbox.Image = Image.FromFile(sc.picture);
                }
                catch
                {
                }
                i++;
                this.fenYeLan1.label1.Text = Index.page.ToString();
            }
            this.splashScreenManager.CloseWaitForm();

            //foreach (Card cd in styleReturn)
            //{
            //    StyleCard sc=new StyleCard();
            //    sc.stylecardlabel.Text = cd.kuanshiid+cd.kuanshiming+"\n面料:"+cd.mianliaoid;
            //    sc.kuanshiid = cd.kuanshiid;
            //    sc.kuanshimingcheng = cd.kuanshiming;
            //    sc.mianliaoid = cd.mianliaoid;
            //    sc.mianliaomingcheng = cd.mianliaomingcheng;
            //    sc.id = cd.id;
            //    sc.banid = cd.banid;
            //    sc.jiage = cd.jiage;
            //    sc.picture = cd.picture;
            //    this.generateUserControl(sc, i);
            //    this.panel1.Controls.Add(sc);//将控件加入panel
            //    try
            //    {
            //        //string url = string.Format(@cd.picture, 5, 123456);
            //        //string url = string.Format(@"https://sshirtmtmbucket.oss-cn-zhangjiakou.aliyuncs.com/sshirtmtm/ZSF-1-320.jpg?size={0}&content={1}", 5, 123456);
            //        System.Net.WebRequest webreq = System.Net.WebRequest.Create(cd.picture);
            //        System.Net.WebResponse webres = webreq.GetResponse();
            //        using (System.IO.Stream stream = webres.GetResponseStream())
            //        {
            //            sc.stylecardpicbox.Image = Image.FromStream(stream);
            //        }
            //    }
            //    catch
            //    {

            //    }
            //    i++;
            //}
        }