|
@@ -150,11 +150,8 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
bool check = spdb.TradeRecord.Any(m => m.TradeSnNo == pos.PosSn);
|
|
bool check = spdb.TradeRecord.Any(m => m.TradeSnNo == pos.PosSn);
|
|
|
if (check)
|
|
if (check)
|
|
|
{
|
|
{
|
|
|
- string SpTradeRecordId = function.ReadInstance("/PublicParams/SpTradeRecordId.txt");
|
|
|
|
|
- if(string.IsNullOrEmpty(SpTradeRecordId))
|
|
|
|
|
- {
|
|
|
|
|
- SpTradeRecordId = "2780299";
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ string BindingTime = pos.BindingTime == null ? DateTime.Now.AddMonths(-1).ToString("yyyyMM") : pos.BindingTime.Value.ToString("yyyyMM");
|
|
|
|
|
+ string SpTradeRecordId = function.ReadInstance("/PublicParams/SpTradeRecordId" + BindingTime + ".txt");
|
|
|
int StartId = int.Parse(function.CheckInt(SpTradeRecordId));
|
|
int StartId = int.Parse(function.CheckInt(SpTradeRecordId));
|
|
|
if (pos.BrandId == 1)
|
|
if (pos.BrandId == 1)
|
|
|
{
|
|
{
|
|
@@ -231,7 +228,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
if (pos.BindingTime != null && pos.ActivationTime != null)
|
|
if (pos.BindingTime != null && pos.ActivationTime != null)
|
|
|
{
|
|
{
|
|
|
TimeSpan ts = pos.ActivationTime.Value - pos.BindingTime.Value;
|
|
TimeSpan ts = pos.ActivationTime.Value - pos.BindingTime.Value;
|
|
|
- if (ts.TotalDays > 30)
|
|
|
|
|
|
|
+ if (ts.TotalDays > 30 && SysUserName != "admin")
|
|
|
{
|
|
{
|
|
|
return "机具划拨后已超过30天";
|
|
return "机具划拨后已超过30天";
|
|
|
}
|
|
}
|
|
@@ -275,7 +272,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
}
|
|
|
pos.UserId = user.Id;
|
|
pos.UserId = user.Id;
|
|
|
pos.BuyUserId = user.Id;
|
|
pos.BuyUserId = user.Id;
|
|
|
- if (pos.CreditTrade >= CheckMoney && pos.ActivationState == 0 && pos.BindingTime > DateTime.Now.AddDays(-30))
|
|
|
|
|
|
|
+ if (pos.CreditTrade >= CheckMoney && pos.ActivationState == 0 && (pos.BindingTime > DateTime.Now.AddDays(-30) || SysUserName == "admin"))
|
|
|
{
|
|
{
|
|
|
// pos.IsPurchase = 0;
|
|
// pos.IsPurchase = 0;
|
|
|
pos.ActivationState = 1;
|
|
pos.ActivationState = 1;
|
|
@@ -406,11 +403,8 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
bool check = spdb.TradeRecord.Any(m => m.TradeSnNo == pos.PosSn);
|
|
bool check = spdb.TradeRecord.Any(m => m.TradeSnNo == pos.PosSn);
|
|
|
if (check)
|
|
if (check)
|
|
|
{
|
|
{
|
|
|
- string SpTradeRecordId = function.ReadInstance("/PublicParams/SpTradeRecordId.txt");
|
|
|
|
|
- if(string.IsNullOrEmpty(SpTradeRecordId))
|
|
|
|
|
- {
|
|
|
|
|
- SpTradeRecordId = "2780299";
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ string BindingTime = pos.BindingTime == null ? DateTime.Now.AddMonths(-1).ToString("yyyyMM") : pos.BindingTime.Value.ToString("yyyyMM");
|
|
|
|
|
+ string SpTradeRecordId = function.ReadInstance("/PublicParams/SpTradeRecordId" + BindingTime + ".txt");
|
|
|
int StartId = int.Parse(function.CheckInt(SpTradeRecordId));
|
|
int StartId = int.Parse(function.CheckInt(SpTradeRecordId));
|
|
|
if (pos.BrandId == 1)
|
|
if (pos.BrandId == 1)
|
|
|
{
|
|
{
|