Example #1
0
        public void Add()
        {
            TunnelInfo model = new TunnelInfo()
            {
                Id                  = Guid.NewGuid(),
                TunnelCode          = "111",
                EntranceStation     = "111",
                TunnelLength        = "212",
                TunnelHeight        = "12",
                HoleType            = "212",
                HighwayGrade        = "121",
                RodeType            = "666",
                TunnelVentilation   = "666",
                CompletionTime      = DateTime.Now,
                ConstructionCompany = "66",
                DesignSpeed         = "66",
                TunnelName          = "66",
                TunnelType          = 3,
                TunnelWidth         = "66",
                AddTime             = DateTime.Now
            };
            var result = tunnelInfoService.Add(model);

            Assert.True(result);
        }
Example #2
0
        public ResultModel <string> Add(TunnelInfo model)
        {
            model.AddTime = DateTime.Now;
            model.IsDel   = false;
            var result = new ResultModel <string>();

            result.Success = tunnelInfoService.Add(model);
            if (result.Success)
            {
                result.Msg = "添加成功";
            }
            else
            {
                result.Msg = "添加失败";
            }
            return(result);
        }