상속: System.MarshalByRefObject, IRestaurant
예제 #1
0
        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;
        }
예제 #2
0
 public EmployeeEntity GetEmployeeEntity(string id)
 {
     var entity = EntityExecution.SelectOne<EmployeeEntity>(n => n.EMPLOYEE_ID == id);
     var restaurantEntity = new RestaurantBiz().GetRestaurantEntity(entity.RESTAURANT_ID);
     if (restaurantEntity != null)
         entity.RESTAURANT_NAME = restaurantEntity.RESTAURANT_NAME;
     return entity;
 }
예제 #3
0
 private void BindControlData()
 {
     IRestaurant biz = new RestaurantBiz();
     this.ddlRestaurant.DataSource = biz.GetRestaurantDataTable();
     this.ddlRestaurant.DataValueField = "RESTAURANT_ID";
     this.ddlRestaurant.DataTextField = "RESTAURANT_NAME";
     this.ddlRestaurant.DataBind();
 }
예제 #4
0
 private void BindControlData()
 {
     IRestaurant restaurantBiz = new RestaurantBiz();
     this.ddlRestaurant.DataSource = (bool)base.CurEmployeeEntity.IS_ADMIN ?
         restaurantBiz.GetRestaurantDataTable() :
         restaurantBiz.GetRestaurantDataTable(base.CurEmployeeEntity.EMPLOYEE_ID);
     this.ddlRestaurant.DataValueField = "RESTAURANT_ID";
     this.ddlRestaurant.DataTextField = "RESTAURANT_NAME";
     this.ddlRestaurant.DataBind();
 }
예제 #5
0
        public EmployeeEntity GetEmployeeEntity(string id)
        {
            var entity           = EntityExecution.SelectOne <EmployeeEntity>(n => n.EMPLOYEE_ID == id);
            var restaurantEntity = new RestaurantBiz().GetRestaurantEntity(entity.RESTAURANT_ID);

            if (restaurantEntity != null)
            {
                entity.RESTAURANT_NAME = restaurantEntity.RESTAURANT_NAME;
            }
            return(entity);
        }
예제 #6
0
 private void DeleteData()
 {
     try
     {
         var id = base.ParseInt(this.hDeleteId.Value);
         if (id != 0)
         {
             IRestaurant biz = new RestaurantBiz();
             biz.DeleteRestaurantEntity(new RestaurantEntity() { RESTAURANT_ID = id });
             this.lMsg.InnerText = "删除成功!";
         }
     }
     catch (Exception ex)
     {
         this.lMsg.InnerText = "删除失败,原因:" + ex.ToString();
     }
 }
예제 #7
0
        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();
            }
        }
예제 #8
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();
            }
        }
예제 #9
0
 private void BindControlData()
 {
     if (base.CurEmployeeEntity.IS_ADMIN == true)
     {
         IRestaurant restaurantBiz = new RestaurantBiz();
         this.ddlRestaurant.DataSource = restaurantBiz.GetRestaurantDataTable();
         this.ddlRestaurant.DataValueField = "RESTAURANT_ID";
         this.ddlRestaurant.DataTextField = "RESTAURANT_NAME";
         this.ddlRestaurant.DataBind();
         this.ddlRestaurant.Items.Insert(0, new ListItem() { Text = "全部", Value = "0" });
     }
     else
     {
         this.ddlRestaurant.Visible = false;
     }
 }
예제 #10
0
 private void BindData()
 {
     IRestaurant biz = new RestaurantBiz();
     repeater1.DataSource = GetPagedDataSource(biz.GetRestaurantDataTable().DefaultView);
     repeater1.DataBind();
 }