示例#1
0
        public CommonRtnEntity Add([FromBody] FollowUpRecordInfo info)
        {
            IFollowUpRecordInfoServices services = new FollowUpRecordInfoServices();

            int result = 0;

            //编辑
            if (info.ID > 0)
            {
                info.UpdateTime = DateTime.Now;
                services.Update(info);
                result = info.ID;
            }
            else
            {
                result = services.Add(info);
            }

            CommonRtnEntity rtnInfo = new CommonRtnEntity()
            {
                Success = result > 0,
                Data    = result,
                Message = result > 0 ? "添加成功!" : "添加失败!"
            };

            return(rtnInfo);
        }
示例#2
0
        public CommonRtnEntity Delete([FromBody] object[] ids)
        {
            IFollowUpRecordInfoServices services = new FollowUpRecordInfoServices();
            bool            result  = services.DeleteByIds(ids);
            CommonRtnEntity rtnInfo = new CommonRtnEntity()
            {
                Success = result,
                Data    = result,
                Message = result ? "删除成功!" : "删除失败"
            };

            return(rtnInfo);
        }
示例#3
0
        public CommonRtnEntity GetFollowUpRecordInfo([FromBody]  SearchBase <string> searchInfo)
        {
            IFollowUpRecordInfoServices services = new FollowUpRecordInfoServices();

            FollowUpRecordInfo orderInfo = services.QueryByID(searchInfo.Data);

            CommonRtnEntity rtnInfo = new CommonRtnEntity()
            {
                Success = orderInfo != null,
                Data    = new
                {
                    Info = orderInfo
                },
                Message = orderInfo != null ? "查询成功!" : "查询失败!"
            };

            return(rtnInfo);
        }
示例#4
0
        public CommonRtnEntity GetListByCustomersSuppliersID([FromBody] SearchBase <int> searchInfo)
        {
            IFollowUpRecordInfoServices services = new FollowUpRecordInfoServices();

            int totalCount = 0;

            List <FollowUpRecordInfo> list = services.QueryPage(x =>
                                                                x.CustomersSuppliersID == searchInfo.Data
                                                                , ref totalCount, searchInfo.PageIndex, searchInfo.PageSize, " CreateTime desc ");

            CommonRtnEntity rtnInfo = new CommonRtnEntity()
            {
                Success = list.Count > 0,
                Data    = new
                {
                    TotalCount = totalCount,
                    Data       = list
                },
                Message = "查询成功!"
            };

            return(rtnInfo);
        }