예제 #1
0
        public int SaveWeChatCustomer(Customer customer)
        {
            var currentCustomer = GetByOpenId(customer.WechatId);

            if (currentCustomer == null) Insert(customer);
            else Update(currentCustomer);

            return 1;
        }
예제 #2
0
 public int Insert(Customer customer)
 {
     return Ctx.Insert<Customer>("Customer", customer).AutoMap(x => x.CustomerId).ExecuteReturnLastId<int>();
 }
예제 #3
0
 public int Update(Customer customer)
 {
     return Ctx.Update("Customer", customer).AutoMap(x => x.CustomerId).Where(x => x.CustomerId).Execute();
 }
예제 #4
0
 public IHttpActionResult SaveFromWeChat(Customer customer)
 {
     return Ok();
 }