public ResponseStatus PostDOSOMapping(DOSOMappingObj data) { //dynamic res = null; dynamic res = new ResponseStatus(); try { var result = SODAL.PostDOSOMapping(data); if (result) { res.status = new Status(); } else { res.status = new Status(); res.status.code = "01"; res.status.message = "can't insert data"; } } catch (Exception ex) { throw ex; } return(res); }
public ResponseStatus PostDOSOMapping([FromBody] DOSOMappingObj data) { try { return(base.PostDataToAPINotAuth <ResponseStatus>(base.apiPathAndQuery, data)); } catch (Exception ex) { throw ex; } }
public bool PostDOSOMapping(DOSOMappingObj data) { bool result = false; using (IDbConnection connection = GetOpenConnection()) { var transaction = connection.BeginTransaction(); try { string sql = @"INSERT INTO TempFromEDO (TransTypeCode, DoNo, SoNo, TruckNo, ContainerNo, CreatedBy, CreatedOn) VALUES (@TransTypeCode, @DoNo, @SoNo, @TruckNo, @ContainerNo, 'eDO System', getdate() )"; var resultInsert = connection.Execute(sql, data, transaction, null, CommandType.Text); if (resultInsert > 0) { result = true; transaction.Commit(); } } catch (Exception ex) { transaction.Rollback(); throw ex; } finally { if (connection != null) { connection.Close(); } } return(result); } }
public ResponseStatus PostDOSOMapping([FromBody] DOSOMappingObj data) { ResponseStatus res = new ResponseStatus(); try { res = process.PostDOSOMapping(data); } catch (Exception ex) { throw ex; } return(res); }