Exemplo n.º 1
0
        public ProStore()
        {
            InitializeComponent();
            for (int i = 0; i < 18; i++)
            {
                pis[i] = new uc.ucProInfo();

                pnlPro.Controls.Add(pis[i]);
            }
            DALProInfo dpi = new DALProInfo();
            List<string> cates = dpi.GetProCatesByAreaID(GlobalValue.GShop.AreaInfo.AreaID).ToList();
            GlobalFun.LoadProCate(cates, tabControl1);
            DALShopStore dss = new DALShopStore();
            ss = dss.GetShopStoreByShopID(GlobalValue.GShop.ShopID);
            ShowByCateAndPageNo(tabControl1.TabPages[0]);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 更新本地图片
 /// </summary>
 private void UpDateImage()
 {
     string ImgPath = Application.StartupPath + "\\ProImg\\";
     if (!System.IO.Directory.Exists(ImgPath))
     {
         System.IO.Directory.CreateDirectory(ImgPath);
     }
     DALSysSettings dss = new DALSysSettings();
     Sys_Settings ss = dss.GetValue(GlobalValue.GShop.ShopID.ToString() + "/ProUpDateTime");
     DateTime dt = Convert.ToDateTime("2000-01-01");
     if (ss != null)
     {
         DateTime.TryParse(ss.Value, out dt);
     }
     IList<ProInfo> pis = new DALProInfo().GetProsByLastUpDateTime(dt);
     WebClient wc = new WebClient();
     foreach (ProInfo pi in pis)
     {
         //通过HTTP取得服务器上的图片数据,保存到本地的ImaPath路径下
         try
         {
             wc.DownloadFile("http://LocalHost/propic/imgsmall/" + pi.PicName, ImgPath + pi.PicName);
         }
         catch
         {
         }
     }
     //取得服务器时间
     if (ss == null)
     {
         ss = new Sys_Settings();
         ss.Name = GlobalValue.GShop.ShopID.ToString() + "/ProUpDateTime";
     }
     ss.Value = new CommonFunctions().GetServerTime().ToString();
     dss.Save(ss);
 }
Exemplo n.º 3
0
 public void LoadProInfos()
 {
     DALProInfo dpi = new DALProInfo();
     GlobalValue.GProInfos = dpi.GetProsByAreaID(GlobalValue.GShop.AreaInfo.AreaID);
 }
Exemplo n.º 4
0
        private void ProSelect_Load(object sender, EventArgs e)
        {
            Size ItemSize = new Size(190, 190);
            int ColAmount = 6;
            int InitTop = 10, RowSpace = 10;

            int btnIndex = 0;
            int space = (this.Width - ColAmount * ItemSize.Width) / (ColAmount + 1);

            foreach (uc.ucProInfo pi in pis)
            {
                int currentRow = btnIndex / ColAmount;
                int currentCol = btnIndex % ColAmount;
                int left = space + (ItemSize.Width + space) * currentCol;
                int top = InitTop + (RowSpace + ItemSize.Height) * currentRow;

                pi.Left = left;
                pi.Top = top;
                pi.Size = ItemSize;

                pi.ProInfo = null;
                pi.OnSelectPro += new uc.ucProInfo.SelectPro(pi_OnSelectPro);
                btnIndex++;
            }

            DALProInfo dpi = new DALProInfo();
            List<string> cates = dpi.GetProCatesByAreaID(GlobalValue.GShop.AreaInfo.AreaID).ToList();
            GlobalFun.LoadProCate(cates, tabControl1);

            ShowByCateAndPageNo(tabControl1.TabPages[0]);
        }