You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

19 lines
759 B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Forks.EnterpriseServices.BusinessInterfaces;
using TSingSoft.WebPluginFramework.Install;
namespace BWP.B3_YunKen.DataPatchs
{
[DataPatch]
public class UpdateCustomerStartedTime : IDataPatch
{
public void Execute(TransactionContext context)
{
var sql = @"update a set a.StartedTime = (case when (select Max(LoadTime) from B3Sale_CustomerAccept b where b.CustomerDealer_ID = a.ID and BillState = 20) is null then a.CreateTime else (select Max(LoadTime) from B3Sale_CustomerAccept b where b.CustomerDealer_ID = a.ID and BillState = 20) end) from B3Sale_Customer a where IsDealers = 1";
context.Session.ExecuteSqlNonQuery(sql);
}
}
}