Ejemplo n.º 1
0
        /// <summary>
        /// 新增地图配置 2016.12.01 张丰刚
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int AddEntity(BaseMapConfigModel entity)
        {
            int id = 0;

            try
            {
                id = (int)mapContext.Insert("InsertMapConfig", entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(id);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 根据ID获取地图配置 2016.12.01 张丰刚
        /// </summary>
        /// <param name="id">主键ID</param>
        /// <returns></returns>
        public BaseMapConfigModel GetEntity(int id)
        {
            BaseMapConfigModel model = new BaseMapConfigModel();

            try
            {
                model = mapContext.QueryForList <BaseMapConfigModel>("GetMapConfigById", id).FirstOrDefault();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(model);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 修改地图配置 2016.12.01 张丰刚
        /// </summary>
        /// <param name="id">主键ID</param>
        /// <param name="newentity">model</param>
        /// <returns></returns>
        public bool UpdateEntity(int id, BaseMapConfigModel newentity)
        {
            bool result = false;

            try
            {
                int num = mapContext.Update("UpdateMapConfig", newentity);
                if (num != 0)
                {
                    result = true;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(result);
        }