public Get_OutGiveBackLendingInfo Recieve(string data) { Get_OutGiveBackLendingInfo json = new Get_OutGiveBackLendingInfo(); try { Get_InGiveBackLendingInfo input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InGiveBackLendingInfo>(data); foreach (LendingInfoDetail l in input.lendingDetailList) { if (!db.CheckReturnAble(input.TrainmanGUID, l)) { json.resultStr = "提交失败:未找到" + l.strLendingTypeAlias + " " + l.strLendingExInfo + "的借用记录!"; throw new ArgumentOutOfRangeException("未找到" + l.strLendingTypeAlias + " " + l.strLendingExInfo + "的借用记录!"); } } db.GiveBackDetail(input.lendingDetailList); foreach (LendingInfoDetail l in input.lendingDetailList) { db.UpdateLendingInfoRemark(l.strLendingInfoGUID, input.remark); } json.result = "0"; json.resultStr = "返回成功"; } catch (Exception ex) { json.result = "1"; //json.resultStr = "提交失败:" ; } return(json); }
public void UpdateLendingInfoRemarkTest() { // string ConnectionString = string.Empty; // TODO: 初始化为适当的值 DBLendingInfoDetail target = new DBLendingInfoDetail(connstr); // TODO: 初始化为适当的值 string strGUID = string.Empty; // TODO: 初始化为适当的值 string remark = string.Empty; // TODO: 初始化为适当的值 strGUID = "02517596-577B-4A0C-9E7F-A8C1AA35888E"; // Guid.NewGuid().ToString(); remark = "mytest"; target.UpdateLendingInfoRemark(strGUID, remark); Assert.IsNotNull(strGUID); // Assert.Inconclusive("无法验证不返回值的方法。"); }