/// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Maticsoft.Model.BusPhotoAlbum DataRowToModel(DataRow row)
 {
     Maticsoft.Model.BusPhotoAlbum model=new Maticsoft.Model.BusPhotoAlbum();
     if (row != null)
     {
         if(row["BusinessID"]!=null)
         {
             model.BusinessID=row["BusinessID"].ToString();
         }
         if(row["BusPhotoAlbumID"]!=null)
         {
             model.BusPhotoAlbumID=row["BusPhotoAlbumID"].ToString();
         }
         if(row["AlbumName"]!=null)
         {
             model.AlbumName=row["AlbumName"].ToString();
         }
         if(row["AlbumDesc"]!=null)
         {
             model.AlbumDesc=row["AlbumDesc"].ToString();
         }
         if(row["IsDefault"]!=null && row["IsDefault"].ToString()!="")
         {
             if((row["IsDefault"].ToString()=="1")||(row["IsDefault"].ToString().ToLower()=="true"))
             {
                 model.IsDefault=true;
             }
             else
             {
                 model.IsDefault=false;
             }
         }
     }
     return model;
 }
 protected virtual Maticsoft.Model.BusPhotoAlbum BuildBusPhotoAlbumTable(Maticsoft.Model.StoreInfo storeInfo, int albumType)
 {
     var busphotoAlbumTable = new Maticsoft.Model.BusPhotoAlbum();
     busphotoAlbumTable.BusinessID = storeInfo.storeId;
     busphotoAlbumTable.BusPhotoAlbumID = Guid.NewGuid().ToString();
     busphotoAlbumTable.IsDefault = true;
     busphotoAlbumTable.AlbumName = @"餐厅环境";
     if (albumType == 1)
     {
         busphotoAlbumTable.AlbumName = @"菜品图片";
     }
     //BusPhotoAlbumTableBll.Add(busphotoAlbumTable);
     return busphotoAlbumTable;
 }
        protected override List<StorePicture> PicturesBody(StoreInfo storeInfo, BusPhotoAlbum busphotoAlbumTable, string albumType, ref int pageNum)
        {
            var collectionPhone = new CollectionPhone();
            collectionPhone.PageUrl = GetPageUrl(storeInfo, albumType, pageNum);
            var sid = GetStoreSid(storeInfo.StorePictureHref);
            collectionPhone.dictionary.Add("s_id", sid);
            collectionPhone.dictionary.Add("id", sid);
            collectionPhone.dictionary.Add("page", pageNum.ToString());
            collectionPhone.dictionary.Add("keyword", string.Empty);

            try
            {
                //var location = collectionPhone.GetEpinLeResualt<List<PictureModel>>();
                //if (location == null || location.Count <= 0)
                //{
                //    pageNum = 500;
                return new List<StorePicture>();
                //}
                //return SavePicture(storeInfo, location, busphotoAlbumTable);
            }
            catch
            {
                pageNum = 500;
                return new List<StorePicture>();
            }
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Maticsoft.Model.BusPhotoAlbum GetModel(string BusPhotoAlbumID)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("select  top 1 BusinessID,BusPhotoAlbumID,AlbumName,AlbumDesc,IsDefault from BusPhotoAlbum ");
            strSql.Append(" where BusPhotoAlbumID=@BusPhotoAlbumID ");
            SqlParameter[] parameters = {
                    new SqlParameter("@BusPhotoAlbumID", SqlDbType.VarChar,50)			};
            parameters[0].Value = BusPhotoAlbumID;

            Maticsoft.Model.BusPhotoAlbum model=new Maticsoft.Model.BusPhotoAlbum();
            DataSet ds=ServerDbHelperSQL.Query(strSql.ToString(),parameters);
            if(ds.Tables[0].Rows.Count>0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }
 protected List<StorePicture> SavePicture(StoreInfo storeInfo, List<PictureModel> pictureNodeList, BusPhotoAlbum busphotoAlbumTable)
 {
     var storePicturesList = new List<StorePicture>();
     foreach (var pictureNode in pictureNodeList)
     {
         var picturePathName = string.Empty;
         if (!string.IsNullOrEmpty(pictureNode.image_url))
         {
             picturePathName = StorePictureUrl + pictureNode.image_url;
         }
         else if (!string.IsNullOrEmpty(pictureNode.default_image))
         {
             picturePathName = StorePictureUrl + pictureNode.default_image;
         }
         if (FilterPicturePathName(picturePathName))
         {
             SaveIngPic(busphotoAlbumTable.AlbumName, picturePathName);
             storePicturesList.Add(BuildStorePicture(storeInfo, picturePathName));
         }
     }
     return storePicturesList;
 }