GetRestaurantEntity() public method

public GetRestaurantEntity ( int id ) : RestaurantEntity
id int
return Dian.Entity.RestaurantEntity
        private void FillFormData()
        {
            if (CurId == 0)
            {
                AlertAndTransfer("参数id无效!", base.UrlReferrer);
                return;
            }

            IRestaurant biz = new RestaurantBiz();
            var entity = biz.GetRestaurantEntity(CurId);
            if (entity == null)
            {
                AlertAndTransfer("参数id无效,获取数据失败!", base.UrlReferrer);
                return;
            }

            this.tRestaurantName.Value = entity.RESTAURANT_NAME;
            this.tAddress.Value = entity.ADDRESS;
            this.tDescription.Value = entity.DESCREPTION;
            this.hLevel.Value = entity.LEVEL;
            this.hArea.Value = entity.AREA;
            this.hPackingCount.Value = entity.PARKING_COUNT.ToString();
            if (!string.IsNullOrEmpty(entity.RESTAURANT_MAP))
                this.imgMap.Src = entity.RESTAURANT_MAP;
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            RestaurantId = base.ParseInt(Request.QueryString["rId"]);
            TableId = base.ParseInt(Request.QueryString["tId"]);
            this.hOrderId.Value = "";

            if (RestaurantId == 0 || TableId == 0)
            {
                Server.Transfer("Error404.aspx");
            }
            else
            {
                IRestaurant restaurantBiz = new RestaurantBiz();
                if (restaurantBiz.GetRestaurantEntity(RestaurantId) == null)
                    Server.Transfer("Error404.aspx");
            }

            if (!IsPostBack)
            {
                BindData();
            }
        }