Esempio n. 1
0
        /// <summary>
        /// 添加线路下的点位
        /// </summary>
        /// <param name="planLineDetail">ImportPointType默认null;X/Y/PlanLineId必须填写;ImportPointType!=null时要填写ImportPointName</param>
        /// <returns></returns>
        public MessageEntity Post([FromBody] PlanLineDetail planLineDetail)
        {
            if (string.IsNullOrEmpty(planLineDetail.X) || string.IsNullOrEmpty(planLineDetail.Y) || planLineDetail.PlanLineId == null)
            {
                return(MessageEntityTool.GetMessage(ErrorType.FieldError));
            }

            if (planLineDetail.ImportPointType == null)
            {
                planLineDetail.ImportPointType = 0;
                planLineDetail.ImportPointName = "自动点位";
            }
            else
            {
                if (string.IsNullOrEmpty(planLineDetail.ImportPointName))
                {
                    return(MessageEntityTool.GetMessage(ErrorType.FieldError));
                }
                planLineDetail.ImportPointType = 1;
            }
            planLineDetail.AddTime = DateTime.Now;
            planLineDetail.State   = 1;

            var messageEntity = _planLineDetailDAL.Add(planLineDetail);

            return(messageEntity);
        }
Esempio n. 2
0
        /// <summary>
        /// 删除点位
        /// </summary>
        /// <param name="planLineId">点位id</param>
        /// <returns></returns>
        public MessageEntity Delete(int planLineId)
        {
            PlanLineDetail planType = new PlanLineDetail
            {
                PlanLineDetaiId = planLineId
            };
            var messageEntity = _planLineDetailDAL.Delete(planType);

            return(messageEntity);
        }
Esempio n. 3
0
        /// <summary>
        /// 修改线路下的点位
        /// </summary>
        /// <param name="planLineDetailId">线路下的点位Id</param>
        /// <param name="planLineDetail">ImportPointType默认1;X/Y/ImportPointName必须填写</param>
        /// <returns></returns>
        public MessageEntity Put(int planLineDetailId, [FromBody] PlanLineDetail planLineDetail)
        {
            if (string.IsNullOrEmpty(planLineDetail.X) || string.IsNullOrEmpty(planLineDetail.Y) || string.IsNullOrEmpty(planLineDetail.ImportPointName))
            {
                return(MessageEntityTool.GetMessage(ErrorType.FieldError));
            }
            planLineDetail.ImportPointType = 1;
            planLineDetail.PlanLineDetaiId = planLineDetailId;
            var messageEntity = _planLineDetailDAL.Update(planLineDetail);

            return(messageEntity);
        }
Esempio n. 4
0
 public MessageEntity Update(PlanLineDetail value)
 {
     base.UpdateEntity(value, Database.ConnectionFactory.DBConnNames.PipeInspectionBase_Gis_OutSide, out MessageEntity entity);
     return(entity);
 }