public SaveEntityResult SaveContractor(Contractor contractor) { try { _WriteLineConsole($"save contrctor {contractor.FirstName}"); using (var helper = new TransactionInfoHelper()) { helper.SaveContractor(contractor); return(new SaveEntityResult() { Id = contractor.Id }); } } catch (Exception ex) { _WriteLineError($"save contrctor {contractor?.FirstName}", ex.Message); return(new SaveEntityResult() { Error = true, Message = ex.Message }); } }
public ContractorInfo GetContractorInfo() { try { _WriteLineConsole("get contractor info"); using (TransactionInfoHelper helper = new TransactionInfoHelper()) return(helper.GetContractorInfo()); } catch (Exception ex) { _WriteLineError("get contractor info", ex.Message); return(new ContractorInfo() { Error = true, Message = ex.Message }); } }
public UserFileDto GetUserFile(int id) { try { _WriteLineConsole($"get user file id {id}"); using (var helper = new TransactionInfoHelper()) return new UserFileDto() { UserFile = helper.GetUserFile(id) }; } catch (Exception ex) { _WriteLineError($"get user file id {id}", ex.Message); return(new UserFileDto() { Error = true, Message = ex.Message }); } }
public SearchTrancportResult SearchTrancports(TypeSearchTrancport type, string text) { try { _WriteLineConsole($"Search trancport where {text}"); using (var helper = new TransactionInfoHelper()) return new SearchTrancportResult() { Trancports = helper.SearchTrancport(type, text) }; } catch (Exception ex) { _WriteLineError($"Search trancport where {text}", ex.Message); return(new SearchTrancportResult() { Error = true, Message = ex.Message }); } }
public SaveEntityResult SaveTrancport(Trancport trancport) { try { _WriteLineConsole($"save trancport {trancport.Model?.Name}"); using (var helper = new TransactionInfoHelper()) { helper.SaveTrancport(trancport); return(new SaveEntityResult() { Id = trancport.Id }); } } catch (Exception ex) { _WriteLineError($"save trancport {trancport?.Model?.Name}", ex.Message); return(new SaveEntityResult() { Error = true, Message = ex.Message }); } }