public ResponseAll GetDetailTechnician(string assignmentId, string userId) { var result = new ResponseAll(); result.Assignment = new Assignment(); var activities = _activityRepository.GetActivitiesByAssignmentByUserId(assignmentId, userId); if (activities != null) { foreach (var activity in activities) { var traces = _activityRepository.GetTracesByActivityId(activity.Id); if (traces != null) { activity.Traces = new List <Trace>(traces); } } result.Assignment.Activities = new List <Activity>(activities); } var documents = _documentRepository.GetDocumentsByAssignmentByUserId(assignmentId, userId); if (documents != null) { result.Assignment.Documents = new List <Document>(documents); } var documentsEntity = _documentRepository.GetAllEntityDocument(); if (documentsEntity != null) { result.DocumentsEntity = new List <DocumentEntity>(documentsEntity); } return(result); }
public IEnumerator RequestVersions() { var url = "master/version"; HttpClient client = new HttpClient(); yield return(App.Util.AppManager.CurrentScene.StartCoroutine(client.Send(url))); ResponseAll response = client.Deserialize <ResponseAll>(); this.versions = response.versions; }
public IEnumerator RequestAll(string type = "") { var url = "master/alldata"; WWWForm form = new WWWForm(); if (string.IsNullOrEmpty(type)) { form.AddField("character", 1); form.AddField("tile", 1); } else { form.AddField(type, 1); } HttpClient client = new HttpClient(); yield return(App.Util.AppManager.CurrentScene.StartCoroutine(client.Send(url, form))); responseAll = client.Deserialize <ResponseAll>(); }
//MODIFY public ResponseAll GetByUserId(string userId) { var result = new ResponseAll(); var assignments = _assignmentRepository.GetByUserId(userId); if (assignments == null) { result.Message = "No se encontraron OT asignadas"; return(result); } result.Assignments = new List <Assignment>(assignments); var activitiesEntity = _activityRepository.GetAllEntityActivity(); if (activitiesEntity != null) { result.ActivitiesEntity = new List <ActivityEntity>(activitiesEntity); } var documentsEntity = _documentRepository.GetAllEntityDocument(); if (documentsEntity != null) { result.DocumentsEntity = new List <DocumentEntity>(documentsEntity); } foreach (var item in result.Assignments) { var activities = _activityRepository.GetActivitiesByAssignmentByUserId(item.Id, userId); if (activities != null) { item.Activities = new List <Activity>(activities); } var documents = _documentRepository.GetDocumentsByAssignmentByUserId(item.Id, userId); if (documents != null) { item.Documents = new List <Document>(documents); } } return(result); }
public IEnumerator RequestLogin(string account, string pass) { var url = "user/login"; WWWForm form = new WWWForm(); form.AddField("account", account); form.AddField("pass", pass); HttpClient client = new HttpClient(); yield return(App.Util.SceneManager.CurrentScene.StartCoroutine(client.Send(url, form))); ResponseAll response = client.Deserialize <ResponseAll>(); if (response.result) { this.self = App.Util.Cacher.UserCacher.Instance.Get(response.user.id); App.Util.Global.ssid = response.ssid; PlayerPrefs.SetString("account", account); PlayerPrefs.SetString("password", pass); PlayerPrefs.Save(); } }
//WEB SUPERVISOR public ResponseAll GetOTs(Assignment item, int pageIndex, int pageSize) { List <Assignment> assignments = null; int count = 0; if (item.TypeConsult == 2) { assignments = new List <Assignment>(_assignmentRepository.GetByOTsReport(item, pageIndex, pageSize)); count = _assignmentRepository.GetByOTsReportCount(item, pageIndex, pageSize); } else { assignments = new List <Assignment>(_assignmentRepository.GetByOTs(item, pageIndex, pageSize)); count = _assignmentRepository.GetByOTsCount(item, pageIndex, pageSize); } var response = new ResponseAll { Assignments = new List <Assignment>(assignments), TotalRows = count }; return(response); }