/// <summary> /// 新增区域 /// </summary> /// <param name="value">PlanAreaName:片区名称/GeoText:片区坐标/DeptId:部门Id/PersonId:人员PointId/AreaState:状态(不用传也行)</param> /// <returns></returns> public MessageEntity Post([FromBody] L_PlanArea value) { value.OperateAddTime = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); value.AreaState = 1; var messageEntity = _planAreaDAL.AddPlanArea(value); return(messageEntity); }
/// <summary> /// 根据PlanAreaId删除区域 /// </summary> /// <param name="PointId">PlanAreaId</param> /// <returns></returns> public MessageEntity Delete(int PointId) { L_PlanArea value = new L_PlanArea(); value.PlanAreaId = PointId; var messageEntity = _planAreaDAL.DeletePlanArea(value); return(messageEntity); }
/// <summary> /// 根据PlanAreaId需要改区域 /// </summary> /// <param name="PointId">PlanAreaId</param> /// <param name="value">PlanAreaName:片区名称/GeoText:片区坐标/DeptId:部门Id/PersonId:人员PointId/AreaState:状态(不用传也行)</param> /// <returns></returns> public MessageEntity Put(int PointId, [FromBody] L_PlanArea value) { if (string.IsNullOrEmpty(value.PlanAreaName)) { return(MessageEntityTool.GetMessage(ErrorType.FieldError)); } value.PlanAreaId = PointId; var messageEntity = _planAreaDAL.UpdatePlanArea(value); return(messageEntity); }
public MessageEntity UpdatePlanArea(L_PlanArea planArea) { using (var conn = ConnectionFactory.GetDBConn(ConnectionFactory.DBConnNames.PipeInspectionBase_Gis_OutSide)) { var rows = 0; var excSql = DapperExtentions.MakeUpdateSql(planArea); if (string.IsNullOrEmpty(excSql)) { return(MessageEntityTool.GetMessage(ErrorType.SqlError, "请检查实体类")); } try { rows = conn.Execute(excSql, planArea); return(MessageEntityTool.GetMessage(rows)); } catch (Exception e) { return(MessageEntityTool.GetMessage(ErrorType.SqlError, e.Message)); } } }