protected override StoreInfo ChangeStoreInfo(Catalogue catalogue, StoreInfo storeInfo)
 {
     storeInfo.StoreName = catalogue.title;
     storeInfo.MaxPrice = catalogue.StoreInfo.MaxPrice;
     storeInfo.StorePictureHref = catalogue.StorePictureHref;
     return storeInfo;
 }
 protected override StoreInfo ChangeStoreInfo(Catalogue catalogue, StoreInfo storeInfo)
 {
     storeInfo.StoreName = catalogue.title;
     storeInfo.picName = catalogue.picName.Trim();
     storeInfo.StoreAddress = catalogue.StoreInfo.StoreAddress;
     storeInfo.MaxPrice = catalogue.StoreInfo.MaxPrice;
     storeInfo.MinPrice = catalogue.StoreInfo.MinPrice;
     storeInfo.StoreTag += catalogue.StoreInfo.StoreTag;
     return storeInfo;
 }
 protected override StoreInfo ChangeStoreInfo(Catalogue catalogue, StoreInfo storeInfo)
 {
     storeInfo.StoreName = catalogue.title;
     storeInfo.MaxPrice = catalogue.StoreInfo.MaxPrice;
     storeInfo.StoreTag += catalogue.StoreInfo.StoreTag;
     storeInfo.StorePictureHref = GetImageHref(StoreInfoHtmlNode, storeInfo.storeId);
     storeInfo.WIFI = storeInfo.Facilities.Contains(@"无线上网");
     storeInfo.payCar = storeInfo.Facilities.Contains(@"可以刷卡");
     storeInfo.DishTypeSite = GetDishTypeSite();
     return storeInfo;
 }
 protected override StoreInfo ChangeStoreInfo(Catalogue catalogue, StoreInfo storeInfo)
 {
     storeInfo.StoreName = catalogue.title;
     //storeInfo.picName = catalogue.picName.Trim();
     storeInfo.StoreAddress = catalogue.StoreInfo.StoreAddress;
     storeInfo.MaxPrice = catalogue.StoreInfo.MaxPrice;
     storeInfo.StoreTag += catalogue.StoreInfo.StoreTag;
     storeInfo.Facilities += catalogue.StoreInfo.Facilities;
     storeInfo.StorePhone = catalogue.StoreInfo.StorePhone;
     storeInfo.StorePictureHref = catalogue.StorePictureHref;
     return storeInfo;
 }
예제 #5
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr="";
            if(this.txtFId.Text.Trim().Length==0)
            {
                strErr+="FId不能为空!\\n";
            }
            if(this.txthref.Text.Trim().Length==0)
            {
                strErr+="href不能为空!\\n";
            }
            if(this.txttitle.Text.Trim().Length==0)
            {
                strErr+="title不能为空!\\n";
            }
            if(!PageValidate.IsNumber(txtLocalTagID.Text))
            {
                strErr+="LocalTagID格式错误!\\n";
            }

            if(strErr!="")
            {
                MessageBox.Show(this,strErr);
                return;
            }
            string FId=this.txtFId.Text;
            string href=this.txthref.Text;
            string title=this.txttitle.Text;
            int LocalTagID=int.Parse(this.txtLocalTagID.Text);

            Maticsoft.Model.Catalogue model=new Maticsoft.Model.Catalogue();
            model.FId=FId;
            model.href=href;
            model.title=title;
            model.LocalTagID=LocalTagID;

            Maticsoft.BLL.Catalogue bll=new Maticsoft.BLL.Catalogue();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","add.aspx");
        }
예제 #6
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Maticsoft.Model.Catalogue DataRowToModel(DataRow row)
 {
     Maticsoft.Model.Catalogue model=new Maticsoft.Model.Catalogue();
     if (row != null)
     {
         if(row["FId"]!=null)
         {
             model.FId=row["FId"].ToString();
         }
         if(row["href"]!=null)
         {
             model.href=row["href"].ToString();
         }
         if(row["title"]!=null)
         {
             model.title=row["title"].ToString();
         }
         if(row["LocalTagID"]!=null && row["LocalTagID"].ToString()!="")
         {
             model.LocalTagID=int.Parse(row["LocalTagID"].ToString());
         }
         if(row["StoreId"]!=null)
         {
             model.StoreId=row["StoreId"].ToString();
         }
         if(row["picName"]!=null)
         {
             model.picName=row["picName"].ToString();
         }
     }
     return model;
 }
예제 #7
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Maticsoft.Model.Catalogue GetModel(string FId)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("select  top 1 FId,href,title,LocalTagID,StoreId,picName from Catalogue ");
            strSql.Append(" where FId=@FId ");
            SqlParameter[] parameters = {
                    new SqlParameter("@FId", SqlDbType.VarChar,50)			};
            parameters[0].Value = FId;

            Maticsoft.Model.Catalogue model=new Maticsoft.Model.Catalogue();
            DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters);
            if(ds.Tables[0].Rows.Count>0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }
        protected override StoreInfo ChangeStoreInfo(Catalogue catalogue, StoreInfo storeInfo)
        {
            storeInfo.StoreName = catalogue.title;
            storeInfo.StorePictureHref = catalogue.StorePictureHref;
            storeInfo.payCar = storeInfo.Facilities.Contains(@"可以刷卡");
            storeInfo.ChildrenChair = storeInfo.Facilities.Contains(@"有宝宝椅");
            storeInfo.CarParks = storeInfo.Facilities.Contains(@"有停车位");
            storeInfo.WIFI = storeInfo.Facilities.Contains(@"无线上网");
            storeInfo.NoSmoke = storeInfo.Facilities.Contains(@"全场禁烟");

            return storeInfo;
        }
 public List<Catalogue> GetPageCatalogue(int poIndex)
 {
     var catalogueList = new List<Catalogue>();
     var collectionPhone = new CollectionPhone();
     collectionPhone.headDictionary.Add("city", "1");
     collectionPhone.PageUrl = PageUrl;
     collectionPhone.dictionary.Add("pageno", PageNum.ToString());
     collectionPhone.dictionary.Add("circleid", CircleId.ToString());
     collectionPhone.dictionary.Add("City", "1");
     collectionPhone.dictionary.Add("pagesize", "20");
     var location = collectionPhone.GetResualt<Location>();
     if (location == null)
     {
         return catalogueList;
     }
     PageNum = location.PageNo;
     PageCount = location.TotalPage;
     IflastPage = location.IflastPage;
     foreach (var restaurantinfo in location.RestaurantinfoList)
     {
         var catalogue = new Catalogue
         {
             FId = restaurantinfo.ID,
             title = restaurantinfo.CtName,
             href = string.Empty,
             LocalTagID = poIndex,
             StoreId = restaurantinfo.ID,
             StoreInfo =
                 new Maticsoft.Model.StoreInfo
                 {
                     storeId = restaurantinfo.ID,
                     Fid = restaurantinfo.ID,
                     StoreAddress = restaurantinfo.Ctaddress,
                     StoreName = restaurantinfo.CtName,
                     StorePhone = restaurantinfo.Phone,
                     StoreTag = restaurantinfo.CategoryName,
                     MaxPrice = restaurantinfo.Price,
                     DishesNum = restaurantinfo.DishesNum,
                     MinPrice = 0
                 }
         };
         catalogue.IsRead = CheckStoreIsRead(restaurantinfo.ID, ref restaurantinfo.ID);
         catalogueList.Add(catalogue);
     }
     return catalogueList;
 }