Exemple #1
0
 public List<RestaurantEntity> GetRestaurantEntityList(RestaurantEntity condition_entity)
 {
     GenericWhereEntity<RestaurantEntity> where_entity = new GenericWhereEntity<RestaurantEntity>();
     if (condition_entity.RESTAURANT_ID != null)
         where_entity.Where(n => (n.RESTAURANT_ID == condition_entity.RESTAURANT_ID));
     if (condition_entity.RESTAURANT_NAME != null)
         where_entity.Where(n => (n.RESTAURANT_NAME == condition_entity.RESTAURANT_NAME));
     return EntityExecution.SelectAll(where_entity);
 }
        private void Save()
        {
            try
            {
                IRestaurant biz = new RestaurantBiz();

                var entity = new RestaurantEntity();
                entity.RESTAURANT_NAME = this.tRestaurantName.Value;
                entity.ADDRESS = this.tAddress.Value;
                entity.DESCREPTION = this.tDescription.Value;
                entity.LEVEL = this.hLevel.Value;
                entity.AREA = this.hArea.Value;
                entity.PARKING_COUNT = base.ParseInt(this.hPackingCount.Value);

                string imgUrl = null;
                if (!SetRestaurantMap(this.fileMap, this.imgMap, this.hDeleteImg.Value, ConfigHelper.GetConfigString("RESTAURANT_MAP_PATH"), ref imgUrl))
                    return;
                entity.RESTAURANT_MAP = imgUrl;

                if (CurOperation == "add")
                {
                    entity.CREATE_TIME = DateTime.Now;
                    entity.CREATE_PERSON = base.CurEmployeeEntity.EMPLOYEE_ID;
                    biz.InsertRestaurantEntity(entity);
                }
                else if (CurOperation == "edit")
                {
                    entity.RESTAURANT_ID = CurId;
                    entity.UPDATE_TIME = DateTime.Now;
                    entity.UPDATE_PERSON = base.CurEmployeeEntity.EMPLOYEE_ID;
                    biz.UpdateRestaurantEntity(entity);
                }

                AlertAndTransfer("保存成功!", base.UrlReferrer);
            }
            catch (Exception ex)
            {
                this.lMsg.InnerText = "保存失败,原因:" + ex.ToString();
            }
        }
Exemple #3
0
 public void UpdateRestaurantEntity(RestaurantEntity condition_entity)
 {
     condition_entity.Update();
 }
Exemple #4
0
 public void InsertRestaurantEntity(RestaurantEntity condition_entity)
 {
     condition_entity.Insert();
 }
Exemple #5
0
 public void DeleteRestaurantEntity(RestaurantEntity condition_entity)
 {
     condition_entity.Delete();
 }