41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using System.Data;
|
|
using YLErp.BLL;
|
|
using YLErp.Modules;
|
|
using YLErp.Modules.TradeModule.DealModule;
|
|
|
|
namespace YLErp.Forms
|
|
{
|
|
public partial class FormTradeDeal : Form
|
|
{
|
|
public FormTradeDeal()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void btnConfirm_Click(object sender, EventArgs e)
|
|
{
|
|
var tradeNumber = textBox1.Text?.Trim();
|
|
if (string.IsNullOrEmpty(tradeNumber))
|
|
{
|
|
MessageBox.Show("缺少交易编号");
|
|
return;
|
|
}
|
|
|
|
var db = DbContextFactory.GetYLDbContext();
|
|
var ids = db.trade.Where(n => n.TradeNumber == tradeNumber).Select(n => n.id).ToArray();
|
|
if (!ids.Any())
|
|
{
|
|
MessageBox.Show("找不到交易数据");
|
|
return;
|
|
}
|
|
var config = valuedateBLL.SystemDate;
|
|
var ignoreMoneyCheck = true;
|
|
var isSkipApproval = true;
|
|
|
|
var result = new TradeConfirmService(OptUserInfo.SystemUser).tradeConfirm(ids, ignoreMoneyCheck, isSkipApproval);
|
|
|
|
MessageBox.Show(result.ToJson());
|
|
}
|
|
}
|
|
}
|