/// <summary> /// 添加 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool AddRefundsMoney(RefundsMoneyInfo_Add model) { if (model == null) { return(false); } const string SQL = @"INSERT INTO RefundsMoney(ID,OrderNumber,ThirdPartyOrderNumber,ThirdPartyAccountName,SalePlatformId,SaleFilialeId,RefundsAmount, Status,CreateTime,CreateUser,IsDelete,ModifyTime,ModifyUser,AfterSalesNumber) VALUES(@ID,@OrderNumber,@ThirdPartyOrderNumber,@ThirdPartyAccountName,@SalePlatformId,@SaleFilialeId,@RefundsAmount, @Status,@CreateTime,@CreateUser,@IsDelete,@ModifyTime,@ModifyUser,@AfterSalesNumber)"; using (SqlConnection conn = Databases.GetSqlConnection(GlobalConfig.ERP_DB_NAME, false)) { int result = conn.Execute(SQL, new { ID = model.ID, OrderNumber = model.OrderNumber, ThirdPartyOrderNumber = model.ThirdPartyOrderNumber, ThirdPartyAccountName = model.ThirdPartyAccountName, SalePlatformId = model.SalePlatformId, SaleFilialeId = model.SaleFilialeId, RefundsAmount = model.RefundsAmount, Status = (int)RefundsMoneyStatusEnum.PendingCheck, CreateTime = DateTime.Now, CreateUser = model.CreateUser, IsDelete = false, ModifyTime = DateTime.Now, ModifyUser = model.CreateUser, AfterSalesNumber = model.AfterSalesNumber, }); return(result > 0); } }
public void TestMethod_Add() { Init(); var model = new RefundsMoneyInfo_Add() { ID = Guid.NewGuid(), AfterSalesNumber = "退换货号123", CreateUser = "******", OrderNumber = "订单号111", RefundsAmount = 2, SaleFilialeId = Guid.Parse("43609645-97dd-4ae4-989d-f3c867969a99"), SalePlatformId = Guid.Parse("443a404a-91a2-409e-9b47-10af5489c360"), ThirdPartyAccountName = "第三方账户222", ThirdPartyOrderNumber = "ddd", }; var result = _refundsMoneyDal.AddRefundsMoney(model); Assert.IsNotNull(result); }