public string List(int start, int limit) { MessageResponse msg = new MessageResponse(); DataResponse<TMA.MODEL.Entity.AuditEntry> dataResponse = new DataResponse<TMA.MODEL.Entity.AuditEntry>(); try { dataResponse.Result = AuditEntryDao.findAll(start, limit); dataResponse.Total = AuditEntryDao.Count(); return dataResponse.ToJsonString(); } catch (Exception ex) { msg.Message = ConfigManager.ListErrorMessage; msg.Error = ex.ToString(); File.AppendAllText(ConfigManager.LogPath, msg.ToString()); } System.Threading.Thread.Sleep(int.Parse(ConfigManager.TimeForResponseRequest)); return serialize.Serialize(msg); }
public string Find(int start, int limit, string field, string value) { MessageResponse msg = new MessageResponse(); DataResponse<TMA.MODEL.Entity.Person> dataResponse = new DataResponse<TMA.MODEL.Entity.Person>(); try { dataResponse.Result = PersonsDao.findBy(start, limit, field, value); dataResponse.Total = PersonsDao.Count(field, value); return dataResponse.ToJsonString(); } catch (Exception ex) { msg.Message = ConfigManager.ListErrorMessage; msg.Error = ex.ToString(); } return serialize.Serialize(msg); }
public string Find(int start, int limit, string field, string value) { MessageResponse msg = new MessageResponse(); DataResponse<TMA.MODEL.Entity.Diary> dataResponse = new DataResponse<TMA.MODEL.Entity.Diary>(); try { decimal numberParam; if (decimal.TryParse(value, out numberParam)) { dataResponse.Result = DiariesDao.findBy(start, limit, field, numberParam); dataResponse.Total = DiariesDao.Count(field, numberParam); return dataResponse.ToJsonString(); } else { if (field.Contains("Person")) { if (field.Contains("Company")) { dataResponse.Result = DiariesDao.findCompanyBy(start, limit, field.Split('.')[2], value); dataResponse.Total = DiariesDao.CountCompany(field.Split('.')[2], value); return dataResponse.ToJsonString(); } else { dataResponse.Result = DiariesDao.findPersonBy(start, limit, field.Split('.')[1], value); dataResponse.Total = DiariesDao.CountPerson(field.Split('.')[1], value); return dataResponse.ToJsonString(); } } if (field.Contains("Functionary")) { if (field.Contains("Name")) { dataResponse.Result = DiariesDao.findFunctionaryBy(start, limit, field.Split('.')[2], value); dataResponse.Total = DiariesDao.CountFunctionary(field.Split('.')[2], value); return dataResponse.ToJsonString(); } } else { dataResponse.Result = DiariesDao.findBy(start, limit, field, value); dataResponse.Total = DiariesDao.Count(field, value); return dataResponse.ToJsonString(); } } } catch (Exception ex) { msg.Message = ConfigManager.ListErrorMessage; msg.Error = ex.ToString(); File.AppendAllText(ConfigManager.LogPath, msg.ToString()); } return serialize.Serialize(msg); }
public string List(int start, int limit) { MessageResponse msg = new MessageResponse(); DataResponse<TMA.MODEL.Entity.Diary> dataResponse = new DataResponse<TMA.MODEL.Entity.Diary>(); try { DateTime today = System.DateTime.Today; dataResponse.Result = DiariesDao.findBy(start, limit, "DateDiary", today.ToString("yyyy-MM-dd")); dataResponse.Total = DiariesDao.Count("DateDiary", today.ToString("yyyy-MM-dd")); return dataResponse.ToJsonString(); } catch (Exception ex) { msg.Message = ConfigManager.ListErrorMessage; msg.Error = ex.ToString(); File.AppendAllText(ConfigManager.LogPath, msg.ToString()); } System.Threading.Thread.Sleep(int.Parse(ConfigManager.TimeForResponseRequest)); return serialize.Serialize(msg); }