1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- using System;
- using DataTransfersLibs.Models;
- using DataTransfersLibs.Service;
- using GSMarketSys.Models;
- using Newtonsoft.Json;
- using SysBaseLibs;
- namespace GSMarketSys.Service
- {
- public class TranslationService
- {
- public static TranslationService Instance => new TranslationService();
- public JsonResult DataUpload(string xmlStr)
- {
- DataUpdateService loDataUpData = new DataUpdateService(xmlStr);
- var result = new DataUploadResult();
- if (loDataUpData.CheckUserValid())
- {
- result.Result = loDataUpData.UpdateAllRecords();
- result.Total = loDataUpData.Total;
- result.Successed = loDataUpData.Successed;
- result.Failed = loDataUpData.Failed;
- }
- if (!string.IsNullOrEmpty(loDataUpData.ErrorMsg))
- {
- result.Msg = loDataUpData.ErrorMsg;
- }
- return new JsonResult(result);
- }
- public JsonResult GetSampleInfo(AccountInfo poAccount)
- {
- var result = new JsonResult {Success = true};
- try
- {
- string lcRetVal = QueryDataService.Instance.GetSampleInfo(poAccount);
- result.Result= JsonConvert.DeserializeObject(lcRetVal);
- }
- catch (Exception e)
- {
- this.LogError(e);
- result.Msg = e.Message;
- }
- return result;
- }
- public JsonResult GetCheckItemInfo(AccountInfo poAccount)
- {
- var result = new JsonResult {Success = true};
- try
- {
- string lcRetVal = QueryDataService.Instance.GetCheckItemInfo(poAccount);
- result.Result= JsonConvert.DeserializeObject(lcRetVal);
- }
- catch (Exception e)
- {
- this.LogError(e);
- result.Msg = e.Message;
- }
- return result;
- }
- public JsonResult GetCheckMethodInfo(AccountInfo poAccount)
- {
- var result = new JsonResult {Success = true};
- try
- {
- string lcRetVal = QueryDataService.Instance.GetCheckMethodInfo(poAccount);
- result.Result= JsonConvert.DeserializeObject(lcRetVal);
- }
- catch (Exception e)
- {
- this.LogError(e);
- result.Msg = e.Message;
- }
- return result;
- }
- public JsonResult GetDistrictInfo(AccountInfo poAccount)
- {
- var result = new JsonResult {Success = true};
- try
- {
- string lcRetVal = QueryDataService.Instance.GetDistrictInfo(poAccount);
- result.Result= JsonConvert.DeserializeObject(lcRetVal);
- }
- catch (Exception e)
- {
- this.LogError(e);
- result.Msg = e.Message;
- }
- return result;
- }
- }
- }
|