示例#1
0
        public void TestAdd()
        {
            var customerService = Cicada.CicadaFacade.Container.Resolve<ICustomerService>();
            var customer = new CustomerPostParam { Name = "张三1", Phone = "18610170816" };
            var ret = customerService.Add(customer);

            Assert.IsNotNull(ret);
        }
示例#2
0
        public Cicada.Core.Ret <int> Add(Bll.Dtos.CustomerPostParam item)
        {
            if (item == null || string.IsNullOrWhiteSpace(item.Name))
            {
                return new Cicada.Core.Ret <int> {
                           Status = 1, Message = "用户名无效"
                }
            }
            ;
            if (string.IsNullOrWhiteSpace(item.Phone))
            {
                return new Cicada.Core.Ret <int> {
                           Status = 2, Message = "手机号无效"
                }
            }
            ;

            return(new Cicada.Core.Ret <int>());
        }
    }
}
示例#3
0
 public Ret<int> Post(CustomerPostParam  item)
 {
     return _customerService.Add(item);
 }