Example #1
0
 private void BindData()
 {
     System.Collections.Generic.List <GuiGeItemImage> list = new System.Collections.Generic.List <GuiGeItemImage>();
     string[] array = this.arrGuiGeItems;
     for (int i = 0; i < array.Length; i++)
     {
         string guiGeItem = array[i];
         list.Add(new GuiGeItemImage
         {
             GuiGeItem = guiGeItem,
             ImgPath   = string.Empty
         });
     }
     if (this.proID > 0)
     {
         GuiGePicInfo byProID = GuiGePic.GetByProID(this.proID);
         if (byProID != null && byProID.ImagesCollections != null && byProID.ImagesCollections.Count > 0 && byProID.ClassID == this.classID && byProID.GuiGeName == this.guigeName)
         {
             foreach (GuiGeItemImage current in byProID.ImagesCollections)
             {
                 for (int j = 0; j < list.Count; j++)
                 {
                     if (current.GuiGeItem == list[j].GuiGeItem)
                     {
                         list[j].ImgPath = current.ImgPath;
                     }
                 }
             }
         }
     }
     this.Repeater1.DataSource = list;
     this.Repeater1.DataBind();
 }
Example #2
0
        public static int Add(GuiGePicInfo entity)
        {
            int result;

            if (entity == null)
            {
                result = 0;
            }
            else
            {
                result = BizBase.dbo.InsertModel <GuiGePicInfo>(entity);
            }
            return(result);
        }
Example #3
0
 private void SaveGuiGePic(ProductInfo pro)
 {
     if (pro != null && this.goodsClass != null)
     {
         GuiGeSet guiGeSet = (from p in this.goodsClass.GeiGeSets
                              where p.IsImageShow
                              select p).FirstOrDefault <GuiGeSet>();
         string formString = WebUtils.GetFormString("hdf_backguigepic");
         if (guiGeSet != null && !string.IsNullOrEmpty(formString))
         {
             GuiGePic.DelByProID(pro.AutoID);
             GuiGePicInfo entity = new GuiGePicInfo
             {
                 ProID            = pro.AutoID,
                 ClassID          = pro.ClassID,
                 GuiGeName        = guiGeSet.GuiGeName,
                 ImagesCollection = formString,
                 AutoTimeStamp    = System.DateTime.Now
             };
             GuiGePic.Add(entity);
         }
     }
 }
Example #4
0
 public static bool Update(GuiGePicInfo entity)
 {
     return(entity != null && BizBase.dbo.UpdateModel <GuiGePicInfo>(entity));
 }