123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Net;
- using System.Text;
- using System.Threading;
- using System.Web.Http;
- using System.Web.UI;
- using AutoMapper;
- using DataTransfersLibs.Models;
- using DataTransfersLibs.Service;
- using Gs.TransData.WebApi.Models;
- using Newtonsoft.Json;
- using SysBaseLibs;
- using SysDataLibs.TableClass;
- namespace Gs.TransData.WebApi.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.GetSampleInfo(poAccount);
- result.Result= JsonConvert.DeserializeObject(lcRetVal);
- }
- catch (Exception e)
- {
- this.LogError(e);
- result.Msg = e.Message;
- }
- return result;
- }
- }
- }
|