$.parseJSON(data)只支持标准的JSON

$.parseJSON()只支持标准的JSON,不标准的还是用eval("("+data+")")吧

什么 是标准的呢?

key和value都带引号的就是标准的;   而且必须是双引号,单引号也不行

string msg = "";
Model.Users currentUser;
string jsonStr = "";
//JavaScriptSerializer js = new JavaScriptSerializer();
bool result = bll.UserLogin(loginID, loginPwd, out msg, out currentUser);
if (!result) {
 jsonStr = "{\"result\":\"false\",\"msg\":\"" + msg + "\"}";
 context.Response.Write(jsonStr);
} else {
 //记录登陆成功的用户到Session中
 context.Session.Add("currUser", currentUser);

 if (string.IsNullOrEmpty(redirectUrl)) {
  jsonStr = "{\"result\":\"true\",\"msg\":\"OK\",\"redirect\":\"\"}";
  context.Response.Write(jsonStr);
 } else {
  jsonStr = "{\"result\":\"true\",\"msg\":\"OK\",\"redirect':\"" + context.Server.UrlDecode(redirectUrl) + "\"}";
  context.Response.Write(jsonStr);
 }
}

检验voucher异常

#检查voucher transfer之前voucher有无异常
SELECT *
FROM voucher a
LEFT JOIN voucher_action b ON(a.voucher_id = b.voucher_id)
LEFT JOIN voucher_campaign_issue c ON(a.voucher_id = c.voucher_id)
LEFT JOIN voucher_submission_error d ON(a.voucher_id = d.voucher_id)
WHERE a.status_id < 5
AND (
     a.issue_time IS NOT NULL
     OR a.expiry_time IS NOT NULL
     OR a.submission_id IS NOT NULL
     OR a.transfer_time IS NOT NULL
     OR a.transfer_channel IS NOT NULL
     OR b.id is not null
     OR c.id is not null
     OR d.error_id is not null
)

#检查voucher transfer之后voucher有无异常
SELECT *
FROM voucher a
LEFT JOIN voucher_action b ON(a.voucher_id = b.voucher_id)
LEFT JOIN voucher_campaign_issue c ON(a.voucher_id = c.voucher_id)
LEFT JOIN voucher_submission_error d ON(a.voucher_id = d.voucher_id)
WHERE a.status_id = 5
AND (
     a.issue_time IS NOT NULL
     OR a.expiry_time IS NOT NULL
     OR a.submission_id IS NOT NULL
     OR a.transfer_time IS NULL
     #OR a.transfer_channel IS NULL
     OR b.id is not null
     OR c.id is not null
     OR d.error_id is not null
)

#检查voucher issue之前是否有异常
SELECT a.voucher_id, CONCAT(a.prefix, a.voucher_no) AS voucher, b.id, c.campaign_id, d.error_id
FROM voucher a
LEFT JOIN voucher_action b ON (a.voucher_id = b.voucher_id)
LEFT JOIN voucher_campaign_issue c ON(a.voucher_id = c.voucher_id)
LEFT JOIN voucher_submission_error d ON(a.voucher_id = d.voucher_id)
WHERE a.status_id < 6 AND (b.id IS NOT NULL OR c.id IS NOT NULL OR d.error_id IS NOT NULL)

#检查voucher issue之后是否有异常
SELECT a.voucher_id, CONCAT(a.prefix, a.voucher_no) AS voucher, b.id, c.campaign_id, d.error_id
FROM voucher a
LEFT JOIN voucher_action b ON (a.voucher_id = b.voucher_id AND b.action_id = 6)
LEFT JOIN voucher_campaign_issue c ON(a.voucher_id = c.voucher_id)
LEFT JOIN voucher_submission_error d ON(a.voucher_id = d.voucher_id)
WHERE a.status_id = 6 AND (b.id IS NULL OR a.transfer_time IS NULL OR a.issue_time IS NULL OR a.expiry_time IS NULL OR a.transfer_channel IS NULL)


#检查tenant submit之后时候有异常
SELECT a.voucher_id, CONCAT(a.prefix, a.voucher_no) AS voucher, b.id, c.campaign_id, e.submission_id
FROM voucher a
LEFT JOIN voucher_action b ON (a.voucher_id = b.voucher_id and b.action_id = 8)
LEFT JOIN voucher_campaign_issue c ON(a.voucher_id = c.voucher_id)
LEFT JOIN voucher_store_submission e ON(a.submission_id = e.submission_id)
WHERE a.status_id = 7 AND (b.id IS NULL OR c.id IS NULL OR e.submission_id is NULL)


#检查reimburse之后voucher是否有异常
SELECT *
FROM voucher
WHERE status_id = 9
AND (
     transfer_time IS NULL
     OR issue_time IS null
     OR submission_time IS NULL
     OR expiry_time IS NULL
     OR transfer_channel IS NULL
     OR submission_id IS NULL
     OR reimburse_time IS NULL
     )
    

Evo Transfer涉及到的table

Evo Transfer涉及到的table

 

Voucher

Voucher_action

Voucher_batch_action

Voucher_campaign_issue

Voucher_info_transfer

 

Transfer to corporate sales

Voucher ——– Transfer_time(add),  Issue_time(add), expiry_time(add), status_id(2-6), transfer_channel(null-6)

Voucher_action ——– insert issue action

Voucher_batch_action ——– insert transfer record, insert issue record

Voucher_info_transfer  ——– insert info transfer record

 

Transfer to Event

Voucher ——– Transfer_time(add),  Issue_time(add), expiry_time(add), status_id(2-6), transfer_channel(null-7)

Voucher_action ——–insert issue action

Voucher_batch_action ——– insert transfer record, insert issue record

Voucher_info_transfer  ——– insert info transfer record

 

Transfer for Other Purpose

Voucher ——– Transfer_time(add),  Issue_time(add), expiry_time(add), status_id(2-6), transfer_channel(null-50)

Voucher_action ——–insert issue action

Voucher_batch_action ——– insert transfer record, insert issue record

Voucher_info_transfer  ——– insert info transfer record

 

Transfer to Customer Service

Voucher ——– Transfer_time(add),  Issue_time(null), expiry_time(null), status_id(2-5), transfer_channel(null)

Voucher_action ——–no insert issue action

Voucher_batch_action ——–insert transfer record, no insert issue record

Voucher_info_transfer  ——–insert info transfer record