public OstiUploadObject SaveOstiUpload(OstiUploadObject ostiUpload) { // Only save new records. if (ostiUpload.OstiUploadId == 0) { string sql = @" INSERT INTO dat_OstiUpload ( SortMainId, RecordDate, RequestXml, Response, Status ) VALUES ( @SortMainId, @RecordDate, @RequestXml, @Response, @Status ) SELECT CAST(SCOPE_IDENTITY() AS INT)"; ostiUpload.OstiUploadId = Config.Conn.Query <int>(sql, ostiUpload).Single(); } return(ostiUpload); }
public static void AddLogRecord(int sortMainId, string xml, string response, string status) { try { OstiUploadObject o = new OstiUploadObject(); o.SortMainId = sortMainId; o.RequestXml = xml; o.Response = response; o.Status = status; o.RecordDate = DateTime.Now; o.Save(); } catch (Exception ex) { ErrorLogObject.LogError("OstiUploadObject::AddLogRecord", ex); } }