| | |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Microsoft.AspNetCore.Http; |
| | | using WIDESEA_WCS.IRepositories; |
| | | using Microsoft.AspNetCore.Mvc.RazorPages; |
| | | |
| | | namespace WIDESEA_WCS.Services |
| | | { |
| | |
| | | //å¤ç§æ·ä¼ç¨å°è¿init代ç ï¼å
¶ä»æ
åµå¯ä»¥ä¸ç¨ |
| | | //base.Init(dbRepository); |
| | | } |
| | | } |
| | | public override WebResponseContent Add(SaveModel saveDataModel) |
| | | { |
| | | WebResponseContent responseContent = new WebResponseContent(); |
| | | var a = saveDataModel.MainData["a"].ToFloat(); |
| | | var b = saveDataModel.MainData["b"].ToFloat(); |
| | | var c = saveDataModel.MainData["c"].ToFloat(); |
| | | var d = saveDataModel.MainData["d"].ToFloat(); |
| | | var e = saveDataModel.MainData["e"].ToFloat(); |
| | | var stackNoRange = saveDataModel.MainData["stackNoRange"].ToInt(); |
| | | if (stackNoRange < 3) return responseContent.Error("æå
æ°éä¸è½å°äº3个ï¼"); |
| | | if (stackNoRange > 6) return responseContent.Error("æå
æ°éä¸è½å¤äº6个ï¼"); |
| | | if (e > 1060 && stackNoRange > 5) return responseContent.Error("æå
æ°éä¸è½è¶
è¿5个ï¼"); |
| | | var height = a + b + c + (stackNoRange - 1) * (a + b + c + d); |
| | | if (height > 1170) return responseContent.Error($"æå
æ°éä¸è½è¶
è¿{stackNoRange}个ï¼"); |
| | | responseContent = base.Add(saveDataModel); |
| | | return responseContent; |
| | | } |
| | | public override WebResponseContent Update(SaveModel saveModel) |
| | | { |
| | | WebResponseContent responseContent = new WebResponseContent(); |
| | | var a = saveModel.MainData["a"].ToFloat(); |
| | | var b = saveModel.MainData["b"].ToFloat(); |
| | | var c = saveModel.MainData["c"].ToFloat(); |
| | | var d = saveModel.MainData["d"].ToFloat(); |
| | | var e = saveModel.MainData["e"].ToFloat(); |
| | | var stackNoRange = saveModel.MainData["stackNoRange"].ToInt(); |
| | | if (stackNoRange < 3) return responseContent.Error("æå
æ°éä¸è½å°äº3个ï¼"); |
| | | if (stackNoRange > 6) return responseContent.Error("æå
æ°éä¸è½å¤äº6个ï¼"); |
| | | if (e > 1060 && stackNoRange > 5) return responseContent.Error("æå
æ°éä¸è½è¶
è¿5个ï¼"); |
| | | var height = a + b + c + (stackNoRange - 1) * (a + b + c + d); |
| | | if (height > 1170) return responseContent.Error($"æå
æ°éä¸è½è¶
è¿{stackNoRange}个ï¼"); |
| | | responseContent = base.Update(saveModel); |
| | | return responseContent; |
| | | } |
| | | } |
| | | } |